Speech synthesis method, device, readable medium and electronic device based on songbook
By obtaining the text and music score in the target libretto, extracting phonemes and pitch sequences, and using the duration prediction model and speech synthesis model to synthesize audio that conforms to the target music score, the problem of difficulty in synthesizing drama audio in the existing technology is solved, and the quality of the audio is improved. Expression and authenticity.
Patent Information
- Application Number
- CN202110032064.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-11
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-01-11
AI Technical Summary
Existing speech synthesis technology is difficult to synthesize distinctive audio, such as drama audio, and cannot effectively match the duration differences of phonemes in drama audio, resulting in insufficient expressiveness of synthesized audio.
By obtaining the text and music score in the target libretto, the phoneme sequence and pitch sequence are extracted, and the pre-trained duration prediction model is used to predict the duration sequence of phonemes, and the speech synthesis model is combined with the speech synthesis model to synthesize audio that matches the target music score to ensure that the audio matches the duration sequence.
It improves the expressiveness of audio and can meet users' needs for diversified audio, especially the synthesis of drama audio, which enhances the expressiveness and authenticity of speech synthesis.
Smart Images

Figure CN112786013B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of electronic information processing, and in particular, to a speech synthesis method, device, readable medium and electronic device based on a songbook. Background Art
[0002] With the continuous development of electronic information processing technology, voice, as an important carrier for people to obtain information, has been widely used in daily life and work. Application scenarios involving voice usually include speech synthesis processing, which refers to synthesizing user-specified text into audio. However, audio synthesized only based on text is often bland and weak in expression, and cannot meet users' needs for diversified audio. If the user needs to synthesize audio with certain characteristics, and the audio of daily speech does not have this characteristic, then the existing speech synthesis processing method cannot synthesize audio that meets this characteristic. For example, in drama audio, since the duration of each phoneme in drama audio varies greatly, the shortest duration may be tens of milliseconds, and the longest duration may reach ten seconds, which is very different from the situation in which each phoneme in daily speech audio occupies about one hundred milliseconds, so it is difficult to synthesize drama audio. Summary of the invention
[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, the present disclosure provides a method for speech synthesis based on a songbook, the method comprising:
[0005] Acquire a target text included in a target libretto and a target music score corresponding to the target text;
[0006] Extracting a phoneme sequence corresponding to the target text and a pitch sequence corresponding to the target music score, wherein the pitch sequence includes: a pitch corresponding to each phoneme in the phoneme sequence;
[0007] According to the phoneme sequence, predicting a duration sequence by a pre-trained duration prediction model, the duration sequence comprising: a duration corresponding to each phoneme in the phoneme sequence;
[0008] According to the phoneme sequence, the pitch sequence and the duration sequence, a target audio corresponding to the target text and conforming to the target music score is synthesized through a pre-trained speech synthesis model, and the target audio matches the duration sequence.
[0009] In a second aspect, the present disclosure provides a speech synthesis device based on a songbook, the device comprising:
[0010] An acquisition module, used for acquiring a target text included in a target libretto and a target music score corresponding to the target text;
[0011] An extraction module, used to extract a phoneme sequence corresponding to the target text and a pitch sequence corresponding to the target music score, wherein the pitch sequence includes: a pitch corresponding to each phoneme in the phoneme sequence;
[0012] A prediction module, configured to predict a duration sequence according to the phoneme sequence by using a pre-trained duration prediction model, wherein the duration sequence includes: a duration corresponding to each phoneme in the phoneme sequence;
[0013] A synthesis module is used to synthesize a target audio that conforms to the target music score and corresponds to the target text according to the phoneme sequence, the pitch sequence and the duration sequence through a pre-trained speech synthesis model, and the target audio matches the duration sequence.
[0014] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect of the present disclosure.
[0015] In a fourth aspect, the present disclosure provides an electronic device, including:
[0016] a storage device having a computer program stored thereon;
[0017] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect of the present disclosure.
[0018] Through the above technical solution, the present disclosure first obtains the target text included in the target songbook and the target music score corresponding to the target text, then extracts the phoneme sequence corresponding to the target text, and the pitch sequence composed of the pitch corresponding to each phoneme in the phoneme sequence, and then uses the pre-trained duration prediction model to predict the duration sequence corresponding to the phoneme sequence, which includes the duration corresponding to each phoneme, and finally synthesizes the target audio that conforms to the target music score and matches the duration sequence according to the phoneme sequence, pitch sequence and duration sequence and the pre-trained speech synthesis model. The present disclosure can extract the corresponding phoneme sequence and pitch sequence according to the text and music score included in the songbook, and predict the corresponding duration sequence, so as to synthesize the audio that conforms to the songbook according to the phoneme sequence, pitch sequence and duration sequence, and can improve the expressiveness of the audio.
[0019] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:
[0021] Figure 1 is a flow chart of a speech synthesis method based on a songbook according to an exemplary embodiment;
[0022] Figure 2 is a processing flow chart of a duration prediction model according to an exemplary embodiment;
[0023] Figure 3 is a processing flow chart of a speech synthesis model according to an exemplary embodiment;
[0024] Figure 4 is a block diagram of a speech synthesis model according to an exemplary embodiment;
[0025] Figure 5 is a flowchart showing a joint training of a speech synthesis model and a duration prediction model according to an exemplary embodiment;
[0026] Figure 6 is a flowchart showing another method of jointly training a speech synthesis model and a duration prediction model according to an exemplary embodiment;
[0027] Figure 7 is a flowchart showing another method of jointly training a speech synthesis model and a duration prediction model according to an exemplary embodiment;
[0028] Figure 8 is a block diagram of another speech synthesis model according to an exemplary embodiment;
[0029] Fig. 9 is a flowchart showing another method of jointly training a speech synthesis model and a duration prediction model according to an exemplary embodiment;
[0030] Fig.10 is a block diagram of a speech synthesis device based on a songbook according to an exemplary embodiment;
[0031] Fig.11 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0032] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0033] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0034] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0035] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0036] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0037] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0038] Figure 1 is a flow chart of a method for speech synthesis based on a songbook according to an exemplary embodiment. Figure 1 As shown, the method may include the following steps:
[0039] Step 101, obtaining a target text included in a target libretto and a target music score corresponding to the target text.
[0040] For example, first, the target songbook to be synthesized can be obtained. The target songbook can be understood as a file that records a song or opera, which includes text and corresponding music scores. The text can be understood as lyrics, lyrics, or lyrics, etc. The music score can be understood as the music symbol corresponding to the text, which can indicate the pitch of each phoneme (or word, phrase) in the text. After that, the target text and the target music score corresponding to the target text can be determined from the target songbook. The target text can be a line of lyrics (or lyrics, lyrics), a section of lyrics (or lyrics, lyrics), or all the lyrics (or lyrics, lyrics) included in the target songbook. The target music score is the music score that can indicate the pitch of each phoneme in the target text.
[0041] Step 102: extracting a phoneme sequence corresponding to the target text and a pitch sequence corresponding to the target music score, wherein the pitch sequence includes: a pitch corresponding to each phoneme in the phoneme sequence.
[0042] For example, for the target text, the target text can be input into a pre-trained recognition model to obtain the phoneme sequence corresponding to the target text output by the recognition model. The phonemes corresponding to each word in the target text can also be searched in a pre-established dictionary, and then the phonemes corresponding to each word are combined into a phoneme sequence corresponding to the target text. Among them, phonemes can be understood as phonetic units divided according to the pronunciation of each word, and can also be understood as vowels and consonants in the pinyin corresponding to each word. The phoneme sequence includes the phonemes corresponding to each word in the target text (one word can correspond to one or more phonemes). Take the target libretto as an example of a text recording a Peking Opera, and the target text is "A Mother Worries When Her Son Travels a Thousand Miles Away". The phonemes corresponding to each word can be searched in the dictionary in turn, so as to determine that the phoneme sequence is "erxingqianlimudanyou", which includes 20 phonemes. After obtaining the phoneme sequence, the target music score can be divided according to each phoneme in the phoneme sequence to obtain a pitch sequence including the pitch (English: Pitch) corresponding to each phoneme. Taking the phoneme sequence "erxingqianlimudanyou" as an example, the pitch sequence includes the pitches corresponding to 20 phonemes: "26621235552376506126" (here the pitch is expressed in simplified musical notation).
[0043] Step 103 , predicting a duration sequence according to the phoneme sequence by using a pre-trained duration prediction model, where the duration sequence includes: a duration corresponding to each phoneme in the phoneme sequence.
[0044] For example, since the duration of each phoneme in the song or opera recorded in the libretto is very different, the duration span may range from tens of milliseconds to ten seconds. Therefore, in order to make the synthesized target audio conform to the target libretto, it is necessary to first predict the duration sequence, which includes the duration corresponding to each phoneme in the phoneme sequence (the duration can also be understood as the beat in the song or opera). The phoneme sequence can be used as the input of a pre-trained duration prediction model to obtain the duration sequence output by the duration prediction model. The duration prediction model can be pre-trained based on a large number of training samples, and can predict the duration corresponding to each phoneme in the phoneme sequence based on the phoneme sequence. The structure of the duration prediction model can be a neural network such as RNN (English: Recurrent Neural Network, Chinese: Recurrent Neural Network), CNN (English: Convolutional Neural Networks, Chinese: Convolutional Neural Network), LSTM (English: Long Short-Term Memory, Chinese: Long Short-Term Memory Network), etc., and the present disclosure does not make specific limitations on this. Taking the phoneme sequence "erxingqianlimudanyou" as an example, the duration sequence includes the durations corresponding to 20 phonemes, for example: "35 37 45 50 52 30 55 101 234 176 301 423 287 36087 191 322 291 432 511" (the unit of duration here is ms).
[0045] Step 104, synthesize a target audio that conforms to the target music score and corresponds to the target text through a pre-trained speech synthesis model according to the phoneme sequence, the pitch sequence and the duration sequence, and the target audio matches the duration sequence.
[0046] For example, a speech synthesis model can be pre-trained, and the speech synthesis model can be understood as a TTS (English: Text To Speech, Chinese: From text to speech) model, which can generate a target audio corresponding to the target text and matching the target music score according to the phoneme sequence, pitch sequence and duration sequence corresponding to the target text. The phoneme sequence, pitch sequence and duration sequence are used as the input of the speech synthesis model, and the output of the speech synthesis model is the target audio. Specifically, the speech synthesis model can be obtained by training based on the Tacotron model, Deepvoice 3 model, Tacotron 2 model, Wavenet model, etc., and the present disclosure does not make specific restrictions on this. In this way, in the process of speech synthesis of the target songbook, the target text and the corresponding target music score included in the target songbook are considered, so as to determine the phoneme sequence that can reflect the semantics, and the pitch sequence and duration sequence that can reflect the sound characteristics, so that the synthesized target audio conforms to the target songbook, enriching the types of audio that can be synthesized by speech synthesis, meeting the diverse needs of users, and improving the expressiveness of the audio.
[0047] In summary, the present disclosure first obtains the target text included in the target songbook and the target music score corresponding to the target text, then extracts the phoneme sequence corresponding to the target text, and the pitch sequence composed of the pitch corresponding to each phoneme in the phoneme sequence, and then uses a pre-trained duration prediction model to predict the duration sequence corresponding to the phoneme sequence, which includes the duration corresponding to each phoneme, and finally, based on the phoneme sequence, pitch sequence and duration sequence, uses a pre-trained speech synthesis model to synthesize the target audio that conforms to the target music score and matches the duration sequence. The present disclosure can extract the corresponding phoneme sequence and pitch sequence according to the text and music score included in the songbook, and predict the corresponding duration sequence, so as to synthesize audio that conforms to the songbook according to the phoneme sequence, pitch sequence and duration sequence, and can improve the expressiveness of the audio.
[0048] Figure 2 is a processing flow chart of a duration prediction model according to an exemplary embodiment. Figure 2 As shown, the duration prediction model can be used to perform the following steps:
[0049] Step A) predicting the duration probability distribution corresponding to the phoneme sequence.
[0050] Step B) random sampling is performed according to the duration probability distribution to determine the duration corresponding to each phoneme in the phoneme sequence.
[0051] For example, to predict the duration sequence corresponding to a phoneme sequence, the duration probability distribution can be predicted based on the phoneme sequence, and then the duration probability distribution is randomly sampled according to the number of phonemes included in the phoneme sequence, and the sampling result is used as the duration corresponding to each phoneme. For example, the structure of the duration prediction model can be a combination of BLSTM (English: Bidirectional Long Short-Term Memory, Chinese: Bidirectional Long Short-Term Memory Network) + MDN (English: Mixture Density Network, Chinese: Mixture Density Network). The phoneme sequence can be first input into BLSTM to obtain a set of vectors output by BLSTM that can represent the phoneme sequence, and then the set of vectors is input into MDN to obtain multiple groups of mean-variance pairs output by MDN, wherein each group of mean-variance pairs represents a Gaussian distribution, and multiple Gaussian distributions represented by multiple groups of mean-variance pairs are combined to obtain a mixed Gaussian distribution, and the mixed Gaussian distribution is used as the duration probability distribution, and the duration probability distribution can represent the probability distribution of the duration corresponding to each phoneme in the phoneme sequence. Finally, the number of phonemes included in the phoneme sequence can be determined first, and the number of phonemes can be randomly sampled according to the duration probability distribution to obtain the duration corresponding to each phoneme in the phoneme sequence. Furthermore, in the process of random sampling according to the duration probability distribution, the duration probability distribution can also be truncated according to [μ-3σ,μ+3σ] (where μ is the mean of the duration probability distribution and σ is the standard deviation of the duration probability distribution) to further improve the accuracy of predicting the duration sequence.
[0052] Figure 3 is a processing flow chart of a speech synthesis model according to an exemplary embodiment. Figure 3 As shown, the speech synthesis model can be used to perform the following steps:
[0053] Step C) determining a text feature sequence corresponding to the target text according to the phoneme sequence, wherein the text feature sequence includes a text feature corresponding to each phoneme in the phoneme sequence.
[0054] Step D) generates target audio according to the text feature sequence, pitch sequence and duration sequence.
[0055] For example, the specific process of synthesizing the target audio by the speech synthesis model can be to first extract the text feature sequence (i.e., Text Embedding) corresponding to the target text based on the phoneme sequence. The text feature sequence includes the text feature corresponding to each phoneme in the phoneme sequence. The text feature can be understood as a text vector that can characterize the phoneme. For example, the phoneme sequence includes 100 phonemes, and the text vector corresponding to each phoneme is a 1*80-dimensional vector, so the text feature sequence can be a 100*80-dimensional vector.
[0056] After obtaining the text feature sequence, the text feature sequence can be combined with the pitch sequence and the duration sequence to generate the target audio that conforms to the target libretto. For example, the text feature sequence can be spliced with the pitch sequence and the duration sequence to obtain a combined sequence, and then the target audio is generated based on the combined sequence. For example, the phoneme sequence includes 100 phonemes, the text feature sequence can be a 100*80-dimensional vector, the corresponding pitch sequence is a 100*1-dimensional vector, and the duration sequence is a 100*1-dimensional vector, then the combined sequence can be a 100*82-dimensional vector. The target audio can be generated based on this 100*82-dimensional vector.
[0057] by Figure 4 Taking the speech synthesis model shown in the figure as an example, the speech synthesis model is a Tacotron model, which includes: an encoder (i.e., Encoder), an attention network (i.e., Attention), a decoder (i.e., Decoder) and a post-processing network (i.e., Post-processing). The encoder may include an embedding layer (i.e., Character Embedding layer), a pre-processing network (Pre-net) sub-model and a CBHG (English: Convolution Bank + Highway network + bidirectional Gated Recurrent Unit, Chinese: Convolution layer + high-speed network + bidirectional recurrent neural network) sub-model. The phoneme sequence can be input into the encoder. First, the phoneme sequence is converted into a word vector through the embedding layer, and then the word vector is input into the Pre-net sub-model to perform a nonlinear transformation on the word vector, thereby improving the convergence and generalization ability of the speech synthesis model. Finally, the text feature sequence that can represent the target text is obtained through the CBHG sub-model according to the word vector after nonlinear transformation.
[0058] Afterwards, the pitch sequence, duration sequence, and text feature sequence output by the encoder can be concatenated to obtain a combined sequence, and then the combined sequence is input into the attention network, and the attention network can add an attention weight to each element in the combined sequence. Specifically, the attention network can be a location sensitive attention (English: Location Sensitive Attention) network, or a GMM (English: Gaussian Mixture Model, abbreviated GMM) attention network, or a Multi-Head Attention network, which is not specifically limited in the present disclosure.
[0059] The output of the attention network is then used as the input of the decoder. The decoder may include a preprocessing network submodel (which may be the same as the preprocessing network submodel included in the encoder), Attention-RNN, and Decoder-RNN. The preprocessing network submodel is used to perform nonlinear transformation on the input. The structure of Attention-RNN is a one-layer unidirectional, zoneout-based LSTM (English: Long Short-Term Memory, Chinese: Long Short-Term Memory Network), which can take the output of the preprocessing network submodel as input and output it to the Decoder-RNN after passing through the LSTM unit. The Decode-RNN is a two-layer unidirectional, zoneout-based LSTM, which outputs Mel spectrum information through the LSTM unit, and the Mel spectrum information may include one or more Mel spectrum features. Finally, the Mel spectrum information is input into the post-processing network, which may include a vocoder (for example, Wavenet vocoder, Griffin-Lim vocoder, etc.) for converting the Mel spectrum feature information to obtain the target audio.
[0060] Figure 5 is a flowchart showing a joint training of a speech synthesis model and a duration prediction model according to an exemplary embodiment. Figure 5 As shown in Figure 1, the speech synthesis model and duration prediction model are jointly trained in the following way:
[0061] Step 201, obtaining the training text, the annotation data corresponding to the training text, the total duration and the training music score included in the training songbook.
[0062] Step 202, determining a training phoneme sequence and a training duration sequence corresponding to the training text according to the annotation data, and determining a training pitch sequence according to the training music score, wherein the training pitch sequence includes: the pitch corresponding to each training phoneme in the training phoneme sequence, and the training duration sequence includes: the duration corresponding to each training phoneme.
[0063] Step 203: input the training phoneme sequence into the duration prediction model, and train the duration prediction model according to the output of the duration prediction model and the total duration.
[0064] Step 204, input the training phoneme sequence, the training pitch sequence and the training duration sequence into the speech synthesis model, and train the speech synthesis model according to the output of the speech synthesis model and the training audio corresponding to the training text.
[0065] For example, since the process of synthesizing the target speech uses both the duration prediction model and the speech synthesis model, the duration prediction model and the speech synthesis model can be jointly trained in the training stage to improve the accuracy of the duration prediction model and the speech synthesis model. The joint training method may include: first obtaining the training text, the annotation data corresponding to the training text, the total duration and the training score included in the training songbook, and also obtaining the training audio corresponding to the training text. There may be multiple training texts, and correspondingly, there may be multiple training audios. Among them, the training text may be a sentence, a paragraph or all of the lyrics (or lyrics, drama lyrics) in the training songbook, the corresponding training audio may be the audio of the singer singing the training text, and the corresponding total duration may be understood as the total duration of the training audio. The training score corresponding to the training text may be a score that can indicate the pitch of the training text. The annotation data corresponding to the training text may be understood as each training phoneme in the pre-annotated training text and the duration corresponding to each training phoneme. In this way, the training phoneme sequence and the training duration sequence corresponding to the training text may be determined according to the annotation data, and the training pitch sequence may be determined according to the training score.
[0066] Afterwards, the training phoneme sequence can be used as the input of the duration prediction model, and the duration prediction model can be trained based on the output of the duration prediction model and the total duration. For example, the difference (or mean square error) between the output of the duration prediction model and the total duration can be used as the loss function of the duration prediction model. With the goal of reducing the loss function, the back propagation algorithm can be used to correct the parameters of the neurons in the duration prediction model. The parameters of the neurons can be, for example, the weights (English: Weight) and biases (English: Bias) of the neurons. Repeat the above steps until the loss function meets the preset conditions, such as the loss function is less than the preset loss threshold.
[0067] Finally, the training phoneme sequence, the training pitch sequence, and the training duration sequence are used as the input of the speech synthesis model, and the speech synthesis model is trained according to the output of the speech synthesis model and the training audio. For example, the difference (or mean square error) between the output of the speech synthesis model and the training audio can be used as the loss function of the speech synthesis model, and the back propagation algorithm can be used to correct the parameters of the neurons in the speech synthesis model with the goal of reducing the loss function. Repeat the above steps until the loss function meets the preset conditions, such as the loss function is less than the preset loss threshold.
[0068] Figure 6 is a flowchart of another method for jointly training a speech synthesis model and a duration prediction model according to an exemplary embodiment. Figure 6 As shown, the implementation of step 203 may include:
[0069] Step 2031, according to the initial duration probability distribution corresponding to the training phoneme sequence and the initial duration corresponding to each training phoneme output by the duration prediction model, determine the maximum likelihood loss corresponding to the training phoneme sequence.
[0070] Step 2032, determine the prediction loss by Lagrangian operator method according to the maximum likelihood loss corresponding to the training phoneme sequence, the total training time and the total time, and the total training time is determined according to the initial time corresponding to each training phoneme.
[0071] Step 2033, with the goal of reducing prediction loss, the duration prediction model is updated using a back propagation algorithm.
[0072] For example, since songs or operas are usually performed by singers, there may be differences in personal performance styles and processing methods, resulting in different durations of each phoneme when different singers perform the same libretto. However, usually, the total duration of a line of lyrics is fixed (it can also be understood as the number of beats occupied by a line of lyrics is fixed). Therefore, the total duration can be used as a restriction to train the duration prediction model. Taking the duration prediction model as BLSTM+MDN as an example, the initial duration probability distribution corresponding to the training phoneme sequence output by the duration prediction model can be randomly sampled to obtain the initial duration corresponding to each training phoneme (it can be understood as the duration prediction model's prediction of the duration of the training phoneme). Afterwards, the maximum likelihood loss corresponding to the training phoneme sequence is determined based on the initial duration probability distribution and the initial duration corresponding to each training phoneme. The initial duration probability distribution can be obtained by a combination of K Gaussian distributions, and accordingly, the maximum likelihood loss can be determined by formula 1:
[0073]
[0074] Among them, L(d i ,λ) represents the maximum likelihood loss of the i-th training phoneme, k represents the k-th of K Gaussian distributions, represents the weight of the k-th Gaussian distribution corresponding to the ith training phoneme, represents the mean of the k-th Gaussian distribution corresponding to the i-th training phoneme, represents the standard deviation of the kth Gaussian distribution corresponding to the ith training phoneme, N represents the Gaussian distribution function, and d i represents the initial duration corresponding to the i-th training phoneme, and λ represents and combination.
[0075] After determining the maximum likelihood loss, the prediction loss can be determined using the Lagrangian operator method based on the maximum likelihood loss, total training time, and total time corresponding to the training phoneme sequence, where the total training time is determined based on the initial time corresponding to each training phoneme. The prediction loss can be determined using Formula 2:
[0076]
[0077] Among them, L pre represents the prediction loss of the training phoneme sequence including M training phonemes, α represents the Lagrange multiplier, Represents the total training time, and T represents the total time. Accordingly, with the goal of reducing the prediction loss, let L pre =0, that is to say, the total training time is restricted to be the same as the total time, and the minimum value of the maximum likelihood loss is obtained. Finally, the back propagation algorithm is used to update the time prediction model.
[0078] Figure 7 is a flowchart of another method for jointly training a speech synthesis model and a duration prediction model according to an exemplary embodiment. Figure 7 As shown, the implementation of step 204 may be:
[0079] Step 2041, determining the synthesis loss based on the initial audio and training audio output by the speech synthesis model.
[0080] Step 2042, determine the comprehensive loss based on the synthetic loss and the predicted loss.
[0081] Step 2043, with the goal of reducing the comprehensive loss, the speech synthesis model is updated using the back propagation algorithm.
[0082] In the process of training the speech synthesis model, the synthesis loss can be determined based on the initial audio and training audio output by the speech synthesis model. For example, the difference (or mean square error) between the initial audio and the training audio can be used as the synthesis loss, which can be understood as the loss generated by the speech synthesis model in the process of speech synthesis. The synthesis loss and the prediction loss of the duration prediction model can be combined as the comprehensive loss of the speech synthesis model, and the back propagation algorithm can be used to update the speech synthesis model with the goal of reducing the comprehensive loss, so as to achieve the effect of jointly training the speech synthesis model and the duration prediction model. Specifically, the comprehensive loss can be the sum of the synthesis loss and the prediction loss, or the result of weighted summation of the synthesis loss and the prediction loss.
[0083] In order to further improve the accuracy of the speech synthesis model, during the training of the speech synthesis model, Figure 4 Based on the speech synthesis model shown in FIG, a set of discriminators D (English: Discriminator) is added, such as Figure 8 shown.
[0084] Fig. 9 is a flowchart of another method for jointly training a speech synthesis model and a duration prediction model according to an exemplary embodiment. Fig. 9 As shown, the implementation of step 204 may also include:
[0085] Step 2044: extract a first number of initial audio segments from the initial audio according to a preset rule, and extract a training audio segment corresponding to each initial audio segment from the training audio, wherein each initial audio segment includes a different number of continuous audio frames in the initial audio.
[0086] For example, in the process of training a speech synthesis model, the initial audio output by the speech synthesis model can be extracted according to a preset rule to obtain a first number of initial audio segments. Correspondingly, a training audio segment corresponding to each initial audio segment is extracted in the corresponding training audio, and the timing of the initial audio segment in the initial audio is the same as the timing of the training audio segment in the training audio. In addition, each initial audio segment includes a different number of continuous audio frames in the initial audio, that is, the duration of each initial audio segment is different. The preset rule can be to randomly sample a specified number of continuous frames in the initial audio. For example, the first number is 5, and the 5 initial audio segments are, in the initial audio, 5 frames, 10 frames, 15 frames, 20 frames, and 25 frames are randomly extracted. The 5 initial audio segments can also be, in the initial audio, audio frames within 2s, audio frames within 4s, audio frames within 6, audio frames within 8, and audio frames within 10 are randomly extracted.
[0087] Furthermore, the preset rules can also filter the initial audio first, and then randomly sample the filtered audio. Because songs or operas may include a lot of details in the high-frequency or low-frequency range, such as Peking opera, which usually has strong and complex transpositions and vibratos in the high-frequency range. If the audio corresponding to the songbook is synthesized according to the standard of daily speaking, details in the high-frequency or low-frequency range are often lost. Therefore, the intermediate audio that meets the specified frequency range in the initial audio can be first filtered out. The specified frequency range can be, for example, a frequency greater than a first preset threshold (for example, 24kHz), or a frequency less than a second preset threshold (750Hz). Then randomly sample a specified number of continuous frames in the intermediate audio. For example, the first number is 3, first filter out the intermediate audio higher than 24kHz in the initial audio, and then randomly extract 5 frames, 10 frames, and 15 frames in the intermediate audio as the initial audio segment.
[0088] Step 2045, input each initial audio segment into the corresponding discriminator to obtain an initial discrimination result output by the discriminator, and input the training audio segment corresponding to the initial audio segment into the discriminator to obtain a training discrimination result output by the discriminator.
[0089] For example, a discriminator may be set for each initial audio segment, and then each initial audio segment is input into the corresponding discriminator (i.e., a first number of discriminators are set) to obtain an initial discrimination result output by each discriminator. A training audio segment corresponding to the initial audio segment may also be input into the discriminator corresponding to the initial audio segment to obtain a training discrimination result output by the discriminator.
[0090] Accordingly, step 2041 can be implemented in the following manner:
[0091] Step 1) Determine a first loss based on the initial audio and the training audio.
[0092] Step 2) Determine a second loss based on the initial discrimination result and the training discrimination result corresponding to each initial audio segment, and the second loss is used to train the discriminator.
[0093] Step 3) Determine a composite loss based on the first loss and the second loss.
[0094] For example, based on the addition of a first number of discriminators, the synthesis loss can be divided into a first loss determined according to the initial audio and the training audio, and a second loss determined according to the initial discrimination result and the training discrimination result corresponding to each initial audio segment. Among them, the first loss can be understood as the loss generated by the speech synthesis model in the process of speech synthesis, for example, it can be the difference (or mean square error) between the initial audio and the training audio, and the second loss can be understood as the loss of the GAN (English: Generative Adversarial Networks, Chinese: Generative Adversarial Network) composed of the speech synthesis model as a generator G (English: Generator) and the discriminator D, which can be used to train both the discriminator and the speech synthesis model.
[0095] Specifically, the second loss type may include a first number of discrimination losses (for example, it may be the sum of the first number of discrimination losses), and the discrimination loss is determined according to the initial discrimination result and the training discrimination result corresponding to each initial audio segment. For example, the discrimination loss may be determined by Formula 3:
[0096]
[0097] Where x represents the combination of training phoneme sequence, training pitch sequence and training duration sequence, G(x) represents any initial audio segment, and D f(G(x)) represents the initial discrimination result, y represents the training audio segment corresponding to the initial audio segment, D f (y) represents the training discrimination result, G represents the generator (i.e., the speech synthesis model), and D represents the discriminator corresponding to the initial audio segment.
[0098] Finally, the synthesis loss is determined according to the first loss and the second loss. The sum of the first loss and the second loss can be used as the synthesis loss, or the result of the weighted sum of the first loss and the second loss can be used as the synthesis loss. In other words, the synthesis loss includes the loss of the speech synthesis model and the loss of GAN. Furthermore, the comprehensive loss used to train the speech synthesis model includes three parts: the prediction loss of the duration prediction model, the first loss of the speech synthesis model, and the second loss of the GAN composed of the speech synthesis model and the discriminator, which achieves the effect of jointly training the speech synthesis model, the duration prediction model and the discriminator, and can improve the accuracy of the speech synthesis model, the duration prediction model and the discriminator.
[0099] In summary, the present disclosure first obtains the target text included in the target songbook and the target music score corresponding to the target text, then extracts the phoneme sequence corresponding to the target text, and the pitch sequence composed of the pitch corresponding to each phoneme in the phoneme sequence, and then uses a pre-trained duration prediction model to predict the duration sequence corresponding to the phoneme sequence, which includes the duration corresponding to each phoneme, and finally, based on the phoneme sequence, pitch sequence and duration sequence, uses a pre-trained speech synthesis model to synthesize the target audio that conforms to the target music score and matches the duration sequence. The present disclosure can extract the corresponding phoneme sequence and pitch sequence according to the text and music score included in the songbook, and predict the corresponding duration sequence, so as to synthesize audio that conforms to the songbook according to the phoneme sequence, pitch sequence and duration sequence, and can improve the expressiveness of the audio.
[0100] Fig.10 is a block diagram of a speech synthesis device based on a songbook according to an exemplary embodiment. Fig.10 As shown, the device 300 includes:
[0101] The acquisition module 301 is used to acquire the target text included in the target songbook and the target music score corresponding to the target text.
[0102] The extraction module 302 is used to extract the phoneme sequence corresponding to the target text and the pitch sequence corresponding to the target music score, where the pitch sequence includes: the pitch corresponding to each phoneme in the phoneme sequence.
[0103] The prediction module 303 is used to predict the duration sequence according to the phoneme sequence by using a pre-trained duration prediction model. The duration sequence includes: the duration corresponding to each phoneme in the phoneme sequence.
[0104] The synthesis module 304 is used to synthesize the target audio that conforms to the target music score corresponding to the target text according to the phoneme sequence, pitch sequence and duration sequence through a pre-trained speech synthesis model, and the target audio matches the duration sequence.
[0105] In one implementation, the duration prediction model may be used to perform the following steps:
[0106] Step A) predicting the duration probability distribution corresponding to the phoneme sequence.
[0107] Step B) random sampling is performed according to the duration probability distribution to determine the duration corresponding to each phoneme in the phoneme sequence.
[0108] In another implementation, the speech synthesis model can be used to perform the following steps:
[0109] Step C) determining a text feature sequence corresponding to the target text according to the phoneme sequence, wherein the text feature sequence includes a text feature corresponding to each phoneme in the phoneme sequence.
[0110] Step D) generates target audio according to the text feature sequence, pitch sequence and duration sequence.
[0111] It should be noted that the speech synthesis model and duration prediction model in the above embodiment are obtained by joint training in the following manner:
[0112] Step a) obtaining the training text, the annotation data corresponding to the training text, the total duration and the training music score included in the training songbook.
[0113] Step b) determining the training phoneme sequence and training duration sequence corresponding to the training text according to the annotated data, and determining the training pitch sequence according to the training music score, wherein the training pitch sequence includes: the pitch corresponding to each training phoneme in the training phoneme sequence, and the training duration sequence includes: the duration corresponding to each training phoneme.
[0114] Step c) inputting the training phoneme sequence into the duration prediction model, and training the duration prediction model according to the output of the duration prediction model and the total duration.
[0115] Step d) inputs the training phoneme sequence, the training pitch sequence and the training duration sequence into the speech synthesis model, and trains the speech synthesis model based on the training audio corresponding to the training text output by the speech synthesis model.
[0116] In one application scenario, the implementation of step c) may include:
[0117] Step c1) determines the maximum likelihood loss corresponding to the training phoneme sequence based on the initial duration probability distribution corresponding to the training phoneme sequence and the initial duration corresponding to each training phoneme output by the duration prediction model.
[0118] Step c2) Determine the prediction loss by Lagrangian operator method according to the maximum likelihood loss corresponding to the training phoneme sequence, the total training time and the total time, and the total training time is determined according to the initial time corresponding to each training phoneme.
[0119] Step c3) aims to reduce the prediction loss and uses the back propagation algorithm to update the duration prediction model.
[0120] In another application scenario, step d) may be implemented as follows:
[0121] Step d1) determines the synthesis loss based on the initial audio and training audio output by the speech synthesis model.
[0122] Step d2) determines the comprehensive loss based on the synthetic loss and the predicted loss.
[0123] Step d3) aims to reduce the comprehensive loss and updates the speech synthesis model using the back propagation algorithm.
[0124] Furthermore, the implementation of step d) may also include:
[0125] Step d4) extracting a first number of initial audio segments from the initial audio according to a preset rule, and extracting a training audio segment corresponding to each initial audio segment from the training audio, wherein each initial audio segment includes a different number of continuous audio frames in the initial audio.
[0126] Step d5) inputs each initial audio segment into the corresponding discriminator to obtain an initial discrimination result output by the discriminator, and inputs a training audio segment corresponding to the initial audio segment into the discriminator to obtain a training discrimination result output by the discriminator.
[0127] Accordingly, step d1) can be implemented in the following manner:
[0128] Step 1) Determine a first loss based on the initial audio and the training audio.
[0129] Step 2) Determine a second loss based on the initial discrimination result and the training discrimination result corresponding to each initial audio segment, and the second loss is used to train the discriminator.
[0130] Step 3) Determine a composite loss based on the first loss and the second loss.
[0131] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0132] In summary, the present disclosure first obtains the target text included in the target songbook and the target music score corresponding to the target text, then extracts the phoneme sequence corresponding to the target text, and the pitch sequence composed of the pitch corresponding to each phoneme in the phoneme sequence, and then uses a pre-trained duration prediction model to predict the duration sequence corresponding to the phoneme sequence, which includes the duration corresponding to each phoneme, and finally, based on the phoneme sequence, pitch sequence and duration sequence, uses a pre-trained speech synthesis model to synthesize the target audio that conforms to the target music score and matches the duration sequence. The present disclosure can extract the corresponding phoneme sequence and pitch sequence according to the text and music score included in the songbook, and predict the corresponding duration sequence, so as to synthesize audio that conforms to the songbook according to the phoneme sequence, pitch sequence and duration sequence, and can improve the expressiveness of the audio.
[0133] Reference below Fig.11 , which shows a schematic diagram of the structure of an electronic device (which can be understood as the execution subject in the above embodiment) 400 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.11 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0134] like Fig.11 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0135] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.11The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0136] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0137] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0138] In some embodiments, the terminal devices and servers may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0139] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0140] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains the target text included in the target songbook and the target music score corresponding to the target text; extracts the phoneme sequence corresponding to the target text and the pitch sequence corresponding to the target music score, the pitch sequence including: the pitch corresponding to each phoneme in the phoneme sequence; predicts the duration sequence through a pre-trained duration prediction model based on the phoneme sequence, the duration sequence including: the duration corresponding to each phoneme in the phoneme sequence; synthesizes the target audio corresponding to the target text and conforming to the target music score through a pre-trained speech synthesis model based on the phoneme sequence, the pitch sequence and the duration sequence, and the target audio matches the duration sequence.
[0141] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0142] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0143] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, the acquisition module may also be described as a "module for acquiring target text and target music score".
[0144] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0145] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0146] According to one or more embodiments of the present disclosure, Example 1 provides a songbook-based speech synthesis method, comprising: obtaining a target text included in a target songbook and a target music score corresponding to the target text; extracting a phoneme sequence corresponding to the target text, and a pitch sequence corresponding to the target music score, the pitch sequence comprising: the pitch corresponding to each phoneme in the phoneme sequence; predicting a duration sequence through a pre-trained duration prediction model based on the phoneme sequence, the duration sequence comprising: the duration corresponding to each phoneme in the phoneme sequence; synthesizing a target audio that conforms to the target music score corresponding to the target text through a pre-trained speech synthesis model based on the phoneme sequence, and the target audio matches the duration sequence.
[0147] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein the duration prediction model is used to: predict the duration probability distribution corresponding to the phoneme sequence; and perform random sampling according to the duration probability distribution to determine the duration corresponding to each phoneme in the phoneme sequence.
[0148] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, wherein the speech synthesis model is used to: determine a text feature sequence corresponding to the target text based on the phoneme sequence, the text feature sequence including text features corresponding to each phoneme in the phoneme sequence; and generate the target audio based on the text feature sequence, the pitch sequence and the duration sequence.
[0149] According to one or more embodiments of the present disclosure, Example 4 provides the methods of Examples 1 to 3, wherein the speech synthesis model and the duration prediction model are obtained by joint training in the following manner: obtaining the training text included in the training songbook, the annotation data corresponding to the training text, the total duration and the training music score; determining the training phoneme sequence and the training duration sequence corresponding to the training text according to the annotation data, and determining the training pitch sequence according to the training music score, the training pitch sequence including: the pitch corresponding to each training phoneme in the training phoneme sequence, and the training duration sequence including: the duration corresponding to each training phoneme; inputting the training phoneme sequence into the duration prediction model, and training the duration prediction model according to the output of the duration prediction model and the total duration; inputting the training phoneme sequence, the training pitch sequence and the training duration sequence into the speech synthesis model, and training the speech synthesis model according to the output of the speech synthesis model and the training audio corresponding to the training text.
[0150] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 4, wherein the duration prediction model is trained according to the output of the duration prediction model and the total duration, including: determining the maximum likelihood loss corresponding to the training phoneme sequence according to the initial duration probability distribution corresponding to the training phoneme sequence and the initial duration corresponding to each training phoneme output by the duration prediction model; determining the prediction loss by the Lagrangian operator method according to the maximum likelihood loss corresponding to the training phoneme sequence, the total training duration and the total duration, wherein the total training duration is determined according to the initial duration corresponding to each training phoneme; and updating the duration prediction model by using a back propagation algorithm with the goal of reducing the prediction loss.
[0151] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein the speech synthesis model is trained based on the training audio corresponding to the training text output by the speech synthesis model, including: determining the synthesis loss based on the initial audio output by the speech synthesis model and the training audio; determining the comprehensive loss based on the synthesis loss and the prediction loss; and updating the speech synthesis model using a back propagation algorithm with the goal of reducing the comprehensive loss.
[0152] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 6, wherein training the speech synthesis model according to the output of the speech synthesis model and the training audio corresponding to the training text further includes: extracting a first number of initial audio segments from the initial audio according to a preset rule, and extracting a training audio segment corresponding to each of the initial audio segments from the training audio, each of the initial audio segments including a different number of continuous audio frames in the initial audio; inputting each of the initial audio segments into a corresponding discriminator to obtain an initial discrimination result output by the discriminator, and inputting the training audio segment corresponding to the initial audio segment into the discriminator to obtain a training discrimination result output by the discriminator; determining the synthesis loss according to the initial audio output by the speech synthesis model and the training audio, including: determining a first loss according to the initial audio and the training audio; determining a second loss according to the initial discrimination result and the training discrimination result corresponding to each of the initial audio segments, the second loss being used to train the discriminator; and determining the synthesis loss according to the first loss and the second loss.
[0153] According to one or more embodiments of the present disclosure, Example 8 provides a songbook-based speech synthesis device, comprising: an acquisition module, used to acquire a target text included in a target songbook and a target music score corresponding to the target text; an extraction module, used to extract a phoneme sequence corresponding to the target text, and a pitch sequence corresponding to the target music score, wherein the pitch sequence includes: the pitch corresponding to each phoneme in the phoneme sequence; a prediction module, used to predict a duration sequence according to the phoneme sequence through a pre-trained duration prediction model, wherein the duration sequence includes: the duration corresponding to each phoneme in the phoneme sequence; a synthesis module, used to synthesize a target audio corresponding to the target text and conforming to the target music score according to the phoneme sequence, the pitch sequence and the duration sequence through a pre-trained speech synthesis model, and the target audio matches the duration sequence.
[0154] According to one or more embodiments of the present disclosure, Example 9 provides a computer-readable medium having a computer program stored thereon, which implements the steps of the methods described in Examples 1 to 7 when executed by a processing device.
[0155] According to one or more embodiments of the present disclosure, Example 10 provides an electronic device, comprising: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of the method described in Examples 1 to 7.
[0156] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0157] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0158] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A speech synthesis method based on a songbook, characterized in that: The method comprises: Acquire a target text included in a target libretto and a target music score corresponding to the target text; Extracting a phoneme sequence corresponding to the target text and a pitch sequence corresponding to the target music score, wherein the pitch sequence includes: a pitch corresponding to each phoneme in the phoneme sequence; According to the phoneme sequence, predicting a duration sequence by a pre-trained duration prediction model, the duration sequence comprising: a duration corresponding to each phoneme in the phoneme sequence; According to the phoneme sequence, the pitch sequence and the duration sequence, a target audio that corresponds to the target text and conforms to the target musical score is synthesized by a pre-trained speech synthesis model, and the target audio matches the duration sequence; The speech synthesis model and the duration prediction model are obtained by joint training in the following manner: Obtaining the training text, the annotation data corresponding to the training text, the total duration and the training music score included in the training songbook; Determine a training phoneme sequence and a training duration sequence corresponding to the training text according to the annotation data, and determine a training pitch sequence according to the training music score, wherein the training pitch sequence includes: the pitch corresponding to each training phoneme in the training phoneme sequence, and the training duration sequence includes: the duration corresponding to each training phoneme; Inputting the training phoneme sequence into the duration prediction model, and training the duration prediction model according to the output of the duration prediction model and the total duration; Inputting the training phoneme sequence, the training pitch sequence and the training duration sequence into the speech synthesis model, and training the speech synthesis model according to the training audio outputted by the speech synthesis model and corresponding to the training text; The step of training the speech synthesis model according to the output of the speech synthesis model and the training audio corresponding to the training text comprises: Extracting a first number of initial audio segments from the initial audio output by the speech synthesis model according to a preset rule, and extracting a training audio segment corresponding to each of the initial audio segments from the training audio, wherein each of the initial audio segments includes a different number of continuous audio frames in the initial audio; Inputting each of the initial audio segments into a corresponding discriminator to obtain an initial discrimination result output by the discriminator, and inputting the training audio segment corresponding to the initial audio segment into the discriminator to obtain a training discrimination result output by the discriminator; Determine a first loss based on the initial audio and the training audio; Determine a second loss according to the initial discrimination result and the training discrimination result corresponding to each of the initial audio segments, wherein the second loss is used to train the discriminator; A combined loss is determined based on the first loss and the second loss.
2. The method according to claim 1, characterized in that The duration prediction model is used to: Predicting a probability distribution of duration corresponding to the phoneme sequence; Random sampling is performed according to the duration probability distribution to determine the duration corresponding to each phoneme in the phoneme sequence.
3. The method according to claim 1, characterized in that The speech synthesis model is used to: Determine a text feature sequence corresponding to the target text according to the phoneme sequence, wherein the text feature sequence includes a text feature corresponding to each phoneme in the phoneme sequence; The target audio is generated according to the text feature sequence, the pitch sequence and the duration sequence.
4. The method according to claim 1, characterized in that: The step of training the duration prediction model according to the output of the duration prediction model and the total duration includes: Determine the maximum likelihood loss corresponding to the training phoneme sequence according to the initial duration probability distribution corresponding to the training phoneme sequence and the initial duration corresponding to each training phoneme output by the duration prediction model; Determine the prediction loss by Lagrangian operator method according to the maximum likelihood loss corresponding to the training phoneme sequence, the total training duration and the total duration, wherein the total training duration is determined according to the initial duration corresponding to each training phoneme; With the goal of reducing the prediction loss, the duration prediction model is updated using a back propagation algorithm.
5. The method according to claim 4, characterized in that The step of training the speech synthesis model according to the output of the speech synthesis model and the training audio corresponding to the training text comprises: Determine a synthesis loss according to the initial audio output by the speech synthesis model and the training audio; Determine the comprehensive loss based on the synthetic loss and the predicted loss; With the goal of reducing the comprehensive loss, the speech synthesis model is updated using a back-propagation algorithm.
6. A speech synthesis device based on a songbook, characterized in that: The device comprises: An acquisition module, used for acquiring a target text included in a target libretto and a target music score corresponding to the target text; An extraction module, used to extract a phoneme sequence corresponding to the target text and a pitch sequence corresponding to the target music score, wherein the pitch sequence includes: a pitch corresponding to each phoneme in the phoneme sequence; A prediction module, configured to predict a duration sequence according to the phoneme sequence by using a pre-trained duration prediction model, wherein the duration sequence includes: a duration corresponding to each phoneme in the phoneme sequence; A synthesis module, configured to synthesize a target audio that conforms to the target music score and corresponds to the target text according to the phoneme sequence, the pitch sequence and the duration sequence through a pre-trained speech synthesis model, wherein the target audio matches the duration sequence; The speech synthesis model and the duration prediction model are obtained by joint training in the following manner: Obtaining the training text, the annotation data corresponding to the training text, the total duration and the training music score included in the training songbook; Determine a training phoneme sequence and a training duration sequence corresponding to the training text according to the annotation data, and determine a training pitch sequence according to the training music score, wherein the training pitch sequence includes: the pitch corresponding to each training phoneme in the training phoneme sequence, and the training duration sequence includes: the duration corresponding to each training phoneme; Inputting the training phoneme sequence into the duration prediction model, and training the duration prediction model according to the output of the duration prediction model and the total duration; Inputting the training phoneme sequence, the training pitch sequence and the training duration sequence into the speech synthesis model, and training the speech synthesis model according to the training audio outputted by the speech synthesis model and corresponding to the training text; The step of training the speech synthesis model according to the output of the speech synthesis model and the training audio corresponding to the training text comprises: Extracting a first number of initial audio segments from the initial audio output by the speech synthesis model according to a preset rule, and extracting a training audio segment corresponding to each of the initial audio segments from the training audio, wherein each of the initial audio segments includes a different number of continuous audio frames in the initial audio; Inputting each of the initial audio segments into a corresponding discriminator to obtain an initial discrimination result output by the discriminator, and inputting the training audio segment corresponding to the initial audio segment into the discriminator to obtain a training discrimination result output by the discriminator; Determine a first loss based on the initial audio and the training audio; Determine a second loss according to the initial discrimination result and the training discrimination result corresponding to each of the initial audio segments, wherein the second loss is used to train the discriminator; A combined loss is determined based on the first loss and the second loss.
7. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the method described in any one of claims 1 to 5 are implemented.
8. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Voice synthesis method and device
CN108806665A
Song generation method and system based on neural network
CN109801608A
