This application relates to the field of computer technologies, and in particular, to an audio data processing method and apparatus.
A karaoke system is a combination of a music player and recording software. During use of the karaoke system, an accompaniment to a song may be played independently, and additionally a singing voice of a user may be synthesized into the accompaniment to the song, and audio effect processing may be performed on the singing voice of the user, and so on. Usually, the karaoke system includes a song library and an accompaniment library. In the related art, the accompaniment library mainly includes an original accompaniment, and the original accompaniment needs to be recorded by professionals. As a result, the recording efficiency is low, and this does not facilitate mass production.
According to an aspect of one or more embodiments, there is provided a method. The method includes obtaining audio data. An overall spectrum of the audio data is obtained and separated into a singing voice spectrum and an accompaniment spectrum. An accompaniment binary mask of the audio data is calculated according to the audio data. The singing voice spectrum and the accompaniment spectrum are processed using the accompaniment binary mask, to obtain accompaniment data and singing voice data.
According to other aspects of one or more embodiments, there are provided an apparatus and another method consistent with the above method.
Exemplary embodiments will be described below with reference to the accompanying drawings, in which:
The following clearly and completely describes the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. The described embodiments are merely a part rather than all of the embodiments of this application. All other embodiments obtained by a person skilled in the art based on the embodiments of this application without creative efforts shall fall within the protection scope of this application and the appended claims.
To implement mass production of accompaniment, an inventor of this application considers that a voice removal method may be used. Mainly, an Azimuth Discrimination and Resynthesis (ADRess) method may be used to perform voice removal processing on a batch of songs, to improve the accompaniment production efficiency. In the related art, this processing method is mainly implemented based on a similarity between strengths of a voice on left and right channels and a similarity between strengths of a sound of an instrument on left and right channels. For example, the strengths of the voice on the left and right channels are similar, and the strengths of the sound of the instrument on the left and right channels differ from each other. By means of this related art method, although a voice in a song may be removed to some extent, because strengths of sounds of some instruments such as a drum and a bass on the left and right channels are also similar, the sounds of the instruments may be removed together with the voice. Consequently, it is hard to obtain entire accompaniment, the precision is low, and the distortion degree is high.
In view of this, embodiments of this application provide an audio data processing method, apparatus, and system.
Referring to
The to-be-separated audio data may be a song, the target accompaniment data may be accompaniment, and the target singing voice data may be a singing voice. The audio data processing system may further include a terminal, and the terminal may include a smartphone, a computer, another music playback device, or the like. When a singing voice and accompaniment need to be separated from a to-be-separated song, the application server may obtain the to-be-separated song, calculate an overall spectrum according to the to-be-separated song, and separate and adjust the overall spectrum, to obtain an initial singing voice spectrum and an initial accompaniment spectrum. Meanwhile, the application server calculates an accompaniment binary mask according to the to-be-separated song, and processes the initial singing voice spectrum and the initial accompaniment spectrum by using the accompaniment binary mask, to obtain a singing voice and accompaniment. Subsequently, a user may obtain a singing voice or accompaniment from the application server by means of an application or a web page screen in the terminal when connecting to a network.
It may be understood that in the foregoing method, an objective of performing the step of “adjusting the overall spectrum according to the separated singing voice spectrum and the separated accompaniment spectrum, to obtain an initial singing voice spectrum and an initial accompaniment spectrum” is to ensure that an output signal has a better dual channel effect. Actually, for an objective: separating entire accompaniment from a song, this step may be omitted. That is, in the following Embodiment 1, S104 may be omitted in some embodiments. In this way, a process of performing the step of “processing the initial singing voice spectrum and the initial accompaniment spectrum by using the accompaniment binary mask” is “processing the separated singing voice spectrum and the separated accompaniment spectrum by using the accompaniment binary mask”. That is, in S106 in the following Embodiment 1, the separated singing voice spectrum and the separated accompaniment spectrum may be directly processed by using the accompaniment binary mask. Similarly, an adjustment module 40 in the following Embodiment 3 may be omitted. When the audio data processing apparatus does not include the adjustment module 40, a processing module 60 directly processes the separated singing voice spectrum and the separated accompaniment spectrum by using the accompaniment binary mask.
The following separately gives a detailed description. It should be noted that sequence numbers of the following embodiments do not indicate a sequence of priorities of the embodiments.
This embodiment is described from the perspective of an audio data processing apparatus, and the audio data processing apparatus may be integrated into a server.
Referring to
S101. Obtain to-be-separated audio data.
In this embodiment, the to-be-separated audio data mainly includes an audio file including a voice and an accompaniment sound, for example, a song, a segment of a song, or an audio file recorded by a user, and is usually represented as a time-domain signal, for example, may be a dual-channel time-domain signal.
Specifically, when a user stores a new to-be-separated audio file in the server or when the server detects that a designated database stores a to-be-separated audio file, the to-be-separated audio file may be obtained.
S102. Obtain an overall spectrum of the to-be-separated audio data.
For example, step S102 may specifically include the following step:
performing mathematical transformation on the to-be-separated audio data, to obtain the overall spectrum.
In this embodiment, the overall spectrum may be represented as a frequency-domain signal. The mathematical transformation may be STFT. The STFT transform is related to Fourier transform, and is used to determine a frequency and a phase of a sine wave of a partial region of a time-domain signal, that is, convert a time-domain signal into a frequency-domain signal. After STFT is performed on the to-be-separated audio data, an STFT spectrum diagram is obtained. The STFT spectrum diagram is a graph formed by using the converted overall spectrum according to a voice strength characteristic.
It should be understood that because in this embodiment, the to-be-separated audio data mainly is a dual-channel time-domain signal, the converted overall spectrum should also be a dual-channel frequency-domain signal. For example, the overall spectrum may include a left-channel overall spectrum and a right-channel overall spectrum.
S103. Separate the overall spectrum, to obtain a separated singing voice spectrum and a separated accompaniment spectrum.
The singing voice spectrum includes a spectrum corresponding to a singing part of a musical composition, and the accompaniment spectrum includes a spectrum corresponding to an accompaniment part of the musical composition. It may also be understood that accompaniment is a music part that mainly provides rhythm and/or harmonic supports for a song, melody of an instrument, or a main theme, and therefore, the accompaniment spectrum may be understood as a spectrum of the music part. In addition, singing is an action of producing a music sound by means of a voice, and a singer adds a daily language by using a continuous tone and rhythm and various vocalization skills. A singing voice is a voice of singing a song, and therefore, the singing voice spectrum may be understood as a spectrum of a voice of singing a song.
Step S103 may further be described as “separating the overall spectrum, to obtain the singing voice spectrum and the accompaniment spectrum”. To distinguish between the singing voice spectrum and the accompaniment spectrum and another singing voice spectrum and another accompaniment spectrum, the singing voice spectrum herein may be referred to as a first singing voice spectrum, and the accompaniment spectrum herein may be referred to as a first accompaniment spectrum.
In this embodiment, the musical composition mainly includes a song, the singing part of the musical composition mainly is a voice, and the accompaniment part of the musical composition mainly is a sound of an instrument. Specifically, the overall spectrum may be separated by using a preset algorithm. The preset algorithm may be determined according to requirements of an actual application. For example, in this embodiment, the preset algorithm may use a part of algorithm in a related art ADRess method, and may be specifically as follows:
1. It is assumed that an overall spectrum of a current frame includes a left-channel overall spectrum Lf(k) and a right-channel overall spectrum Rf(k), where k is a band index. Azimugram of a right channel and Azimugram of a left channel are separately calculated as follows:
the Azimugram of the right channel is AZR(k,i)=|Lf(k)−g(i)*Rf(k)|; and
the Azimugram of the left channel is AZL(k,i)=|Rf(k)−g(i)*Lf(k)|.
g(i) is a scale factor, g(i)=i/b, 0≤i≤b, b is an azimuth resolution, i is an index, and Azimugram represents a degree to which a frequency component in a kth band is cancelled under the scale factor g(i).
2. For each band, a scale factor having a highest cancellation degree is selected to adjust Azimugram:
if AZR(k,i)=min(AZR(k)), AZR(k,i)=max(AZR(k))−min(AZR(k));
otherwise AZR(k,i)=0; and
correspondingly, a same method may be used to calculate AZL(k, i).
3. For the adjusted Azimugram in step 2, because strengths of a voice on the left and right channels are similar, the voice is in a location in which i is relatively large in the Azimugram, that is, a location in which g(i) approaches 1. If a parameter subspace width H is given, a separated singing voice spectrum on the right channel is estimated as
and a separated accompaniment spectrum on the right channel is estimated as
Correspondingly, a separated singing voice spectrum VL(k) and a separated accompaniment spectrum ML(k) on the left channel may be obtained by using the same method, and details are not described herein again.
S104. Adjust the overall spectrum according to the separated singing voice spectrum and the separated accompaniment spectrum, to obtain an initial singing voice spectrum and an initial accompaniment spectrum.
In this embodiment, to ensure a dual-channel effect of a signal output by using the ADRess method, a mask further is calculated according to a separation result of the overall spectrum, and the overall spectrum is adjusted by using the mask, to obtain a final initial singing voice spectrum and initial accompaniment spectrum that have a better dual-channel effect.
To distinguish between the initial singing voice spectrum and the initial accompaniment spectrum and the first singing voice spectrum and the first accompaniment spectrum in step S103, the initial singing voice spectrum may be referred to as a second singing voice spectrum and the initial accompaniment spectrum may be referred to as a second accompaniment spectrum. In this way, step S104 may also be described as “adjusting the overall spectrum according to the first singing voice spectrum and the first accompaniment spectrum, to obtain the second singing voice spectrum and the second accompaniment spectrum”.
For example, step S104 may specifically include the following step:
calculating a singing voice binary mask according to the separated singing voice spectrum and the separated accompaniment spectrum, and adjusting the overall spectrum by using the singing voice binary mask, to obtain the initial singing voice spectrum and the initial accompaniment spectrum.
In this embodiment, the overall spectrum includes a right-channel overall spectrum Rf(k) and a left-channel overall spectrum Lf(k). Because both the separated singing voice spectrum and the separated accompaniment spectrum are dual-channel frequency-domain signals, the singing voice binary mask calculated according to the separated singing voice spectrum and the separated accompaniment spectrum correspondingly includes MaskR(k) corresponding to the left channel and MaskL(k) corresponding to the right channel.
For the right channel, a method for calculating a singing voice binary mask MaskR(k) may be: if VR(k)≥MR(k), MaskR(k)=1; or otherwise, MaskR(k)=0. Subsequently. Rf(k) is adjusted, to obtain the adjusted initial singing voice spectrum VR(k)′=Rf(k)*MaskR(k), and the adjusted initial accompaniment spectrum MR(k)′=Rf(k)*(1−MaskR(k)).
Correspondingly, for the left channel, the corresponding singing voice binary mask MaskL(k), the initial singing voice spectrum VL(k)′, and the initial accompaniment spectrum ML(k)′ may be obtained by using the same method, and details are not described herein again.
It should be supplemented that because when a related art ADRess method is used for processing, an output signal is a time-domain signal, a related art ADRess system frame is used. Inverse short-time Fourier transform (ISTFT) may be performed on the adjusted overall spectrum after the step of “adjusting the overall spectrum by using the singing voice binary mask”, to output initial singing voice data and initial accompaniment data. That is, a whole process of the related art ADRess method is completed. Subsequently, STFT transform may be performed on the initial singing voice data and the initial accompaniment data that are obtained after the transform, to obtain the initial singing voice spectrum and the initial accompaniment spectrum. For a specific system frame, refer to
S105. Calculate an accompaniment binary mask of the to-be-separated audio data according to the to-be-separated audio data.
For example, step S105 may specifically include the following steps.
(11). Perform independent component analysis (ICA) on the to-be-separated audio data, to obtain analyzed singing voice data and analyzed accompaniment data.
To distinguish between the analyzed singing voice data and the analyzed accompaniment data and other data, the analyzed singing voice data may be referred to as first singing voice data, and the analyzed accompaniment data may be referred to as first accompaniment data. Therefore, the step may be described as “performing ICA on the to-be-separated audio data, to obtain the first singing voice data and the first accompaniment data”.
In this embodiment, an ICA method is a method for studying blind source separation (BSS). In this method, the to-be-separated audio data (which mainly is a dual-channel time-domain signal) may be separated into an independent singing voice signal and an independent accompaniment signal, and an assumption is that components in a hybrid signal are non-Gaussian signals and independent statistics collection is performed on the components. A calculation formula may be approximately as follows:
U=Was.
Where s denotes the to-be-separated audio data, A denotes a hybrid matrix, W denotes an inverse matrix of A, the output signal U includes U1 and U2, U1 denotes the analyzed singing voice data, and U2 denotes the analyzed accompaniment data.
It should be noted that because the signal U output by using the ICA method are two unordered mono time-domain signals, and it is not clarified which signal is U1 and which signal is U2, relevance analysis may be performed on the output signal U and an original signal (that is, the to-be-separated audio data), a signal having a high relevance coefficient is used as U1, and a signal having a low relevance coefficient is used as U2.
(12) Calculate the accompaniment binary mask according to the analyzed singing voice data and the analyzed accompaniment data. That is, the accompaniment binary mask is calculated according to the first singing voice data and the first accompaniment data.
For example, step (12) may specifically include the following steps.
Perform mathematical transformation on the analyzed singing voice data and the analyzed accompaniment data, to obtain a corresponding analyzed singing voice spectrum and analyzed accompaniment spectrum.
To distinguish between the corresponding singing voice spectrum and accompaniment spectrum and other spectra, the analyzed singing voice spectrum may be referred to as a fourth singing voice spectrum, and the analyzed accompaniment spectrum may be referred to as a fourth accompaniment spectrum. Therefore, this step may be described as “performing mathematical transformation on the first singing voice data and the first accompaniment data, to obtain the corresponding fourth singing voice spectrum and fourth accompaniment spectrum”.
(12) Calculate the accompaniment binary mask according to the analyzed singing voice spectrum and the analyzed accompaniment spectrum. That is, the accompaniment binary mask is calculated according to the fourth singing voice spectrum and the fourth accompaniment spectrum.
In this embodiment, the mathematical transformation may be STFT transform, and is used to convert a time-domain signal into a frequency-domain signal. It is easily understood that because both the analyzed singing voice data and the analyzed accompaniment data that are output by using the ICA method are mono time-domain signals, there is only one accompaniment binary mask calculated according to the analyzed singing voice data and the analyzed accompaniment data, and the accompaniment binary mask may be applied to the left channel and the right channel at the same time.
There may be a plurality of manners of “calculating the accompaniment binary mask according to the analyzed singing voice spectrum and the analyzed accompaniment spectrum”. For example, the manners may specifically include the following steps:
performing a comparison analysis on the analyzed singing voice spectrum and the analyzed accompaniment spectrum, and obtaining a comparison result; and
calculating the accompaniment binary mask according to the comparison result.
In this embodiment, the method for calculating the accompaniment binary mask is similar to the method for calculating the singing voice binary mask in step S104. Specifically, assuming that the analyzed singing voice spectrum is VU(k), the analyzed accompaniment spectrum is MU(k), and the accompaniment binary mask is MaskU(k), the method for calculating MaskU(k) may be:
if MU(k)≥VU(k), MaskU(k)=1; or if MU(k)<VU(k), MaskU(k)=0.
S106. Process the initial singing voice spectrum and the initial accompaniment spectrum by using the accompaniment binary mask, to obtain target accompaniment data and target singing voice data.
The target accompaniment data may be referred to as second accompaniment data, and the target singing voice data may be referred to as second singing voice data. That is, the second singing voice spectrum and the second accompaniment spectrum are processed by using the accompaniment binary mask, to obtain the second accompaniment data and the second singing voice data.
For example, step S106 may specifically include the following steps.
(21). Filter the initial singing voice spectrum by using the accompaniment binary mask, to obtain a target singing voice spectrum and an accompaniment subspectrum.
The target singing voice spectrum may be referred to as a third singing voice spectrum. Therefore, this step may also be described as “filtering the second singing voice spectrum by using the accompaniment binary mask, to obtain the third singing voice spectrum and the accompaniment subspectrum”.
In this embodiment, because the initial singing voice spectrum is a dual-channel frequency-domain signal, that is, includes an initial singing voice spectrum VR(k)′ corresponding to the right channel and an initial singing voice spectrum VL(k)′ corresponding to the left channel, if the accompaniment binary mask MaskU(k) is imposed to the initial singing voice spectrum, the obtained target singing voice spectrum and the obtained accompaniment subspectrum should also be dual-channel frequency-domain signals.
It may be understood that the accompaniment subspectrum actually is an accompaniment component mingled with the initial singing voice spectrum.
For example, using the right channel as an example, step (21) may specifically include the following steps:
multiplying the initial singing voice spectrum by the accompaniment binary mask, to obtain the accompaniment subspectrum; and
subtracting the accompaniment subspectrum from the initial singing voice spectrum, to obtain the target singing voice spectrum.
In this embodiment, assuming that an accompaniment subspectrum corresponding to the right channel is MR1(k), and a target singing voice spectrum corresponding to the right channel is VRtarget(k), MR1(k)=VR(k)′*MaskU(k), that is. MR1(k)=Rf(k)*MaskR(k)*MaskU(k), and VRtarget(k)=VR(k)′−MR(k)=Rf(k)*MaskR(k)*(1−MaskU(k)).
(22). Perform calculation by using the accompaniment subspectrum and the initial accompaniment spectrum, to obtain a target accompaniment spectrum.
The target accompaniment spectrum may be referred to as a third accompaniment spectrum. Therefore, this step may also be described as “performing calculation by using the accompaniment subspectrum and the second accompaniment spectrum, to obtain the third accompaniment spectrum”.
For example, using the right channel as an example, step (22) may specifically include the following steps:
adding the accompaniment subspectrum and the initial accompaniment spectrum, to obtain the target accompaniment spectrum.
In this embodiment, assuming that a target accompaniment spectrum corresponding to the right channel is MRtarget(k), MRtarget(k)=MR(k)′+MR1(k)=Rf(k)*(1−MaskR(k))+Rf(k)*MaskR(k)*MaskU(k).
In addition, it should be emphasized that step (21) and step (22) describe only related calculation using the right channel as an example. Similarly, step (21) and step (22) are also applicable to related calculation for the left channel, and details are not described herein again.
(23) Perform mathematical transformation on the target singing voice spectrum and the target accompaniment spectrum, to obtain the corresponding target accompaniment data and target singing voice data. That is, mathematical transformation is performed on the third singing voice spectrum and the third accompaniment spectrum, to obtain the corresponding accompaniment data and singing voice data. The accompaniment data herein may also be referred to as second accompaniment data, and the singing voice data may also be referred to as second singing voice data.
In this embodiment, the mathematical transformation may be ISTFT transform, and is used to convert a frequency-domain signal into a time-domain signal. In some embodiments, after obtaining dual-channel target accompaniment data and target singing voice data, the server may further process the target accompaniment data and the target singing voice data, for example, may deliver the target accompaniment data and the target singing voice data to a network server bound to the server, and a user may obtain the target accompaniment data and the target singing voice data from the network server by using an application installed in or a web page screen in a terminal device.
As may be learned from the above, in the audio data processing method provided in this embodiment, the to-be-separated audio data is obtained, the overall spectrum of the to-be-separated audio data is obtained, the overall spectrum is separated to obtain the separated singing voice spectrum and the separated accompaniment spectrum, and the overall spectrum is adjusted according to the separated singing voice spectrum and the separated accompaniment spectrum, to obtain the initial singing voice spectrum and the initial accompaniment spectrum. Meanwhile, the accompaniment binary mask is calculated according to the to-be-separated audio data, and finally, the initial singing voice spectrum and the initial accompaniment spectrum are processed by using the accompaniment binary mask, to obtain the target accompaniment data and the target singing voice data. Because in this solution, after the initial singing voice spectrum and the initial accompaniment spectrum are obtained according to the to-be-separated audio data, the initial singing voice spectrum and the initial accompaniment spectrum may further be adjusted according to the accompaniment binary mask, an accompaniment mingled with the singing voice spectrum may be filtered out, and further, the accompaniment and the initial accompaniment spectrum are synthesized into an entire accompaniment, greatly improving the separation accuracy. Therefore, an accompaniment and a singing voice may be separated from a song completely, so that not only the distortion degree may be reduced, but also mass production of accompaniments may be implemented, and the processing efficiency is high.
It may be understood that in other embodiments, for names of various singing voice data, accompaniment data, singing voice spectra, and accompaniment spectra, refer to this embodiment.
The following gives a detailed description by using an example according to the method described in Embodiment 1.
This embodiment is described in detail by using an example in which the audio data processing apparatus is integrated into a server, for example, the server may be an application server corresponding to a karaoke system, the to-be-separated audio data is a to-be-separated song, and the to-be-separated song is represented as a dual-channel time-domain signal.
As shown in
S201. The server obtains the to-be-separated song.
For example, when a user stores a to-be-separated song in the server, or when the server detects that a designated database stores a to-be-separated song, the to-be-separated song may be obtained.
S202. The server performs STFT on the to-be-separated song, to obtain an overall spectrum.
For example, the to-be-separated song is a dual-channel time-domain signal, and the overall spectrum is a dual-channel frequency-domain signal, and includes a left-channel overall spectrum and a right-channel overall spectrum. Referring to
S203. The server separates the overall spectrum by using a preset algorithm, to obtain a separated singing voice spectrum and a separated accompaniment spectrum.
For example, the preset algorithm may use a part of algorithm in a related art ADRess method, and may be specifically as follows:
1. It is assumed that a left-channel overall spectrum of a current frame is Lf(k) and a right-channel overall spectrum of the current frame is Rf(k), where k is a band index. Azimugram of the right channel and Azimugram of the left channel are separately calculated as follows:
the Azimugram of the right channel is AZR(k,i)=|Lf(k)−g(i)*Rf(k)|; and
the Azimugram of the left channel is AZL(k,i)=|Rf(k)−g(i)*Lf(k)|.
g(i) is a scale factor, g(i)=i/b, 0≤i≤b, b is an azimuth resolution, i is an index, and Azimugram represents a degree to which a frequency component in a kth band is cancelled under the scale factor g(i).
2. For each band, a scale factor having a highest cancellation degree is selected to adjust Azimugram:
if AZR(k,i)=min(AZR(k)), AZR(k,i)=max(AZR(k))−min(AZR(k)); or otherwise, AZR(k,i)=0; and
if AZL(k,i)=min(AZL(k)), AZL(k,i)=max(AZL(k))−min(AZL(k)); or otherwise, AZL(k,i)=0.
3. For the adjusted Azimugram in step 2, if a parameter subspace width H is given, a separated singing voice spectrum on the right channel is estimated as
and a separated accompaniment spectrum on the right channel is estimated as
and
a separated singing voice spectrum on the left channel is estimated as
and a separated accompaniment spectrum on the left channel is estimated as
S204. The server calculates a singing voice binary mask according to the separated singing voice spectrum and the separated accompaniment spectrum, and adjusts the overall spectrum by using the singing voice binary mask, to obtain an initial singing voice spectrum and an initial accompaniment spectrum.
For example, for the right channel, a method for calculating a singing voice binary mask MaskR(k) may be: if VR(k)≥MR(k). MaskR(k)=1; or otherwise. MaskR(k)=0. Subsequently, the right-channel overall spectrum Rf(k) is adjusted, to obtain an adjusted initial singing voice spectrum VR(k)′=Rf(k)*MaskR(k), and an adjusted initial accompaniment spectrum MR(k)′=Rf(k)*(1−MaskR(k)).
For the left channel, a method for calculating a singing voice binary mask MaskL(k) may be: if VL(k)≥ML(k), MaskL(k)=1: or otherwise, MaskL(k)=0. Subsequently, the left-channel overall spectrum Lf(k) is adjusted, to obtain the adjusted initial singing voice spectrum VL(k)′=Lf(k)*MaskL(k), and the adjusted initial accompaniment spectrum ML(k)′=Lf(k)*(1−MaskL(k)).
S205. The server performs ICA on the to-be-separated song, to obtain analyzed singing voice data and analyzed accompaniment data.
For example, a calculation formula of the ICA may be approximately as follows:
U=Was.
where s denotes the to-be-separated song, A denotes a hybrid matrix, W denotes an inverse matrix of A, the output signal U includes U1 and U2, U1 denotes the analyzed singing voice data, and U2 denotes the analyzed accompaniment data.
It should be noted that because the signal U output by using the ICA method are two unordered mono time-domain signals, and it is not clarified which signal is U1 and which signal is U2, relevance analysis may be performed on the output signal U and an original signal (that is, the to-be-separated song), a signal having a high relevance coefficient is used as U1, and a signal having a low relevance coefficient is used as U2.
S206. The server performs STFT on the analyzed singing voice data and the analyzed accompaniment data, to obtain a corresponding analyzed singing voice spectrum and analyzed accompaniment spectrum.
For example, the server correspondingly obtains the analyzed singing voice spectrum VU(k) and the analyzed accompaniment spectrum MU(k) after separately performing STFT processing on the output signals U1 and U2.
S207. The server performs comparison analysis on the analyzed singing voice spectrum and the analyzed accompaniment spectrum, obtains a comparison result, and calculates an accompaniment binary mask according to the comparison result.
For example, assuming that the accompaniment binary mask is MaskU(k), a method for calculating MaskU(k) may be:
if MU(k)≥VU(k), Mask(k)=1; or if MU(k)<VU(k), Mask(k)−0.
It should be noted that steps S202 to S204 and steps S205 to S207 may be performed at the same time, or steps S202 to S204 may be performed before steps S205 to S207, or steps S205 to S207 may be performed before steps S202 to S204. Certainly, there may be another execution sequence, and the execution sequence is not limited herein.
S208. The server filters the initial singing voice spectrum by using the accompaniment binary mask, to obtain a target singing voice spectrum and an accompaniment subspectrum.
Step S208 may specifically include the following steps:
multiplying the initial singing voice spectrum by the accompaniment binary mask, to obtain the accompaniment subspectrum; and
subtracting the accompaniment subspectrum from the initial singing voice spectrum, to obtain the target singing voice spectrum.
For example, assuming that an accompaniment subspectrum corresponding to the right channel is MR1(k), and a target singing voice spectrum corresponding to the right channel is VRtarget(k) MR1(k)=VR(k)′*MaskU(k), that is, MR1(k)=Rf(k)*MaskR(k)*MaskU(k), and VRtarget=(k)=VR(k)′−MR1(k)=Rf(=k)*MaskR(k)*(1−MaskU(k)).
Assuming that an accompaniment subspectrum corresponding to the left channel is ML1(k), and a target singing voice spectrum corresponding to the left channel is VLtarget(k), ML1(k)=VL(k)′*MaskU(k), that is, ML1(k)=Lf(k)*MaskL(k)*MaskU(k), and VLtarget(k)=VL(k)′−ML1(k)=Lf(k)*MaskL(k)*(1−MaskU(k)).
S209. The server adds the accompaniment subspectrum and the initial accompaniment spectrum, to obtain a target accompaniment spectrum.
For example, assuming that a target accompaniment spectrum corresponding to the right channel is MRtarget(k), MRtarget(k)=MR(k)′+MR1(k)=Rf(k)*(1−MaskR(k))+Rf(k)*MaskR(k)*MaskU(k).
Assuming that a target accompaniment spectrum corresponding to the left channel is MLtarget(k), MLtarget(k)=ML(k)′+ML1(k)=Lf(k)*(1−MaskL(k))+Lf(k)*MaskL(k)*MaskU(k).
S210. The server performs ISTFT on the target singing voice spectrum and the target accompaniment spectrum, to obtain corresponding target accompaniment and a corresponding target singing voice.
For example, after the server obtains the target accompaniment and the target singing voice, a user may obtain the target accompaniment and the target singing voice from the server by using an application installed in or a web page screen in a terminal.
It should be noted that
As may be learned from the above, in the song processing method provided in this embodiment, the server obtains the to-be-separated song, performs STFT on the to-be-separated song to obtain the overall spectrum, and separates the overall spectrum by using the preset algorithm, to obtain the separated singing voice spectrum and the separated accompaniment spectrum. Subsequently, the server calculates the singing voice binary mask according to the separated singing voice spectrum and the separated accompaniment spectrum, and adjusts the overall spectrum by using the singing voice binary mask, to obtain the initial singing voice spectrum and the initial accompaniment spectrum. Meanwhile, the server performs ICA on the to-be-separated song, to obtain the analyzed singing voice data and the analyzed accompaniment data, and performs STFT on the analyzed singing voice data and the analyzed accompaniment data, to obtain the corresponding analyzed singing voice spectrum and analyzed accompaniment spectrum. Then, the server performs comparison analysis on the analyzed singing voice spectrum and the analyzed accompaniment spectrum, obtains the comparison result, and calculates the accompaniment binary mask according to the comparison result. Finally, the server filters the initial singing voice spectrum by using the accompaniment binary mask, to obtain the target singing voice spectrum and the accompaniment subspectrum, and performs ISTFT on the target singing voice spectrum and the target accompaniment spectrum, to obtain the corresponding target accompaniment data and the corresponding target singing voice data, so that accompaniment and a singing voice may be separated from a song completely, greatly improving the separation accuracy and reducing the distortion degree. In addition, mass production of accompaniment may further be implemented, and the processing efficiency is high.
Based on the methods described in Embodiment 1 and Embodiment 2, this embodiment is further described from the perspective of an audio data processing apparatus. Referring to
one or more memories; and
one or more processors, where
the one or more memories stores one or more instruction modules, and the one or more instruction modules are configured to be performed by the one or more processors; and
the one or more instruction modules include:
a first obtaining module 10, a second obtaining module 20, a separation module 30, an adjustment module 40, a calculation module 50, and a processing module 60.
1. First Obtaining Module 10
The first obtaining module 10 is configured to obtain to-be-separated audio data.
In this embodiment, the to-be-separated audio data mainly includes an audio file including a voice and an accompaniment sound, for example, a song, a segment of a song, or an audio file recorded by a user, and is usually represented as a time-domain signal, for example, may be a dual-channel time-domain signal.
Specifically, when a user stores a new to-be-separated audio file in a server or when a server detects that a designated database stores a to-be-separated audio file, the first obtaining module 10 may obtain the to-be-separated audio file.
2. Second Obtaining Module 20
The second obtaining module 20 is configured to obtain an overall spectrum of the to-be-separated audio data.
For example, the second obtaining module 20 may be specifically configured to:
perform mathematical transformation on the to-be-separated audio data, to obtain the overall spectrum.
In this embodiment, the overall spectrum may be represented as a frequency-domain signal. The mathematical transformation may be STFT. The STFT transform is related to Fourier transform, and is used to determine a frequency and a phase of a sine wave of a partial region of a time-domain signal, that is, convert a time-domain signal into a frequency-domain signal. After STFT is performed on the to-be-separated audio data, an STFT spectrum diagram is obtained. The STFT spectrum diagram is a graph formed by using the converted overall spectrum according to a voice strength characteristic.
It should be understood that because in this embodiment, the to-be-separated audio data mainly is a dual-channel time-domain signal, the converted overall spectrum should also be a dual-channel frequency-domain signal. For example, the overall spectrum may include a left-channel overall spectrum and a right-channel overall spectrum.
3. Separation Module 30
The separation module 30 is configured to separate the overall spectrum, to obtain a separated singing voice spectrum and a separated accompaniment spectrum, where the singing voice spectrum includes a spectrum corresponding to a singing part of a musical composition, and the accompaniment spectrum includes a spectrum corresponding to an accompaniment part of the musical composition.
In this embodiment, the musical composition mainly includes a song, the singing part of the musical composition mainly is a voice, and the accompaniment part of the musical composition mainly is a sound of an instrument. Specifically, the overall spectrum may be separated by using a preset algorithm. The preset algorithm may be determined according to requirements of an actual application. For example, in this embodiment, the preset algorithm may use a part of algorithm in a related art ADRess method, and may be specifically as follows:
1. It is assumed that an overall spectrum of a current frame includes a left-channel overall spectrum Lf(k) and a right-channel overall spectrum Rf(k), where k is a band index. The separation module 30 separately calculates Azimugram of a right channel and Azimugram of a left channel, and details are as follows:
the Azimugram of the right channel is AZR(k,i)=|Lf(k)−g(i)*Rf(k)|; and
the Azimugram of the left channel is AZL(k,i)=|Rf(k)−g(i)*Lf(k)|.
g(i) is a scale factor, g(i)=i/b, 0≤i≤b, b is an azimuth resolution, i is an index, and Azimugram represents a degree to which a frequency component in a kth band is cancelled under the scale factor g(i).
2. For each band, a scale factor having a highest cancellation degree is selected to adjust Azimugram:
if AZR(k,i)=min(AZR(k)), AZR(k,i)=max(AZR(k))−min(AZR(k));
otherwise, AZR(k,i)=0; and
correspondingly, the separation module 30 may calculate AZL(k, i) by using the same method.
3. For the adjusted Azimugram in step 2, because strengths of a voice on the left and right channels are similar, the voice is in a location in which i is relatively large in the Azimugram, that is, a location in which g(i) approaches 1. If a parameter subspace width H is given, a separated singing voice spectrum on the right channel is estimated as
and a separated accompaniment spectrum on the right channel is estimated as
Correspondingly, the separation module 30 may obtain a separated singing voice spectrum VL(k) and a separated accompaniment spectrum ML(k) on the left channel by using the same method, and details are not described herein again.
4. Adjustment Module 40
The adjustment module 40 is configured to adjust the overall spectrum according to the separated singing voice spectrum and the separated accompaniment spectrum, to obtain an initial singing voice spectrum and an initial accompaniment spectrum.
In this embodiment, to ensure a dual-channel effect of a signal output by using the ADRess method, a mask further is calculated according to a separation result of the overall spectrum, and the overall spectrum is adjusted by using the mask, to obtain a final initial singing voice spectrum and initial accompaniment spectrum that have a better dual-channel effect.
For example, the adjustment module 40 may be specifically configured to:
calculate a singing voice binary mask according to the separated singing voice spectrum and the separated accompaniment spectrum; and
adjust the overall spectrum by using the singing voice binary mask, to obtain the initial singing voice spectrum and the initial accompaniment spectrum.
In this embodiment, the overall spectrum includes a right-channel overall spectrum Rf(k) and a left-channel overall spectrum Lf(k). Because both the separated singing voice spectrum and the separated accompaniment spectrum are dual-channel frequency-domain signals, the singing voice binary mask calculated by the separation module 40 according to the separated singing voice spectrum and the separated accompaniment spectrum correspondingly includes MaskR(k) corresponding to the left channel and MaskL(k) corresponding to the right channel.
For the right channel, a method for calculating a singing voice binary mask MaskR(k) may be: if VR(k)≥MR(k), MaskR(k)=1, or otherwise, MaskR(k)=0. Subsequently. Rf(k) is adjusted, to obtain the adjusted initial singing voice spectrum VR(k)′=Rf(k)*MaskR(k), and the adjusted initial accompaniment spectrum MR(k)′=Rf(k)*(1−MaskR(k)).
Correspondingly, for the left channel, the adjustment module 40 may obtain the corresponding singing voice binary mask MaskL(k), initial singing voice spectrum VL(k)′, and initial accompaniment spectrum ML(k)′ by using the same method, and details are not described herein again.
It should be supplemented that because when a related art ADRess method is used for processing, an output signal is a time-domain signal, a related art ADRess system frame needs to be used. The adjustment module 40 may perform ISTFT on the adjusted overall spectrum after the step of “adjusting the overall spectrum by using the singing voice binary mask”, to output initial singing voice data and initial accompaniment data. That is, a whole process of the existing ADRess method is completed. Subsequently, the adjustment module 40 performs STFT transform on the initial singing voice data and the initial accompaniment data that are obtained after the transform, to obtain the initial singing voice spectrum and the initial accompaniment spectrum.
5. Calculation Module 50
The calculation module 50 is configured to calculate an accompaniment binary mask of the to-be-separated audio data according to the to-be-separated audio data.
For example, the calculation module 50 may specifically include an analysis submodule 51 and a second calculation submodule 52.
The analysis submodule 51 is configured to perform ICA on the to-be-separated audio data, to obtain analyzed singing voice data and analyzed accompaniment data.
In this embodiment, an ICA method is a typical method for studying BSS. In this method, the to-be-separated audio data (which mainly is a dual-channel time-domain signal) may be separated into an independent singing voice signal and an independent accompaniment signal, and a main assumption is that components in a hybrid signal are non-Gaussian signals and independent statistics collection is performed on the components. A calculation formula may be approximately as follows:
U=Was.
where s denotes the to-be-separated audio data, A denotes a hybrid matrix, W denotes an inverse matrix of A, the output signal U includes U1 and U2, U1 denotes the analyzed singing voice data, and U2 denotes the analyzed accompaniment data.
It should be noted that because the signal U output by using the ICA method are two unordered mono time-domain signals, and it is not clarified which signal is U1 and which signal is U2, the analysis submodule 41 may further perform relevance analysis on the output signal U and an original signal (that is, the to-be-separated audio data), use a signal having a high relevance coefficient as U1, and use a signal having a low relevance coefficient as U2.
The second calculation submodule 52 is configured to calculate the accompaniment binary mask according to the analyzed singing voice data and the analyzed accompaniment data.
It is easily understood that because both the analyzed singing voice data and the analyzed accompaniment data that are output by using the ICA method are mono time-domain signals, there is only one accompaniment binary mask calculated by the second calculation submodule 52 according to the analyzed singing voice data and the analyzed accompaniment data, and the accompaniment binary mask may be applied to the left channel and the right channel at the same time.
For example, the second calculation submodule 52 may be specifically configured to:
perform mathematical transformation on the analyzed singing voice data and the analyzed accompaniment data, to obtain a corresponding analyzed singing voice spectrum and analyzed accompaniment spectrum: and
calculate the accompaniment binary mask according to the analyzed singing voice spectrum and the analyzed accompaniment spectrum.
In this embodiment, the mathematical transformation may be STFT transform, and is used to convert a time-domain signal into a frequency-domain signal. It is easily understood that because both the analyzed singing voice data and the analyzed accompaniment data that are output by using the ICA method are mono time-domain signals, there is only one accompaniment binary mask calculated by the second calculation submodule 52, and the accompaniment binary mask may be applied to the left channel and the right channel at the same time.
Further, the second calculation submodule 52 may be specifically configured to:
perform a comparison analysis on the analyzed singing voice spectrum and the analyzed accompaniment spectrum, and obtain a comparison result; and
calculate the accompaniment binary mask according to the comparison result.
In this embodiment, the method for calculating, by the second calculation submodule 52, the accompaniment binary mask is similar to the method for calculating, by the adjustment module 40, the singing voice binary mask. Specifically, assuming that the analyzed singing voice spectrum is VU(k), the analyzed accompaniment spectrum is MU(k), and the accompaniment binary mask is MaskU(k), the method for calculating MaskU(k) may be:
if MU(k)≥VU(k), MaskU(k)=1; if MU(k)<VU(k), MaskU(k)=0.
6. Processing Module 60
The processing module 60 is configured to process the initial singing voice spectrum and the initial accompaniment spectrum by using the accompaniment binary mask, to obtain target accompaniment data and target singing voice data.
For example, the processing module 60 may specifically include a filtration submodule 61, a first calculation submodule 62, and an inverse transformation submodule 63.
The filtration submodule 61 is configured to filter the initial singing voice spectrum by using the accompaniment binary mask, to obtain a target singing voice spectrum and an accompaniment subspectrum.
In this embodiment, because the initial singing voice spectrum is a dual-channel frequency-domain signal, that is, includes an initial singing voice spectrum VR(k)′ corresponding to the right channel and an initial singing voice spectrum VL(k)′ corresponding to the left channel, if the filtration submodule 61 imposes the accompaniment binary mask MaskU(k) to the initial singing voice spectrum, the obtained target singing voice spectrum and the obtained accompaniment subspectrum should also be dual-channel frequency-domain signals.
For example, using the right channel as an example, the filtration submodule 61 may be specifically configured to:
multiply the initial singing voice spectrum by the accompaniment binary mask, to obtain the accompaniment subspectrum; and
subtract the accompaniment subspectrum from the initial singing voice spectrum, to obtain the target singing voice spectrum.
In this embodiment, assuming that an accompaniment subspectrum corresponding to the right channel is MR1(k), and a target singing voice spectrum corresponding to the right channel is VRtarget(k), MR1(k)=VR(k)′*MaskU(k), that is, MR1(k)=Rf(k)*MaskR(k)*MaskU(k), and VRtarget(k)=VR(k)′−MR1(k)=Rf(k)*MaskR(k)*(1−MaskU(k)).
The first calculation submodule 62 is configured to perform calculation by using the accompaniment subspectrum and the initial accompaniment spectrum, to obtain a target accompaniment spectrum.
For example, using the right channel as an example, the first calculation submodule 62 may be specifically configured to:
add the accompaniment subspectrum and the initial accompaniment spectrum, to obtain the target accompaniment spectrum.
In this embodiment, assuming that a target accompaniment spectrum corresponding to the right channel is MRtarget(k), MRtarget(k)=MR(k)′+MR1(k)=Rf(k)*(1−MaskR(k))+Rf(k)*MaskR(k)*MaskU(k).
In addition, it should be emphasized that related calculation performed by the filtration submodule 61 and the first calculation submodule 62 are merely described by using the right channel as an example, and the filtration submodule 61 and the first calculation submodule 62 further need to perform same calculation for the left channel. Details are not described herein again.
The inverse transformation submodule 63 is configured to perform mathematical transformation on the target singing voice spectrum and the target accompaniment spectrum, to obtain the corresponding target accompaniment data and target singing voice data.
In this embodiment, the mathematical transformation may be ISTFT transform, and is used to convert a frequency-domain signal into a time-domain signal. In some embodiments, after obtaining dual-channel target accompaniment data and target singing voice data, the inverse transformation submodule 63 may further process the target accompaniment data and the target singing voice data, for example, may deliver the target accompaniment data and the target singing voice data to a network server bound to the server, and a user may obtain the target accompaniment data and the target singing voice data from the network server by using an application installed in or a web page screen in a terminal device.
During specific implementation, the units may be implemented as independent entities, or may be combined in any form and implemented as a same entity or a plurality of entities. For specific implementation of the units, refer to the method embodiments described above, and details are not described herein again.
As may be learned from the above, in the audio data processing apparatus provided in this embodiment, the first obtaining module 10 obtains the to-be-separated audio data, the second obtaining module 20 obtains the overall spectrum of the to-be-separated audio data, the separation module 30 separates the overall spectrum, to obtain the separated singing voice spectrum and the separated accompaniment spectrum, and the adjustment module 40 adjusts the overall spectrum according to the separated singing voice spectrum and the separated accompaniment spectrum, to obtain the initial singing voice spectrum and the initial accompaniment spectrum. Meanwhile, the calculation module 50 calculates the accompaniment binary mask according to the to-be-separated audio data. Finally, the processing module 60 processes the initial singing voice spectrum and the initial accompaniment spectrum by using the accompaniment binary mask, to obtain the target accompaniment data and the target singing voice data. Because in this solution, after the initial singing voice spectrum and the initial accompaniment spectrum are obtained according to the to-be-separated audio data, the processing module 60 may further adjust the initial singing voice spectrum and the initial accompaniment spectrum according to the accompaniment binary mask, the separation accuracy may be improved greatly compared with a related art solution. Therefore, accompaniment and a singing voice may be separated from a song completely, so that not only the distortion degree may be reduced greatly, but also mass production of accompaniment may be implemented, and the processing efficiency is high.
Correspondingly, this embodiment of this application further provides an audio data processing system, including any audio data processing apparatus provided in the embodiments of this application. For the audio data processing apparatus, refer to Embodiment 3.
The audio data processing apparatus may be specifically integrated into a server, for example, applied to a separation server of WeSing (karaoke software developed by Tencent). For example, details may be as follows:
The server is configured to obtain to-be-separated audio data; obtain an overall spectrum of the to-be-separated audio data: separate the overall spectrum to obtain a separated singing voice spectrum and a separated accompaniment spectrum, where the singing voice spectrum includes a spectrum corresponding to a singing part of a musical composition, and the accompaniment spectrum includes a spectrum corresponding to an accompaniment part of the musical composition; adjust the overall spectrum according to the separated singing voice spectrum and the separated accompaniment spectrum, to obtain an initial singing voice spectrum and an initial accompaniment spectrum; calculate an accompaniment binary mask of the to-be-separated audio data according to the to-be-separated audio data; and process the initial singing voice spectrum and the initial accompaniment spectrum by using the accompaniment binary mask, to obtain target accompaniment data and target singing voice data.
In some embodiments, the audio data processing system may further include another device, for example, a terminal. Details are as follows:
The terminal may be configured to obtain the target accompaniment data and the target singing voice data from the server.
For specific implementation of the devices, refer to the foregoing embodiments, and details are not described herein again.
Because the audio data processing system may include any audio data processing apparatus provided in the embodiments of this application, the audio data processing system may implement beneficial effects that may be implemented by any audio data processing apparatus provided in the embodiments of this application. For the beneficial effects, refer to the foregoing embodiments, and details are not described herein again.
This embodiment of this application further provides a server. The server may be integrated into any audio data processing apparatus provided in the embodiments of this application. As shown in
The server may include a processor 71 having one or more processing cores, a memory 72 having one or more computer readable storage mediums, a radio frequency (RF) circuit 73, a power supply 74, an input unit 75, a display unit 76, and the like. A person skilled in the art may understand that the structure of the server shown in
The processor 71 is a control center of the server, is connected to various parts of the server by using various interfaces and lines, and performs various functions of the server and processes data by running or executing a software program and/or module stored in the memory 72, and invoking data stored in the memory 72, to perform overall monitoring on the server. In some embodiments, the processor 71 may include one or more processing cores. The processor 71 may integrate an application processor and a modem processor. The application processor mainly processes an operating system, a user interface, an application program, and the like. The modem processor mainly processes wireless communication. It may be understood that the foregoing modem processor may also not be integrated into the processor 71.
The memory 72 may be configured to store a software program and module. The processor 71 runs the software program and module stored in the memory 72, to implement various functional applications and data processing. The memory 72 mainly may include a program storage region and a data storage region. The program storage region may store an operating system, an application required by at least one function (for example, a voice playback function, or an image playback function), and the like, and the data storage region may store data created according to use of the server, and the like. In addition, the memory 72 may include a high speed random access memory (RAM), and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory, or another volatile solid-state storage device. Correspondingly, the memory 72 may further include a memory controller, so that the processor 71 accesses the memory 72.
The RF circuit 73 may be configured to receive and send signals in an information receiving and transmitting process. Especially, after receiving downlink information of a base station, the RF circuit 73 delivers the downlink information to the one or more processors 71 for processing, and in addition, sends related uplink data to the base station. Generally, the RF circuit 73 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM) card, a transceiver, a coupler, a low noise amplifier (LNA), and a duplexer. In addition, the RF circuit 73 may also communicate with a network and another device by means of wireless communication. The wireless communication may use any communication standard or protocol, which includes, but is not limited to, Global System for Mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail. Short Messaging Service (SMS), and the like.
The server further includes the power supply 74 (such as a battery) for supplying power to the components. The power supply 74 may be logically connected to the processor 71 by using a power management system, thereby implementing functions such as charging, discharging, and power consumption management by using the power management system. The power supply 74 may further include one or more of a direct current or alternating current power supply, a re-charging system, a power failure detection circuit, a power supply converter or inverter, a power supply state indicator, and any other components.
The server may further include the input unit 75. The input unit 75 may be configured to receive input digit or character information, and generate a keyboard, mouse, joystick, optical, or track ball signal input related to user settings and functional control. Specifically, in a specific embodiment, the input unit 75 may include a touch-sensitive surface and another input device. The touch-sensitive surface, which may also be referred to as a touch screen or a touch panel, may collect a touch operation of a user on or near the touch-sensitive surface (such as an operation of a user on or near the touch-sensitive surface by using any suitable object or accessory such as a finger or a stylus), and drive a corresponding connection apparatus according to a preset program. In some embodiments, the touch-sensitive surface may include a touch detection apparatus and a touch controller. The touch detection apparatus detects a touch position of the user, detects a signal generated by the touch operation, and transfers the signal to the touch controller. The touch controller receives the touch information from the touch detection apparatus, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 71. Moreover, the touch controller may receive and execute a command sent from the processor 71. In addition, the touch-sensitive surface may be a resistive, capacitive, infrared, or surface sound wave type touch-sensitive surface. In addition to the touch-sensitive surface, the input unit 75 may further include another input device. Specifically, the another input device may include, but is not limited to, one or more of a physical keyboard, a functional key (such as a volume control key or a switch key), a track ball, a mouse, and a joystick.
The server may further include a display unit 76. The display unit 76 may be configured to display information input by the user or information provided for the user, and various graphical interfaces of the server. The graphical interfaces may be formed by a graphic, a text, an icon, a video, and any combination thereof. The display unit 76 may include a display panel, and in some embodiments, the display panel may be configured in a form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. Further, the touch-sensitive surface may cover the display panel. After detecting a touch operation on or near the touch-sensitive surface, the touch-sensitive surface transfers the touch operation to the processor 71, so as to determine a type of the touch event. Then, the processor 71 provides a corresponding visual output on the display panel according to the type of the touch event. Although in
Although not shown in the figure, the server may further include a camera, a Bluetooth module, and the like, and details are not described herein. Specifically, in this embodiment, the processor 71 in the server loads executable files corresponding to processes of the one or more applications to the memory 72 according to the following instructions, and the processor 71 runs the application in the memory 72, to implement various functions. Details are as follows:
obtaining to-be-separated audio data;
obtaining an overall spectrum of the to-be-separated audio data;
separating the overall spectrum, to obtain a separated singing voice spectrum and a separated accompaniment spectrum, where the singing voice spectrum includes a spectrum corresponding to a singing part of a musical composition, and the accompaniment spectrum includes a spectrum corresponding to an accompaniment part of the musical composition;
adjusting the overall spectrum according to the separated singing voice spectrum and the separated accompaniment spectrum, to obtain an initial singing voice spectrum and an initial accompaniment spectrum;
calculating an accompaniment binary mask according to the to-be-separated audio data; and
processing the initial singing voice spectrum and the initial accompaniment spectrum by using the accompaniment binary mask, to obtain target accompaniment data and target singing voice data.
For an implementation method of the foregoing operations, refer to the foregoing embodiments specifically, and details are not described herein again.
As may be learned from the above, the server provided in this embodiment may obtain the to-be-separated audio data, obtain the overall spectrum of the to-be-separated audio data, separate the overall spectrum to obtain the separated singing voice spectrum and the separated accompaniment spectrum, and adjust the overall spectrum according to the separated singing voice spectrum and the separated accompaniment spectrum, to obtain the initial singing voice spectrum and the initial accompaniment spectrum. Meanwhile, the server calculates the accompaniment binary mask according to the to-be-separated audio data, and finally, processes the initial singing voice spectrum and the initial accompaniment spectrum by using the accompaniment binary mask, to obtain the target accompaniment data and the target singing voice data, so that accompaniment and a singing voice may be separated from a song completely, greatly improving the separation accuracy, reducing the distortion degree, and improving the processing efficiency.
A person of ordinary skill in the art may understand that all or some of the steps of the methods in the embodiments may be implemented by a program instructing relevant hardware. The program may be stored in a computer readable storage medium. The storage medium may include a read-only memory (ROM), a RAM, a magnetic disk, and an optical disc.
In addition, this embodiment of this application further provides a computer readable storage medium. The computer readable storage medium stores a computer readable instruction, so that the at least one processor performs the method in any one of the foregoing embodiments, for example:
obtaining to-be-separated audio data;
obtaining an overall spectrum of the to-be-separated audio data;
separating the overall spectrum, to obtain a singing voice spectrum and an accompaniment spectrum;
calculating an accompaniment binary mask of the to-be-separated audio data according to the to-be-separated audio data; and
processing the singing voice spectrum and the accompaniment spectrum by using the accompaniment binary mask, to obtain accompaniment data and singing voice data.
The audio data processing method, apparatus, and system that are provided in the embodiments of this application are described in detail above. The principle and implementation of this application are described herein by using specific examples. The description about the embodiments is merely provided to help understand the method and core ideas of this application. In addition, a person skilled in the art may make variations and modifications in terms of the specific implementations and application scopes according to the ideas of this application. Therefore, the content of this specification shall not be construed as a limitation to this application or to the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
201610518086.6 | Jul 2016 | CN | national |
This application is a National Stage entry of International Patent Application No. PCT/CN2017/086949, filed Jun. 2, 2017, which claims priority from Chinese Patent Application No. 201610518086.6, entitled “AUDIO DATA PROCESSING METHOD AND APPARATUS” filed with the Chinese Patent Office on Jul. 1, 2016, the entire contents of which are incorporated by reference herein in their entirety.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2017/086949 | 6/2/2017 | WO | 00 |