WO2022156544A1 - 语音合成方法、装置、可读介质及电子设备 - Google Patents

语音合成方法、装置、可读介质及电子设备 Download PDF

Info

Publication number
WO2022156544A1
WO2022156544A1 PCT/CN2022/070638 CN2022070638W WO2022156544A1 WO 2022156544 A1 WO2022156544 A1 WO 2022156544A1 CN 2022070638 W CN2022070638 W CN 2022070638W WO 2022156544 A1 WO2022156544 A1 WO 2022156544A1
Authority
WO
WIPO (PCT)
Prior art keywords
training
audio
sequence
specified
acoustic feature
Prior art date
Application number
PCT/CN2022/070638
Other languages
English (en)
French (fr)
Inventor
吴鹏飞
潘俊杰
Original Assignee
北京有竹居网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京有竹居网络技术有限公司 filed Critical 北京有竹居网络技术有限公司
Publication of WO2022156544A1 publication Critical patent/WO2022156544A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L13/00Speech synthesis; Text to speech systems
    • G10L13/02Methods for producing synthetic speech; Speech synthesisers
    • G10L13/04Details of speech synthesis systems, e.g. synthesiser structure or memory management
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L13/00Speech synthesis; Text to speech systems
    • G10L13/02Methods for producing synthetic speech; Speech synthesisers
    • G10L13/033Voice editing, e.g. manipulating the voice of the synthesiser
    • G10L13/0335Pitch control
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/27Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique
    • G10L25/30Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique using neural networks
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/48Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 specially adapted for particular use
    • G10L25/51Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 specially adapted for particular use for comparison or discrimination
    • G10L25/63Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 specially adapted for particular use for comparison or discrimination for estimating an emotional state

Definitions

  • the present application is based on the CN application number 202110075973.1 and the filing date is January 20, 2021, and claims its priority.
  • the disclosure of the CN application is hereby incorporated into the present application as a whole.
  • the present disclosure relates to the technical field of electronic information processing, and in particular, to a speech synthesis method, apparatus, readable medium, and electronic device.
  • Speech synthesis refers to the synthesis of user-specified text into audio.
  • speech with corresponding emotion can be synthesized by specifying emotion tags.
  • the present disclosure provides a speech synthesis method, the method comprising:
  • the specified acoustic feature is used to indicate the prosody feature of the audio;
  • target audio whose acoustic features match the specified acoustic features.
  • the present disclosure provides a speech synthesis device, the device comprising:
  • an acquisition module for acquiring text to be synthesized, specified acoustic features and specified emotion types, and the specified acoustic features are used to indicate the prosody features of audio;
  • an extraction module used for extracting the phoneme sequence corresponding to the text to be synthesized
  • an expansion module configured to expand the specified acoustic feature according to the phoneme sequence to obtain an acoustic feature sequence
  • the synthesis module is used to input the phoneme sequence, the acoustic feature sequence and the specified emotion type into a pre-trained speech synthesis model to obtain the output of the speech synthesis model, the text to be synthesized corresponding to the
  • the target audio of the specified emotion type is described, and the acoustic feature of the target audio matches the specified acoustic feature.
  • the present disclosure provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing apparatus, implements the steps of the method described in the first aspect of the present disclosure.
  • the present disclosure provides an electronic device, comprising:
  • a processing device is configured to execute the computer program in the storage device to implement the steps of the method in the first aspect of the present disclosure.
  • the present disclosure provides a computer program comprising instructions that, when executed by a processor, cause the processor to perform the steps of the method of any one of the first aspects.
  • the present disclosure provides a computer program product comprising instructions that, when executed by a processor, cause the processor to perform the steps of the method of any one of the first aspects.
  • FIG. 1 is a flowchart of a method for speech synthesis according to an exemplary embodiment
  • FIG. 2 is a flowchart of another speech synthesis method shown according to an exemplary embodiment
  • FIG. 3 is a process flow diagram of a speech synthesis model according to an exemplary embodiment
  • FIG. 4 is a block diagram of a speech synthesis model according to an exemplary embodiment
  • Fig. 5 is a flow chart of training a speech synthesis model according to an exemplary embodiment
  • FIG. 6 is a flowchart of another training speech synthesis model according to an exemplary embodiment
  • Fig. 7 is a flow chart of another speech synthesis method shown according to an exemplary embodiment
  • FIG. 8 is a block diagram of a speech synthesis apparatus according to an exemplary embodiment
  • FIG. 9 is a block diagram of another speech synthesis apparatus according to an exemplary embodiment.
  • FIG. 10 is a block diagram of another speech synthesis apparatus according to an exemplary embodiment
  • Fig. 11 is a block diagram of an electronic device according to an exemplary embodiment.
  • the term “including” and variations thereof are open-ended inclusions, ie, "including but not limited to”.
  • the term “based on” is “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”. Relevant definitions of other terms will be given in the description below.
  • Fig. 1 is a flowchart of a speech synthesis method according to an exemplary embodiment. As shown in Fig. 1 , the method includes steps 101-104.
  • Step 101 Acquire the text to be synthesized, the specified acoustic feature and the specified emotion type, and the specified acoustic feature is used to indicate the prosody feature of the audio.
  • the text to be synthesized can be, for example, one or more sentences in a text file specified by the user, one or more paragraphs, one or more chapters in a text file, or one or more sentences in a text file. words.
  • the text file may be, for example, an electronic book, or other types of files, such as news, articles on official accounts, or blogs.
  • specified acoustic features and specified emotion types can also be acquired.
  • the specified acoustic feature and the specified emotion type can be understood as specified by the user, and the user desires to synthesize the text to be synthesized into audio having the specified emotion type and conforming to the specified acoustic feature (ie, the target audio mentioned later). That is, the user can control the target audio by specifying the acoustic characteristics and specifying the emotion type.
  • the specified acoustic feature may include multiple dimensions, for example, may include one or more of fundamental frequency (English: Pitch), volume (English: Energy), or speech rate (English: Duration), and may also include: noise level, pitch, timbre, or loudness, etc. Noise level can be understood as a feature that reflects the amount of noise in audio.
  • the specified emotion type can be expressed in the form of a label, for example, happiness corresponds to 0001, surprise corresponds to 0011, disgust corresponds to 1010, anger corresponds to 1011, shy corresponds to 0101, fear corresponds to 0100, sadness corresponds to 1000, and disdain corresponds to 1001.
  • Step 102 Extract the phoneme sequence corresponding to the text to be synthesized.
  • Step 103 Expand the specified acoustic feature according to the phoneme sequence to obtain the acoustic feature sequence.
  • Step 104 the phoneme sequence, the acoustic feature sequence and the specified emotion type are input into the pre-trained speech synthesis model, to obtain the target audio with the specified emotion type corresponding to the speech synthesis model output, the text to be synthesized, and the acoustic features of the target audio are the same as Specifies acoustic feature matching.
  • the specified acoustic feature may be extended according to the phoneme sequence to obtain the acoustic feature sequence.
  • the acoustic feature sequence includes the acoustic feature corresponding to each phoneme in the phoneme sequence.
  • an acoustic feature sequence may be generated according to the length of the phoneme sequence (ie, the number of phonemes included in the phoneme sequence), wherein the acoustic feature corresponding to each phoneme is a specified acoustic feature.
  • the specified acoustic feature may also be taken as the mean value (or standard deviation), and the acoustic feature corresponding to each phoneme may be generated according to a preset distribution (eg, Gaussian distribution or uniform distribution).
  • the present disclosure first obtains the text to be synthesized, the designated emotion type, and the designated acoustic features used to indicate the prosody features of the audio, then extracts the corresponding phoneme sequence from the to-be-synthesized text, and then according to the phoneme sequence, extracts the corresponding phoneme sequence.
  • the specified acoustic features are expanded to obtain the acoustic feature sequence, and finally the phoneme sequence, the acoustic feature sequence and the specified emotion type are input into the pre-trained speech synthesis model, so as to obtain the text to be synthesized output by the speech synthesis model.
  • the present disclosure controls the speech synthesis of text by specifying acoustic features and specifying emotion types, so that the target audio output by the speech synthesis model can conform to the specified acoustic features on the basis of the specified emotion types, and can realize the emotion type and acoustic characteristics in the process of speech synthesis.
  • the explicit control of the two dimensions of the feature improves the expressiveness of the target audio.
  • Fig. 2 is a flow chart showing another speech synthesis method according to an exemplary embodiment. As shown in Fig. 2, step 103 can be implemented in the following manner:
  • Step 1031 determine the acoustic feature corresponding to each phoneme in the phoneme sequence
  • Step 1032 Generate an acoustic feature sequence according to the acoustic feature of each phoneme pair.
  • the length of the phoneme sequence may be determined first, that is, the number of phonemes included in the phoneme sequence. Then, the specified acoustic feature is copied to obtain an acoustic feature sequence with the same length as the phoneme sequence, wherein each acoustic feature is the same as the specified acoustic feature, that is, the acoustic feature corresponding to each phoneme in the acoustic feature sequence is the same as the specified acoustic feature. to specify acoustic features.
  • the length of the phoneme sequence is 100 (that is, it includes 100 phonemes), and the acoustic feature corresponding to each phoneme in the phoneme sequence is determined as the specified acoustic feature, then the acoustic feature corresponding to the 100 phonemes can be formed into an acoustic feature sequence.
  • the specified acoustic feature as a 1*5-dimensional vector as an example, then the acoustic feature sequence includes 100 1*5-dimensional vectors, which can form a 100*5-dimensional vector.
  • Fig. 3 is a processing flow chart of a speech synthesis model according to an exemplary embodiment. As shown in Fig. 3, the speech synthesis model can be used to perform the following steps:
  • Step A determine the text feature sequence corresponding to the text to be synthesized according to the phoneme sequence, and the text feature sequence includes the text feature corresponding to each phoneme in the phoneme sequence;
  • Step B determine the specified emotional feature corresponding to the specified emotional type, and expand the specified emotional feature according to the phoneme sequence to obtain the emotional feature sequence;
  • step C target audio is generated according to the text feature sequence, the acoustic feature sequence and the emotion feature sequence.
  • the text feature sequence ie Text Embedding
  • the text feature sequence includes the corresponding phoneme in the phoneme sequence.
  • the text feature can be understood as a text vector that can represent the phoneme. For example, if the phoneme sequence includes 100 phonemes, and the text vector corresponding to each phoneme is a 1*80-dimensional vector, the text feature sequence may be a 100*80-dimensional vector.
  • the speech synthesis model may include a lookup table (English: Lookup Table), and the lookup table may map the label corresponding to the specified emotion type into a multi-dimensional emotion vector. For example, if the specified emotion type is shy and the corresponding label is 0101, then the lookup table can map 0101 to a 1*50-dimensional emotion vector as the specified emotion feature used to represent happiness.
  • the speech synthesis model may include an encoder (ie, the second encoder in FIG.
  • the encoder may extract the corresponding emotion vector according to the specified emotion type, that is, according to different emotion types, Obtain an emotion vector that can characterize the emotion type.
  • the encoder may be independently trained in advance according to a large number of training samples, or may be obtained by joint training with a speech synthesis model, which is not specifically limited in the present disclosure.
  • the specified emotional feature can also be expanded according to the phoneme sequence to obtain the emotional feature sequence, and the emotional feature sequence includes the emotional feature corresponding to each phoneme in the phoneme sequence. .
  • the length of the phoneme sequence that is, the number of phonemes included in the phoneme sequence, can be determined first.
  • the specified emotional feature is copied to obtain an emotional feature sequence with the same length as the phoneme sequence, wherein each emotional feature is the same as the specified emotional feature, that is, the emotional feature corresponding to each phoneme in the emotional feature sequence is to specify sentiment features. For example, if the length of the phoneme sequence is 100 (that is, it includes 100 phonemes), then the emotion feature corresponding to each phoneme can be determined as the specified emotion feature, and then the emotion feature sequence corresponding to 100 phonemes can be composed. Taking the specified emotional feature as a 1*50-dimensional vector as an example, then the emotional feature sequence includes 100 1*50-dimensional vectors, which can form a 100*50-dimensional vector.
  • the text feature sequence, the emotion feature sequence and the acoustic feature sequence can be combined to generate a target audio having a specified emotion type and matching the specified acoustic feature.
  • text feature sequences, emotional feature sequences, and acoustic feature sequences can be concatenated to obtain a combined sequence, and then target audio can be generated according to the combined sequence.
  • the phoneme sequence includes 100 phonemes
  • the text feature sequence can be a 100*80-dimensional vector
  • the corresponding emotional feature sequence is a 100*50-dimensional vector
  • the acoustic feature sequence is a 100*5-dimensional vector
  • the combined sequence can be is a 100*135-dimensional vector.
  • the target audio can be generated based on this 100*135-dimensional vector.
  • the speech synthesis model is a Tacotron model, which includes: a lookup table (or a second encoder), a first encoder (ie an Encoder), an attention network (ie Attention), a decoding Decoder (ie Decoder) and post-processing network (ie Post-processing).
  • the lookup table can be a preset matrix, and the label corresponding to the specified emotion type can be multiplied by the lookup table, so that the label corresponding to the specified emotion type is mapped to the specified emotion feature, and the specified emotion feature is expanded to obtain the emotion feature. sequence.
  • the first encoder may include an embedding layer (ie Character Embedding layer), a pre-net sub-model and a CBHG (English: Convolution Bank+Highway network+bidirectional Gated Recurrent Unit, Chinese: Convolutional layer+High-speed network+ Bidirectional Recurrent Neural Network) submodel.
  • the sequence of phonemes can be input into the first 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 nonlinear transformation on the word vector, thereby improving the convergence and generalization capabilities of the speech synthesis model. Finally, through CBHG The sub-model obtains a text feature sequence that can characterize the text to be synthesized according to the non-linearly transformed word vector.
  • the acoustic feature sequence, the emotional feature sequence output by the lookup table, and the text feature sequence output by the encoder can be spliced to obtain a combined sequence, and then the combined sequence can be input into the attention network.
  • the attention network can be used for each element in the combined sequence. Add an attention weight.
  • the attention network may be a location-sensitive attention (English: Locative Sensitive Attention) network, or a GMM (English: Gaussian Mixture Model, abbreviated GMM) attention network, or a Multi-Head Attention network. This is not specifically limited.
  • the output of the attention network is then used as the input of the decoder.
  • the decoder may include a preprocessing network sub-model (which may be the same as that included in the encoder), Attention-RNN, Decoder-RNN.
  • the preprocessing network sub-model is used to perform nonlinear transformation on the input.
  • the structure of the Attention-RNN is a layer of unidirectional, zoneout-based LSTM (English: Long Short-Term Memory, Chinese: Long Short-Term Memory Network), which can The output of the processing network sub-model is used as input, and is output to the Decoder-RNN after passing through the LSTM unit.
  • Decode-RNN is a two-layer unidirectional, zoneout-based LSTM, which outputs Mel spectrum information through the LSTM unit, and the Mel spectrum information can include one or more Mel spectrum features.
  • the mel spectral information is input into the post-processing network, which can include a vocoder (eg, Wavenet vocoder, Griffin-Lim vocoder, etc.) to transform the mel spectral feature information to obtain the target audio.
  • a vocoder eg, Wavenet vocoder, Griffin-Lim vocoder, etc.
  • FIG. 5 is a flowchart showing a training speech synthesis model according to an exemplary embodiment. As shown in FIG. 5 , the above-mentioned speech synthesis model is obtained by training in the following manner:
  • Step D extracting the real acoustic features of the training audio corresponding to the training text, and the real acoustic features are used to indicate the prosody features of the audio;
  • step E the real acoustic features are extended according to the training phoneme sequence corresponding to the training text to obtain the training acoustic feature sequence;
  • step F the training phoneme sequence, the training acoustic feature sequence and the training emotion type corresponding to the training audio are input into the speech synthesis model, and the speech synthesis model is trained according to the output of the speech synthesis model and the training audio.
  • the training text and the training audio corresponding to the training text there can be multiple training texts, and correspondingly, there are multiple training audios.
  • a large amount of text can be captured on the Internet as training text, and then the audio corresponding to the training text can be used as training audio.
  • the real acoustic features corresponding to the training audio can be extracted.
  • the real acoustic features corresponding to the training audio can be obtained by means of signal processing, labeling, etc., wherein the real acoustic features are used to indicate the prosody features of the training audio, and may include: fundamental frequency, volume, or speech rate of the training audio.
  • At least one may also include: noise level, pitch, timbre, or loudness, etc.
  • a training phoneme sequence corresponding to the training text may also be extracted, and the training phoneme sequence may include training phonemes corresponding to each word in the training text (a word may correspond to one or more training phonemes).
  • the training acoustic feature sequence includes the training acoustic feature corresponding to each training phoneme.
  • the training acoustic feature sequence may be generated according to the number of training phonemes included in the training phoneme sequence, wherein the training acoustic feature corresponding to each training phoneme is a real acoustic feature.
  • the training phoneme sequence, the training acoustic feature sequence and the training emotion type corresponding to the training audio 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.
  • the difference (or mean square error) between the training audio and the speech synthesis model can be used as the loss function of the speech synthesis model, and with the goal of reducing the loss function, the back-propagation algorithm can be used to correct the neuron in the speech synthesis model.
  • the parameter, the parameter of the neuron can be, for example, the weight (English: Weight) and the bias (English: Bias) of the neuron.
  • the speech synthesis model includes: a first module, a second module and a synthesis module, and the implementation of step F may include the following steps:
  • Step F2 through the second module, extract the training emotional feature corresponding to the training emotional type, and expand the training emotional feature according to the training phoneme sequence to obtain the training emotional feature sequence;
  • Step F3 through the synthesis module, according to the training text feature sequence, the training acoustic feature sequence and the training emotional feature sequence, generate the output of the speech synthesis model;
  • Step F4 Determine the loss function of the speech synthesis model according to the output of the speech synthesis model and the training audio, and update the first module, the second module and the synthesis module according to the loss function.
  • the speech synthesis model may include a first module, a second module and a synthesis module, wherein the first module is used to extract a training text feature sequence, which includes text features corresponding to each training phoneme in the training phoneme sequence,
  • a module may be, for example, an encoder (the first encoder as shown in Figure 4).
  • the second module is used to extract the training emotional features, and expand the training emotional features to obtain emotional feature sequences including the emotional features corresponding to each training phoneme.
  • the second module can be, for example, a lookup table, or an encoder (eg the second encoder shown in Figure 4).
  • the synthesis module is used to generate the corresponding audio according to the training text feature sequence, the training acoustic feature sequence and the training emotion feature sequence, that is, the output of the speech synthesis model.
  • the loss function of the speech synthesis model (for example, the output of the speech synthesis model, and the difference between the training audio) can be determined according to the output of the speech synthesis model and the training audio, so as to reduce the loss function of the speech synthesis model.
  • the loss function is the target, and the back-propagation algorithm is used to update the first module, the second module and the synthesis module in the speech synthesis model.
  • the second module is a look-up table, then in the process of training the speech synthesis model, the look-up table can be updated at the same time. If the second module is an encoder, then in the process of training the speech synthesis model, you can At the same time, the parameters of the neurons in the encoder are updated.
  • Fig. 6 is another flowchart of training a speech synthesis model according to an exemplary embodiment.
  • the real acoustic features include: at least one of fundamental frequency, volume, or speech rate.
  • Step D may Include the following steps:
  • Step D1 if the real acoustic feature includes the speech rate, determine the duration corresponding to each training phoneme in the training phoneme sequence according to the training audio and the training phoneme sequence, so as to determine the speech rate of the training audio.
  • the duration corresponding to each training phoneme is determined.
  • HTS English: HMM-based Speech Synthesis System
  • durationi which means the i-th The duration corresponding to each training phoneme.
  • the statistical value of the logarithmic duration corresponding to each training phoneme in the training phoneme sequence is used as the speech rate of the training audio.
  • the average (or standard deviation, extreme value, etc.) of the logarithmic duration corresponding to each training phoneme may be used as the speech rate of the training audio, which may be expressed as log_duration_mean.
  • Step D2 if the fundamental frequency is included in the real acoustic feature, extract the fundamental frequency of each audio frame included in the training audio to determine the fundamental frequency of the training audio.
  • a specific implementation may include steps D1-D3.
  • the fundamental frequency corresponding to each audio frame may be represented as pitchj, which represents the fundamental frequency corresponding to the jth audio frame, and correspondingly, the logarithmic fundamental frequency corresponding to the jth audio frame may be represented as log_pitchj.
  • the statistical value of the logarithmic fundamental frequency corresponding to each audio frame in the training audio is used as the fundamental frequency of the training audio.
  • the average value of the logarithmic fundamental frequency and the standard deviation of the logarithmic fundamental frequency corresponding to each audio frame may be used as the fundamental frequency of the training audio.
  • the average value can be expressed as log_pitch_mean, which can reflect the overall pitch of the training audio.
  • the standard deviation can be expressed as log_pitch_std, which can reflect the variation range of the fundamental frequency of the training audio.
  • Step D3 if the real acoustic feature includes volume, extract the volume of each audio frame included in the training audio to determine the volume of the training audio.
  • the volume corresponding to each audio frame can be expressed as energyj, which represents the volume corresponding to the jth audio frame.
  • the logarithmic volume corresponding to the jth audio frame can be expressed as log_energyj.
  • the statistical value of the logarithmic volume corresponding to each audio frame is used as the volume of the training audio.
  • the average value of the logarithmic volume corresponding to each audio frame can be used as the volume of the training audio, which can be expressed as log_energy_mean.
  • step D may further include: determining the noise level corresponding to the training audio according to the linear prediction coefficient corresponding to the training audio.
  • the LPC coefficient of the training audio can be determined (English: Linear Prediction Coefficient, Chinese: Linear Prediction Coefficient), and then the logarithmic operation is performed on the first dimension of the LPC coefficient of the training audio, and the result of the logarithmic operation is used as the training audio.
  • the corresponding noise level Through logarithmic operation, the variation range of the noise level can be compressed, thereby amplifying the variation degree of the noise level.
  • the noise level can be represented as log_spectral_tilt, for example.
  • the real acoustic features of the training audio can be generated according to the fundamental frequency, volume, speech rate, and noise level of the training audio.
  • the fundamental frequency, volume, speech rate, and noise level of the training audio are composed of the true acoustic features of the training audio.
  • the real acoustic feature can be a 1*5 dimensional vector: ⁇ fundamental frequency: (log_pitch_mean, log_pitch_std), volume: log_energy_mean, speech rate: log_duration_mean, noise level: log_spectral_tilt ⁇ .
  • the specified acoustic feature acquired in step 101 may also include the above-mentioned five dimensions.
  • the speech synthesis model may also be obtained by training in the following manner:
  • Step G according to the preset training set including the real acoustic features of the training audio, determine the statistical acoustic features of the training set;
  • Step H normalize the real acoustic features of each training audio according to the statistical acoustic features.
  • step E may be:
  • the normalized real acoustic features are expanded according to the training phoneme sequence to obtain the training acoustic feature sequence.
  • the real acoustic features can also be normalized.
  • the training set includes multiple training texts, and each training text corresponds to a training audio.
  • the real acoustic features of each training audio can be determined in the manner of steps D1 to D4, and the statistical acoustic features of the training set can be determined.
  • the statistical acoustic feature may be, for example, the mean, standard deviation, variance, or extreme value of the real acoustic features.
  • the real acoustic features of each training audio are then normalized according to the statistical acoustic features.
  • the mean ⁇ and standard deviation ⁇ of the real acoustic features can be used as statistical acoustic features, and then the real acoustic features between [ ⁇ -3 ⁇ , ⁇ +3 ⁇ ] can be mapped to [-1, 1], True acoustic features outside [ ⁇ -3 ⁇ , ⁇ +3 ⁇ ], which can be truncated to -1 or 1.
  • the average value and standard deviation of each dimension in the real acoustic feature can also be obtained separately, and each dimension in the real acoustic feature can be normalized.
  • the average pitch_ ⁇ and standard deviation pitch_ ⁇ of the log_pitch_mean of each training audio can be obtained, and then the log_pitch_mean between [pitch_ ⁇ -3pitch_ ⁇ , pitch_ ⁇ +3pitch_ ⁇ ] is mapped to [ -1,1], truncate log_pitch_mean outside [pitch_ ⁇ -3pitch_ ⁇ , pitch_ ⁇ +3pitch_ ⁇ ] to -1 or 1 to normalize log_pitch_mean.
  • the normalized real acoustic features can be extended according to the training phoneme sequence to obtain the training acoustic feature sequence.
  • a training acoustic feature sequence may be generated according to the number of training phonemes included in the training phoneme sequence, wherein the training acoustic feature corresponding to each training phoneme is a normalized real acoustic feature.
  • the specified acoustic features obtained in step 101 may also include the above-mentioned five normalized dimensions.
  • the specified acoustic features after normalization are more interpretive. Taking the specified acoustic feature as ⁇ -1,1,0,1,0 ⁇ as an example, where the value of log_pitch_mean is -1, it means that the target audio generated by the speech synthesis model and conforming to the specified acoustic feature is low-pitched.
  • the value of log_pitch_std is 1, indicating that the fundamental frequency of the target audio varies greatly.
  • the value of log_energy_mean is 0, indicating that the target audio is normal volume.
  • log_duration_mean The value corresponding to log_duration_mean is 1, which indicates that the speech rate of the target audio is slow (ie, the average duration corresponding to the phoneme).
  • log_spectral_tilt The value corresponding to log_spectral_tilt is 0, indicating that the noise level of the target audio is normal.
  • Fig. 7 is a flowchart showing another speech synthesis method according to an exemplary embodiment. As shown in Fig. 7, in addition to steps 101-104, after step 104, the method further includes:
  • Step 105 Update the specified acoustic feature according to the preset step value.
  • Steps 103 to 105 are repeatedly performed until the target audio satisfies the preset condition.
  • the desired emotion type ie, the specified emotion type
  • the desired acoustic signature is often only a rough range. Therefore, after the speech synthesis model outputs the target audio once, according to the specific needs of the user, set the step value for updating the specified acoustic feature, and then use the step value to update the specified acoustic feature, and according to the updated specified acoustic feature Steps 103 to 105 are repeatedly performed until the target audio satisfies the preset condition.
  • the preset condition may be a stop instruction triggered after the user considers that the requirement is met when listening to the target audio; the preset condition may also be that the number of times of repeating steps 103 to 105 reaches a specified number of times (for example, 5 times).
  • the specified emotion type obtained in step 101 is happy, and the specified acoustic feature is ⁇ 0,0,0,0,0 ⁇ , that is, the fundamental frequency, volume, speech rate and noise level are all average levels.
  • steps 103 to 104 are performed for the first time, the generated target audio has a happy emotion type, and the fundamental frequency of the target audio is average, the volume is normal, the speech rate is normal, and the noise level is normal.
  • the user After listening to the target audio, the user thinks that the speech rate is slow, and can set the step value to ⁇ 0,0,0,-0.5,0 ⁇ , and add the step value and the specified acoustic feature to obtain the updated specified acoustic feature ⁇ 0,0,0,-0.5,0 ⁇ , repeat the above process until a stop instruction triggered by the user that the target audio meets the requirements is received.
  • the present disclosure first obtains the text to be synthesized, the designated emotion type, and the designated acoustic features used to indicate the prosody features of the audio; then, from the text to be synthesized, the corresponding phoneme sequence is extracted; and then according to the phoneme sequence, the The specified acoustic features are expanded to obtain the acoustic feature sequence; finally, the phoneme sequence, the acoustic feature sequence and the specified emotion type are input into the pre-trained speech synthesis model, so as to obtain the text to be synthesized output by the speech synthesis model corresponding to the specified emotion type, and with the specified emotion type. Specifies the target audio for acoustic feature matching.
  • the present disclosure controls the speech synthesis of text by specifying acoustic features and specifying emotion types, so that the target audio output by the speech synthesis model can conform to the specified acoustic features on the basis of the specified emotion types, and can realize the emotion type and acoustic characteristics in the process of speech synthesis.
  • the explicit control of the two dimensions of the feature improves the expressiveness of the target audio.
  • FIG. 8 is a block diagram of a speech synthesis apparatus according to an exemplary embodiment. As shown in FIG. 8 , the apparatus 200 includes:
  • an acquisition module 201 configured to acquire the text to be synthesized, the specified acoustic feature and the specified emotion type, and the specified acoustic feature is used to indicate the prosody feature of the audio;
  • the extraction module 202 is used to extract the phoneme sequence corresponding to the text to be synthesized
  • the expansion module 203 is used to expand the specified acoustic feature according to the phoneme sequence to obtain the acoustic feature sequence;
  • the synthesis module 204 is used to input the phoneme sequence, the acoustic feature sequence and the specified emotion type into the pre-trained speech synthesis model, to obtain the output of the speech synthesis model, the target audio with the specified emotion type corresponding to the text to be synthesized, and the target audio of the target audio.
  • the acoustic feature matches the specified acoustic feature.
  • the specified acoustic characteristic includes at least one of fundamental frequency, volume, or speech rate.
  • FIG. 9 is a block diagram of another speech synthesis apparatus according to an exemplary embodiment.
  • the expansion module 203 may include:
  • the expansion sub-module 2032 is configured to form an acoustic feature sequence with the acoustic features corresponding to each phoneme.
  • a speech synthesis model can be used to perform the following steps:
  • Step A determine the text feature sequence corresponding to the text to be synthesized according to the phoneme sequence, and the text feature sequence includes the text feature corresponding to each phoneme in the phoneme sequence;
  • Step B determine the specified emotional feature corresponding to the specified emotional type, and expand the specified emotional feature according to the phoneme sequence to obtain the emotional feature sequence;
  • Step C according to the text feature sequence, the acoustic feature sequence and the emotional feature sequence, generate the target audio
  • the above-mentioned speech synthesis model is obtained by training in the following manner:
  • Step D extracting the real acoustic features of the training audio corresponding to the training text, and the real acoustic features are used to indicate the prosodic features of the training audio;
  • step E the real acoustic features are extended according to the training phoneme sequence corresponding to the training text to obtain the training acoustic feature sequence;
  • step F the training phoneme sequence, the training acoustic feature sequence and the training emotion type corresponding to the training audio are input into the speech synthesis model, and the speech synthesis model is trained according to the output of the speech synthesis model and the training audio.
  • the sound synthesis model includes: a first module, a second module and a synthesis module, and the implementation of step F may include the following steps:
  • Step F1 through the first module, extract the training text feature sequence corresponding to the training phoneme sequence, and the training text feature sequence includes the text feature corresponding to each training phoneme in the training phoneme sequence;
  • Step F2 through the second module, extract the training emotional feature corresponding to the training emotional type, and expand the training emotional feature according to the training phoneme sequence to obtain the training emotional feature sequence;
  • Step F3 through the synthesis module, according to the training text feature sequence, the training acoustic feature sequence and the training emotional feature sequence, generate the output of the speech synthesis model;
  • Step F4 Determine the loss function of the speech synthesis model according to the output of the speech synthesis model and the training audio, and update the first module, the second module and the synthesis module according to the loss function.
  • the real acoustic features include: at least one of fundamental frequency, volume, or speech rate, and step D may include the following steps:
  • Step D1 if the real acoustic feature includes the speech rate, determine the duration corresponding to each training phoneme in the training phoneme sequence according to the training audio and the training phoneme sequence, so as to determine the speech rate of the training audio.
  • the duration corresponding to each training phoneme is determined.
  • logarithmic operation is performed on the duration corresponding to each training phoneme to obtain the logarithmic duration corresponding to each training phoneme.
  • the statistical value of the logarithmic duration corresponding to each training phoneme in the training phoneme sequence is used as the speech rate of the training audio.
  • Step D2 if the fundamental frequency is included in the real acoustic feature, extract the fundamental frequency of each audio frame included in the training audio to determine the fundamental frequency of the training audio.
  • a logarithmic operation is performed on the base frequency corresponding to each audio frame to obtain the logarithmic base frequency corresponding to each audio frame.
  • the statistical value of the logarithmic fundamental frequency corresponding to each audio frame in the training audio is used as the fundamental frequency of the training audio.
  • Step D3 if the real acoustic feature includes volume, extract the volume of each audio frame included in the training audio to determine the volume of the training audio.
  • the statistical value of the logarithmic volume corresponding to each audio frame is used as the volume of the training audio.
  • Fig. 10 is a block diagram of another speech synthesis apparatus according to an exemplary embodiment. As shown in Fig. 10, the apparatus 200 may further include:
  • the update module 205 is used for inputting the phoneme sequence, the acoustic feature sequence and the specified emotion type into the pre-trained speech synthesis model to obtain the output of the speech synthesis model, after the target audio with the specified emotion type corresponding to the text to be synthesized, according to the Preset step value to update the specified acoustic features.
  • the present disclosure first obtains the text to be synthesized, the designated emotion type, and the designated acoustic features used to indicate the prosody features of the audio, and then extracts the corresponding phoneme sequence from the to-be-synthesized text, and then according to the phoneme sequence, extracts the corresponding phoneme sequence.
  • the specified acoustic features are expanded to obtain the acoustic feature sequence, and finally the phoneme sequence, the acoustic feature sequence and the specified emotion type are input into the pre-trained speech synthesis model, so as to obtain the text to be synthesized output by the speech synthesis model.
  • the present disclosure controls the speech synthesis of text by specifying acoustic features and specifying emotion types, so that the target audio output by the speech synthesis model can conform to the specified acoustic features on the basis of the specified emotion types, and can realize the emotion type and acoustic characteristics in the process of speech synthesis.
  • the explicit control of the two dimensions of the feature improves the expressiveness of the target audio.
  • FIG. 11 it shows a schematic structural diagram of an electronic device (ie, the execution body of the above-mentioned speech synthesis method) 300 suitable for implementing an embodiment of the present disclosure.
  • Terminal devices in the embodiments of the present disclosure may include, but are not limited to, such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals (eg, mobile terminals such as in-vehicle navigation terminals), etc., and stationary terminals such as digital TVs, desktop computers, and the like.
  • the electronic device shown in FIG. 11 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
  • an electronic device 300 may include a processing device (eg, a central processing unit, a graphics processor, etc.) 301 that may be loaded into random access according to a program stored in a read only memory (ROM) 302 or from a storage device 308 Various appropriate actions and processes are executed by the programs in the memory (RAM) 303 .
  • RAM 303 various programs and data required for the operation of the electronic device 300 are also stored.
  • the processing device 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304.
  • An input/output (I/O) interface 305 is also connected to bus 304 .
  • embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via the communication device 309, or from the storage device 308, or from the ROM 302.
  • the processing device 301 When the computer program is executed by the processing device 301, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
  • the computer-readable medium mentioned above in the present disclosure 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 can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
  • terminal devices and servers can use any currently known or future developed network protocols such as HTTP (HyperText Transfer Protocol) to communicate, and can communicate with digital data in any form or medium Communication (eg, a communication network) interconnects.
  • network protocols such as HTTP (HyperText Transfer Protocol) to communicate, and can communicate with digital data in any form or medium Communication (eg, a communication network) interconnects.
  • Examples of communication networks include local area networks (“LAN”), wide area networks (“WAN”), the Internet (eg, the Internet), and peer-to-peer networks (eg, ad hoc peer-to-peer networks), as well as any currently known or future development network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: acquires the text to be synthesized, specifies the acoustic features and specifies the emotion type, and the specified acoustic features Used to indicate the prosody feature of audio; extract the phoneme sequence corresponding to the text to be synthesized; expand the specified acoustic feature according to the phoneme sequence to obtain an acoustic feature sequence; combine the phoneme sequence, the acoustic feature sequence and the For the specified emotion type, input a pre-trained speech synthesis model to obtain the target audio output of the speech synthesis model, the text to be synthesized corresponds to the specified emotion type, and the acoustic characteristics of the target audio are the same as those of the target audio. Specifies the acoustic feature matching described above.
  • Computer program code for performing operations of the present disclosure may be written in one or more programming languages, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and This includes conventional procedural programming languages - such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider to via Internet connection).
  • LAN local area network
  • WAN wide area network
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
  • the modules involved in the embodiments of the present disclosure may be implemented in software or hardware.
  • the name of the module does not constitute a limitation of the module itself in some cases, for example, the acquisition module can also be described as "a module for acquiring text to be synthesized, specifying acoustic features and specifying emotion types".
  • exemplary types of hardware logic components include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chips (SOCs), Complex Programmable Logical Devices (CPLDs) and more.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs Systems on Chips
  • CPLDs Complex Programmable Logical Devices
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with the instruction execution system, apparatus or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), fiber optics, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.
  • Example 1 provides a speech synthesis method, including: acquiring text to be synthesized, specifying acoustic features, and specifying emotion types, where the specified acoustic features are used to indicate prosody features of audio; extracting The phoneme sequence corresponding to the text to be synthesized; the specified acoustic feature is expanded according to the phoneme sequence to obtain an acoustic feature sequence; the phoneme sequence, the acoustic feature sequence and the specified emotion type are input into pre-training to obtain the target audio output of the speech synthesis model, the text to be synthesized corresponds to the specified emotion type, and the acoustic features of the target audio match the specified acoustic features.
  • Example 2 provides the method of Example 1, wherein the extending the specified acoustic feature according to the phoneme sequence to obtain the acoustic feature sequence includes: according to the specified acoustic feature, Determine the acoustic feature corresponding to each phoneme in the phoneme sequence; and generate the acoustic feature sequence according to the acoustic feature corresponding to each phoneme.
  • Example 3 provides the method of Example 1, where the speech synthesis model is configured to: determine, according to the phoneme sequence, a text feature sequence corresponding to the text to be synthesized, the text feature sequence Including the text feature corresponding to each phoneme in the phoneme sequence; determining the specified emotion feature corresponding to the specified emotion type, and extending the specified emotion feature according to the phoneme sequence to obtain an emotion feature sequence; According to the text A feature sequence, the acoustic feature sequence, and the emotional feature sequence generate the target audio.
  • Example 4 provides the method of Example 1, wherein the specified acoustic characteristic includes at least one of fundamental frequency, volume, or speech rate.
  • Example 5 provides the method of Example 1, further comprising: extracting real acoustic features of the training audio corresponding to the training text, where the real acoustic features are used to indicate prosody features of the training audio ; Expand the real acoustic feature according to the training phoneme sequence corresponding to the training text to obtain the training acoustic feature sequence; The training emotion type corresponding to the training phoneme sequence, the training acoustic feature sequence and the training audio, The speech synthesis model is input, and the speech synthesis model is trained according to the output of the speech synthesis model and the training audio.
  • Example 6 provides the method of Example 5, wherein the real acoustic features include: at least one of fundamental frequency, volume, or speech rate; the extracting training audio corresponding to the training text
  • the real acoustic features include: if the real acoustic features include speech rate, determining the duration corresponding to each training phoneme in the training phoneme sequence according to the training audio and the training phoneme sequence, so as to determine the training phoneme sequence.
  • the speech rate of the audio if the real acoustic feature includes the fundamental frequency, extract the fundamental frequency of each audio frame included in the training audio to determine the fundamental frequency of the training audio; if the real acoustic feature includes the volume, extract the fundamental frequency of the training audio.
  • the volume of each audio frame included in the training audio is used to determine the volume of the training audio.
  • Example 7 provides the method of Example 6, wherein the duration corresponding to each training phoneme in the training phoneme sequence is determined according to the training audio and the training phoneme sequence, Determining the speech rate of the training audio includes: determining a duration corresponding to each training phoneme according to the training audio and the training phoneme sequence; performing a logarithmic operation on the duration corresponding to each training phoneme, to obtain the logarithmic duration corresponding to each of the training phonemes; take the statistical value of the logarithmic duration corresponding to each of the training phonemes in the training phoneme sequence as the speech rate of the training audio; the extracting the The fundamental frequency of each audio frame included in the training audio to determine the fundamental frequency of the training audio includes: performing a logarithmic operation on the fundamental frequency corresponding to each of the audio frames to obtain the corresponding fundamental frequency of each of the audio frames.
  • the logarithmic fundamental frequency; the statistical value of the logarithmic fundamental frequency corresponding to each of the audio frames in the training audio is used as the fundamental frequency of the training audio; the extraction of each audio frame included in the training audio volume, to determine the volume of the training audio, including: performing logarithmic operations on the volume corresponding to each of the audio frames to obtain the logarithmic volume corresponding to each of the audio frames; The statistical value of the logarithmic volume corresponding to the audio frame is used as the volume of the training audio.
  • Example 8 provides the method of Example 5, the speech synthesis model comprising a first module, a second module and a synthesis module, the training phoneme sequence, the training acoustic The feature sequence and the training emotion type corresponding to the training audio are input into the speech synthesis model, including: extracting, through the first module, a training text feature sequence corresponding to the training phoneme sequence, where the training text feature sequence includes all The text feature corresponding to each training phoneme in the training phoneme sequence; through the second module, extracting the training emotion feature corresponding to the training emotion type, and expanding the training emotion feature according to the training phoneme sequence to obtain training emotional feature sequences; through the synthesis module, the output of the speech synthesis model is generated according to the training text feature sequences, the training acoustic feature sequences and the training emotion feature sequences; the speech synthesis model is based on the The output of the speech synthesis model and the training audio, and training the speech synthesis model includes: determining the loss function of the speech synthesis model
  • Example 9 provides the methods of Examples 1 to 8, further comprising: inputting the phoneme sequence, the acoustic feature sequence and the specified emotion type into a pre-trained After the speech synthesis model outputted by the speech synthesis model, after the target audio with the specified emotion type corresponding to the text to be synthesized, update the specified acoustic feature according to the preset step value; repeat the execution Extending the specified acoustic feature according to the phoneme sequence to obtain an acoustic feature sequence, to the step of updating the specified acoustic feature according to a preset step value, until the target audio satisfies preset conditions .
  • Example 10 provides a speech synthesis apparatus, comprising: an acquisition module for acquiring text to be synthesized, a specified acoustic feature, and a specified emotion type, where the specified acoustic feature is used to indicate audio The prosodic feature of the rhythm; the extraction module is used to extract the phoneme sequence corresponding to the text to be synthesized; the expansion module is used to expand the specified acoustic feature according to the phoneme sequence to obtain the acoustic feature sequence; the synthesis module is used to The phoneme sequence, the acoustic feature sequence, and the specified emotion type are input into a pre-trained speech synthesis model to obtain the target output of the speech synthesis model, and the text to be synthesized corresponds to the specified emotion type audio, the acoustic feature of the target audio matches the specified acoustic feature.
  • an acquisition module for acquiring text to be synthesized, a specified acoustic feature, and a specified emotion type, where the specified acoustic feature is used to indicate
  • Example 11 provides a computer-readable medium having stored thereon a computer program that, when executed by a processing apparatus, implements the steps of the methods described in Examples 1 to 9.
  • Example 12 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 methods described in Examples 1 to 9.
  • Example 13 provides a computer program comprising: instructions that, when executed by a processor, cause the processor to perform the steps of the methods described in Examples 1 to 9 .

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • General Health & Medical Sciences (AREA)
  • Hospice & Palliative Care (AREA)
  • Psychiatry (AREA)
  • Child & Adolescent Psychology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Machine Translation (AREA)
  • Document Processing Apparatus (AREA)

Abstract

一种语音合成方法、装置、可读介质及电子设备,涉及电子信息处理技术领域,该方法包括:获取待合成文本、指定声学特征和指定情感类型(101),提取待合成文本对应的音素序列(102),将指定声学特征按照音素序列进行扩展,得到声学特征序列(103),将音素序列、声学特征序列和指定情感类型,输入预先训练的语音合成模型,以得到语音合成模型输出的,待合成文本对应的具有指定情感类型的目标音频(104)。

Description

语音合成方法、装置、可读介质及电子设备
相关申请的交叉引用
本申请是以CN申请号为202110075973.1,申请日为2021年1月20日的申请为基础,并主张其优先权,该CN申请的公开内容在此作为整体引入本申请中。
技术领域
本公开涉及电子信息处理技术领域,具体地,涉及一种语音合成方法、装置、可读介质及电子设备。
背景技术
随着电子信息处理技术的不断发展,语音作为人们获取信息的重要载体,已经被广泛应用于日常生活和工作中。涉及语音的应用场景中,通常会包括语音合成的处理。语音合成是指将用户指定的文本,合成为音频。语音合成过程中,可以通过指定的情感标签,来合成具有相应情感的语音。
发明内容
提供该发明内容部分以便以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。该发明内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。
第一方面,本公开提供一种语音合成方法,所述方法包括:
获取待合成文本、指定声学特征和指定情感类型,所述指定声学特征用于指示音频的韵律特征;
提取所述待合成文本对应的音素序列;
将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;
将所述音素序列、所述声学特征序列和所述指定情感类型,输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的具有所述指定情感类型的目标音频,所述目标音频的声学特征与所述指定声学特征匹配。
第二方面,本公开提供一种语音合成装置,所述装置包括:
获取模块,用于获取待合成文本、指定声学特征和指定情感类型,所述指定声学 特征用于指示音频的韵律特征;
提取模块,用于提取所述待合成文本对应的音素序列;
扩展模块,用于将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;
合成模块,用于将所述音素序列、所述声学特征序列和所述指定情感类型,输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的具有所述指定情感类型的目标音频,所述目标音频的声学特征与所述指定声学特征匹配。
第三方面,本公开提供一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现本公开第一方面所述方法的步骤。
第四方面,本公开提供一种电子设备,包括:
存储装置,其上存储有计算机程序;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现本公开第一方面所述方法的步骤。
第五方面,本公开提供一种计算机程序,包括:指令,所述指令当由处理器执行时使所述处理器执行第一方面中任一项所述方法的步骤。
第六方面,本公开提供一种计算机程序产品,包括指令,所述指令当由处理器执行时使所述处理器执行第一方面中任一项所述方法的步骤。
本公开的其他特征和优点将在随后的具体实施方式部分予以详细说明。
附图说明
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。在附图中:
图1是根据一示例性实施例示出的一种语音合成方法的流程图;
图2是根据一示例性实施例示出的另一种语音合成方法的流程图;
图3是根据一示例性实施例示出的一种语音合成模型的处理流程图;
图4是根据一示例性实施例示出的一种语音合成模型的框图;
图5是根据一示例性实施例示出的一种训练语音合成模型的流程图;
图6是根据一示例性实施例示出的另一种训练语音合成模型的流程图;
图7是根据一示例性实施例示出的另一种语音合成方法的流程图;
图8是根据一示例性实施例示出的一种语音合成装置的框图;
图9是根据一示例性实施例示出的另一种语音合成装置的框图;
图10是根据一示例性实施例示出的另一种语音合成装置的框图;
图11是根据一示例性实施例示出的一种电子设备的框图。
具体实施方式
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
在相关技术中,情感标签的类型有限,很难满足用户多样化的需求。本公开的一些实施例能够克服该问题。
图1是根据一示例性实施例示出的一种语音合成方法的流程图,如图1所示,该 方法包括步骤101-104。
步骤101,获取待合成文本、指定声学特征和指定情感类型,指定声学特征用于指示音频的韵律特征。
举例来说,首先获取需要进行合成的待合成文本。待合成文本例如可以是用户指定的文本文件中的一个或多个语句,也可以是文本文件中的一个或多个段落、一个或多个章节,还可以是一个文本文件中的一个或多个词语。文本文件例如可以是一部电子书,也可以是其他类型的文件,例如新闻、公众号文章、或博客等。同时,还可以获取指定声学特征和指定情感类型。指定声学特征和指定情感类型可以理解为用户指定的,用户期望将待合成文本合成为具有指定情感类型、且符合指定声学特征的音频(即后文提及的目标音频)。也就是说,用户可以通过指定声学特征和指定情感类型两个层面来控制目标音频。指定声学特征可以包括多个维度,例如可以包括基频(英文:Pitch)、音量(英文:Energy)、或语速(英文:Duration)中的一种或多种,还可以包括:噪声水平、音调、音色、或响度等。噪声水平可以理解为能够反映音频中噪声大小的特征。指定情感类型可以以标签的形式表示,例如开心对应0001,惊讶对应0011,憎恶对应1010,生气对应1011,害羞对应0101,恐惧对应0100,悲伤对应1000,不屑对应1001。
步骤102,提取待合成文本对应的音素序列。
示例的,可以将待合成文本输入预先训练的识别模型,以得到识别模型输出的,待合成文本对应的音素序列。也可以在预先建立的字典中,查找待合成文本中的每个字对应的音素,然后将每个字对应的音素组成待合成文本对应的音素序列。音素可以理解为根据每个字的发音划分出的语音单位,也可以理解为每个字对应的拼音中的元音和辅音。音素序列中,包括了待合成文本中每个字对应的音素(一个字可以对应一个或多个音素)。例如,待合成文本为“这是一个样例”,在中文中,可以依次在字典中查找每个字对应的音素,从而确定音素序列为“zheshiyigeyangli”。
步骤103,将指定声学特征按照音素序列进行扩展,得到声学特征序列。
步骤104,将音素序列、声学特征序列和指定情感类型,输入预先训练的语音合成模型,以得到语音合成模型输出的、待合成文本对应的具有指定情感类型的目标音频,目标音频的声学特征与指定声学特征匹配。
示例的,在得到音素序列之后,可以按照音素序列,将指定声学特征进行扩展,得到声学特征序列。声学特征序列中,包括了音素序列中,每个音素对应的声学特征。 在一种实现方式中,可以根据音素序列的长度(即音素序列中包括的音素的数量),生成声学特征序列,其中每个音素对应的声学特征均为指定声学特征。在另一种实现方式中,也可以将指定声学特征作为平均值(或者标准差),按照预设的分布(例如高斯分布或者均匀分布),生成每个音素对应的声学特征。
之后,可以将音素序列、声学特征序列和指定情感类型作为预先训练的语音合成模型的输入,语音合成模型输出的即为待合成文本对应的、具有指定情感类型、且与指定声学特征匹配的目标音频。语音合成模型可以是预先训练的,可以理解成一种TTS(英文:Text To Speech,中文:从文本到语音)模型,能够根据待合成文本、指定声学特征、指定情感类型,生成待合成文本对应的,具有指定情感类型,且与指定声学特征匹配的目标音频。具体的,语音合成模型可以是基于Tacotron模型、Deepvoice 3模型、Tacotron 2模型、Wavenet模型等训练得到的,本公开对此不作具体限定。这样,在对待合成文本中进行语音合成的过程中,除了待合成文本中包括的语义,还考虑了指定声学特征和指定情感类型,能够使目标音频具有指定情感类型,且与指定声学特征匹配,使得用户可以根据具体需求,从情感类型和声学特征两个维度对语音合成进行控制,而不限于情感类型的数量,提高了目标音频的表现力,同时也改善了用户的听觉体验。
综上所述,本公开首先获取待合成文本、指定情感类型、和用于指示音频的韵律特征的指定声学特征,之后从待合成文本中,提取出对应的音素序列,再按照音素序列,将指定声学特征进行扩展,得到声学特征序列,最后将音素序列、声学特征序列和指定情感类型输入预先训练的语音合成模型,从而得到语音合成模型输出的待合成文本对应的具有指定情感类型,且与指定声学特征匹配的目标音频。本公开通过指定声学特征和指定情感类型来控制文本的语音合成,使得语音合成模型输出的目标音频能够在具有指定情感类型的基础上,符合指定声学特征,能够实现语音合成过程中情感类型和声学特征两个维度的显性控制,提高了目标音频的表现力。
图2是根据一示例性实施例示出的另一种语音合成方法的流程图,如图2所示,步骤103可以通过以下方式来实现:
步骤1031,根据指定声学特征,确定音素序列中每个音素对应的声学特征;
步骤1032,根据每个音素对于的声学特征,生成声学特征序列。
例如,将每个音素对应的声学特征组成声学特征序列。
示例的,在一种实现方式中,可以先确定音素序列的长度,即音素序列中包括的 音素的数量。然后对指定声学特征进行复制,得到一个与音素序列的长度相同的声学特征序列,其中,每个声学特征都与指定声学特征相同,也就是说,声学特征序列中每个音素对应的声学特征均为指定声学特征。例如,音素序列的长度为100(即其中包括100个音素),该音素序列中每个音素对应的声学特征都确定为指定声学特征,那么可以将100个音素对应的声学特征组成声学特征序列。以指定声学特征为1*5维的向量来举例,那么声学特征序列包括100个1*5维的向量,可以组成100*5维的向量。
图3是根据一示例性实施例示出的一种语音合成模型的处理流程图,如图3所示,语音合成模型可以用于执行以下步骤:
步骤A,根据音素序列确定待合成文本对应的文本特征序列,文本特征序列包括音素序列中每个音素对应的文本特征;
步骤B,确定指定情感类型对应的指定情感特征,并将指定情感特征按照音素序列进行扩展,得到情感特征序列;
步骤C,根据文本特征序列、声学特征序列和情感特征序列,生成目标音频。
举例来说,在语音合成模型合成目标音频的具体过程中,可以先根据音素序列,提取待合成文本对应的文本特征序列(即Text Embedding),文本特征序列中包括了音素序列中每个音素对应的文本特征,文本特征可以理解为能够表征该音素的文本向量。例如,音素序列中包括100个音素,每个音素对应的文本向量为1*80维的向量,那么文本特征序列可以为100*80维的向量。
之后,可以根据指定情感类型,确定对应的指定情感特征,指定情感特征可以理解为能够表征指定情感类型的情感向量。具体的,语音合成模型可以包括一个查找表(英文:Lookup Table),查找表可以将指定情感类型对应的标签,映射成一个多维度的情感向量。例如,指定情感类型为害羞,对应的标签为0101,那么查找表可以将0101映射为一个1*50维的情感向量,作为用于表征开心的指定情感特征。在另一些实施例中,语音合成模型中可以包括一个编码器(即图4中的第二编码器),该编码器可以根据指定情感类型,提取对应的情感向量,即根据不同的情感类型,获得能够表征该情感类型的情感向量。该编码器可以是预先根据大量的训练样本独立训练的,也可以是和语音合成模型联合训练得到的,本公开对此不作具体限定。进一步的,在得到指定情感类型对应的指定情感特征之后,还可以将指定情感特征按照音素序列进行扩展,得到情感特征序列,情感特征序列中,包括了音素序列中,每个音素对应的 情感特征。例如,可以先确定音素序列的长度,即音素序列中包括的音素的数量。然后对指定情感特征进行复制,得到一个与音素序列的长度相同的情感特征序列,其中,每个情感特征都与指定情感特征相同,也就是说,情感特征序列中每个音素对应的情感特征均为指定情感特征。例如,音素序列的长度为100(即其中包括100个音素),那么可以将每个音素对应的情感特征都确定为指定情感特征,那么可以将100个音素对应的情感特征组成情感特征序列。以指定情感特征为1*50维的向量来举例,那么情感特征序列包括100个1*50维的向量,可以组成100*50维的向量。
在获得文本特征序列、情感特征序列之后,可以将文本特征序列、情感特征序列与声学特征序列进行结合,以生成具有指定情感类型,且与指定声学特征匹配的目标音频。例如,可以将文本特征序列、情感特征序列与声学特征序列进行拼接,得到一个组合序列,然后根据组合序列生成目标音频。例如,音素序列中包括100个音素,文本特征序列可以为100*80维的向量,相应的情感特征序列为100*50维的向量,声学特征序列为100*5维的向量,那么组合序列可以为100*135维的向量。可以根据这个100*135维的向量,生成目标音频。
以图4所示的语音合成模型来举例,语音合成模型为Tacotron模型,其中包括:查找表(或者第二编码器)、第一编码器(即Encoder)、注意力网络(即Attention)、解码器(即Decoder)和后处理网络(即Post-processing)。查找表例如可以是一个预设的矩阵,可以将指定情感类型对应的标签与查找表相乘,从而将指定情感类型对应的标签映射为指定情感特征,并将指定情感特征进行扩展,得到情感特征序列。第一编码器可以包括嵌入层(即Character Embedding层)、预处理网络(Pre-net)子模型和CBHG(英文:Convolution Bank+Highway network+bidirectional Gated Recurrent Unit,中文:卷积层+高速网络+双向递归神经网络)子模型。可以将音素序列输入第一编码器。首先,通过嵌入层将音素序列转换为词向量,然后将词向量输入至Pre-net子模型,以对词向量进行非线性变换,从而提升语音合成模型的收敛和泛化能力,最后,通过CBHG子模型根据非线性变换后的词向量,获得能够表征待合成文本的文本特征序列。
之后可以将声学特征序列、查找表输出的情感特征序列和编码器输出的文本特征序列进行拼接,得到组合序列,再将组合序列输入注意力网络,注意力网络可以为组合序列中的每个元素增加一个注意力权重。具体的,注意力网络可以为位置敏感注意力(英文:Locative Sensitive Attention)网络,也可以为GMM(英文:Gaussian Mixture  Model,缩写GMM)attention网络,还可以是Multi-Head Attention网络,本公开对此不作具体限定。
再将注意力网络的输出作为解码器的输入。解码器可以包括预处理网络子模型(可以与编码器中包括的预处理网络子模型的相同)、Attention-RNN、Decoder-RNN。预处理网络子模型用于对输入进行非线性变换,Attention-RNN的结构为一层单向的、基于zoneout的LSTM(英文:Long Short-Term Memory,中文:长短期记忆网络),能够将预处理网络子模型的输出作为输入,经过LSTM单元后输出到Decoder-RNN中。Decode-RNN为两层单向的、基于zoneout的LSTM,经过LSTM单元输出梅尔频谱信息,梅尔频谱信息中可以包括一个或多个梅尔频谱特征。最后将梅尔频谱信息输入后处理网络,后处理网络可以包括声码器(例如,Wavenet声码器、Griffin-Lim声码器等),用于对梅尔频谱特征信息进行转换,以得到目标音频。
图5是根据一示例性实施例示出的一种训练语音合成模型的流程图,如图5所示,上述语音合成模型是通过如下方式训练获得的:
步骤D,提取训练文本对应的训练音频的真实声学特征,真实声学特征用于指示音频的韵律特征;
步骤E,将真实声学特征按照训练文本对应的训练音素序列进行扩展,得到训练声学特征序列;
步骤F,将训练音素序列、训练声学特征序列和训练音频对应的训练情感类型,输入语音合成模型,并根据语音合成模型的输出与训练音频,训练语音合成模型。
对语音合成模型进行训练,需要先获取训练文本和训练文本对应的训练音频,训练文本可以有多个,相应的,训练音频也有多个。例如可以通过在互联网上抓取大量的文本作为训练文本,然后将训练文本对应的音频,作为训练音频。针对训练音频,可以提取训练音频对应的真实声学特征。例如,可以通过信号处理、标注等方式,得到训练音频对应的真实声学特征,其中,真实声学特征用于指示训练音频的韵律特征,可以包括:训练音频的基频、音量、或语速中的至少一种,还可以包括:噪声水平、音调、音色、或响度等。同时,还可以提取训练文本对应的训练音素序列,训练音素序列中,可以包括训练文本中每个字对应的训练音素(一个字可以对应一个或多个训练音素)。
之后,将真实声学特征按照训练文本对应的训练音素序列进行扩展,得到训练声学特征序列。训练声学特征序列中包括了每个训练音素对应的训练声学特征。例如, 可以根据训练音素序列中包括的训练音素的数量,生成训练声学特征序列,其中,每个训练音素对应的训练声学特征均为真实声学特征。
最后,将训练音素序列、训练声学特征序列和训练音频对应的训练情感类型,作为语音合成模型的输入,并根据语音合成模型的输出与训练音频,训练语音合成模型。例如,可以根据语音合成模型的输出,与训练音频的差(或者均方差)作为语音合成模型的损失函数,以降低损失函数为目标,利用反向传播算法来修正语音合成模型中的神经元的参数,神经元的参数例如可以是神经元的权重(英文:Weight)和偏置量(英文:Bias)。重复上述步骤,直至损失函数满足预设条件,例如损失函数小于预设的损失阈值。
在一些实施例中,语音合成模型包括:第一模块、第二模块和合成模块,步骤F的实现可以包括以下步骤:
步骤F1,通过第一模块,提取训练音素序列对应的训练文本特征序列,训练文本特征序列包括训练音素序列中每个训练音素对应的文本特征;
步骤F2,通过第二模块,提取训练情感类型对应的训练情感特征,并将训练情感特征按照训练音素序列进行扩展,得到训练情感特征序列;
步骤F3,通过合成模块,根据训练文本特征序列、训练声学特征序列和训练情感特征序列,生成语音合成模型的输出;
步骤F4,根据语音合成模型的输出与训练音频,确定语音合成模型的损失函数,并根据损失函数更新第一模块、第二模块和合成模块。
举例来说,语音合成模型中可以包括第一模块、第二模块和合成模块,其中,第一模块用于提取训练文本特征序列,其中包括训练音素序列中每个训练音素对应的文本特征,第一模块例如可以是编码器(如图4中所示的第一编码器)。第二模块用于提取训练情感特征,并对训练情感特征进行扩展,得到包括了每个训练音素对应的情感特征的情感特征序列,第二模块例如可以是查找表,也可以是编码器(如图4中所示的第二编码器)。合成模块用于根据训练文本特征序列、训练声学特征序列和训练情感特征序列,生成对应的音频,即语音合成模型的输出。
进一步的,在对语音合成模型的训练过程中,可以根据语音合成模型的输出与训练音频,确定语音合成模型的损失函数(例如可以是语音合成模型的输出,与训练音频的差),以降低损失函数为目标,利用反向传播算法来更新语音合成模型中的第一模块、第二模块和合成模块。需要说明的是,若第二模块为查找表,那么在训练语音 合成模型的过程中,可以同时对查找表进行更新,若第二模块为编码器,那么在训练语音合成模型的过程中,可以同时对该编码器中的神经元的参数进行更新。
图6是根据一示例性实施例示出的另一种训练语音合成模型的流程图,如图6所示,真实声学特征包括:基频、音量、或语速中的至少一种,步骤D可以包括以下步骤:
步骤D1,若真实声学特征中包括语速,根据训练音频和训练音素序列,确定训练音素序列中,每个训练音素对应的时长,以确定训练音频的语速。
具体的实现方式可以包括:
首先,根据训练音频和训练音素序列,确定每个训练音素对应的时长。例如,可以利用HTS(英文:HMM-based Speech Synthesis System),将训练音频,按照训练音素序列中包括的训练音素进行划分,以得到每个训练音素对应的时长,可以表示为durationi,表示第i个训练音素对应的时长。
之后,对每个训练音素对应的时长进行对数运算,以得到每个训练音素对应的对数时长,通过对数运算,可以将时长的变化范围进行压缩,从而放大时长的变化程度。例如可以表示为log_durationi,表示第i个训练音素对应的对数时长。
最后,将训练音素序列中每个训练音素对应的对数时长的统计值,作为训练音频的语速。例如可以将每个训练音素对应的对数时长的平均值(或者标准差、极值等)作为训练音频的语速,可以表示为log_duration_mean。
步骤D2,若真实声学特征中包括基频,提取训练音频包括的每个音频帧的基频,以确定训练音频的基频。
具体的实现方式可以包括步骤D1-D3。
首先,可以利用sox、librosa、straight等音频处理工具,对训练音频进行处理,以得到训练音频中每个音频的基频,然后对每个音频帧对应的基频进行对数运算,以得到每个音频帧对应的对数基频。通过对数运算,可以将基频的变化范围进行压缩,从而放大基频的变化程度。例如每个音频帧对应的基频可以表示为pitchj,表示第j个音频帧对应的基频,相应的,第j个音频帧对应的对数基频可以表示为log_pitchj。
之后,将训练音频中每个音频帧对应的对数基频的统计值,作为训练音频的基频。例如可以将每个音频帧对应的对数基频的平均值和对数基频的标准差,作为训练音频的基频。该平均值可以表示为log_pitch_mean,能够反映训练音频整体上基频的大小。该标准差可以表示为log_pitch_std,能够反映训练音频的基频的变化幅度。
步骤D3,若真实声学特征中包括音量,提取训练音频包括的每个音频帧的音量,以确定训练音频的音量。
首先,可以利用sox、librosa、straight等音频处理工具,对训练音频进行处理,以得到训练音频中每个音频的音量,然后对每个音频帧对应的音量进行对数运算,以得到每个音频帧对应的对数音量。通过对数运算,可以将音量的变化范围进行压缩,从而放大音量的变化程度。例如,每个音频帧对应的音量可以表示为energyj,表示第j个音频帧对应的音量。相应的,第j个音频帧对应的对数音量可以表示为log_energyj。
然后,将每个音频帧对应的对数音量的统计值,作为训练音频的音量。例如,可以将每个音频帧对应的对数音量的平均值作为训练音频的音量,可以表示为log_energy_mean。
进一步,若真实声学特征还包括噪声水平,那么步骤D还可以包括:根据训练音频对应的线性预测系数,确定训练音频对应的噪声水平。
示例的,可以确定训练音频的LPC系数(英文:Linear Prediction Coefficient,中文:线性预测系数),然后对训练音频的LPC系数的第1维进行对数运算,并将对数运算的结果作为训练音频对应的噪声水平。通过对数运算,可以将噪声水平的变化范围进行压缩,从而放大噪声水平的变化程度。噪声水平例如可以表示为log_spectral_tilt。
在真实声学特征中包括了基频、音量、语速和噪声水平的情况下,可以根据训练音频的基频、音量、语速和噪声水平,生成训练音频的真实声学特征。例如,将训练音频的基频、音量、语速和噪声水平,组成训练音频的真实声学特征。例如,真实声学特征可以是一个1*5维的向量:{基频:(log_pitch_mean,log_pitch_std),音量:log_energy_mean,语速:log_duration_mean,噪声水平:log_spectral_tilt}。相应的,在指定声学特征包括了基频、音量、语速和噪声水平的情况下,步骤101中获取的指定声学特征,也可以包括上述5个维度。
在另一些实施例中,语音合成模型还可以是通过如下方式训练获得的:
步骤G,根据预设的训练集中包括多个训练音频的真实声学特征,确定训练集的统计声学特征;
步骤H,根据统计声学特征对每个训练音频的真实声学特征进行归一化处理。
相应的,步骤E的实现方式可以为:
将归一化处理后的真实声学特征,按照训练音素序列进行扩展,得到训练声学特 征序列。
举例来说,在对真实声学特征进行扩展之前,还可以对真实声学特征进行归一化处理。例如,训练集中包括多个训练文本,每个训练文本对应一个训练音频。可以按照步骤D1至D4的方式,确定每个训练音频的真实声学特征,并确定训练集的统计声学特征。统计声学特征例如可以是真实声学特征的平均值、标准差、方差或者极值等。然后再根据统计声学特征对每个训练音频的真实声学特征进行归一化处理。例如,可以将真实声学特征的平均值μ和标准差σ,作为统计声学特征,然后将处于[μ-3σ,μ+3σ]之间的真实声学特征,映射到[-1,1]内,处于[μ-3σ,μ+3σ]之外的真实声学特征,可以截断为-1或1。还可以分别求得真实声学特征中每个维度的平均值和标准差,并对真实声学特征中每个维度进行归一化处理。例如,以真实声学特征中的log_pitch_mean来举例,可以求得每个训练音频的log_pitch_mean的平均值pitch_μ和标准差pitch_σ,然后将处于[pitch_μ-3pitch_σ,pitch_μ+3pitch_σ]之间的log_pitch_mean,映射到[-1,1]内,将处于[pitch_μ-3pitch_σ,pitch_μ+3pitch_σ]之外的log_pitch_mean,截断为-1或1,以对log_pitch_mean进行归一化处理。
进一步的,可以将归一化处理后的真实声学特征,按照训练音素序列进行扩展,得到训练声学特征序列。例如,可以根据训练音素序列中包括的训练音素的数量,生成训练声学特征序列,其中,每个训练音素对应的训练声学特征均为归一化处理后的真实声学特征。
需要说明的是,步骤101中获取的指定声学特征,也可以包括上述经过归一化处理的5个维度。归一化处理后的指定声学特征,更具有解释性。以指定声学特征为{-1,1,0,1,0}为例,其中,log_pitch_mean的值为-1,那么表示语音合成模型生成的,符合指定声学特征的目标音频的特点是低沉。log_pitch_std的值为1,表示目标音频的基频变化大。log_energy_mean的值为0,表示目标音频是正常音量。log_duration_mean对应的值为1,表示目标音频的语速慢(即音素对应的平均时长长)。log_spectral_tilt对应的值为0,表示目标音频的噪声水平为正常。
图7是根据一示例性实施例示出的另一种语音合成方法的流程图,如图7所示,除了步骤101-104以外,在步骤104之后,该方法还包括:
步骤105,根据预设的步进值,更新指定声学特征。
重复执行步骤103至步骤105,直至目标音频满足预设条件。
举例来说,在用户对语音合成进行控制时,期望的情感类型(即指定情感类型) 往往比较明确,例如期望生成的目标音频具有开心的情感。而期望的声学特征往往只是一个大致的范围。因此可以在语音合成模型输出一次目标音频后,根据用户的具体需求,设置用于更新指定声学特征的步进值,然后利用步进值对指定声学特征进行更新,并按照更新后的指定声学特征重复执行步骤103至步骤105,直至目标音频满足预设条件。预设条件可以是用户收听目标音频时,认为满足需求后触发的停止指令;预设条件还可以是重复执行步骤103至步骤105的次数达到了指定次数(例如5次)。例如,步骤101中获取的指定情感类型为开心,指定声学特征为{0,0,0,0,0},即基频、音量、语速和噪声水平均为平均水平。那么第一次执行步骤103至步骤104时,生成的目标音频具有开心的情感类型,并且目标音频的基频为平均水平、音量为正常、语速为正常,且噪声水平为正常。用户收听目标音频后,认为语速较慢,可以设置步进值为{0,0,0,-0.5,0},并将步进值和指定声学特征相加,得到更新后的指定声学特征{0,0,0,-0.5,0},重复上述过程,直至接收到用户认为目标音频满足需求后触发的停止指令。
综上所述,本公开首先获取待合成文本、指定情感类型,和用于指示音频的韵律特征的指定声学特征;之后从待合成文本中,提取出对应的音素序列;再按照音素序列,将指定声学特征进行扩展,得到声学特征序列;最后将音素序列、声学特征序列和指定情感类型输入预先训练的语音合成模型,从而得到语音合成模型输出的待合成文本对应的具有指定情感类型,且与指定声学特征匹配的目标音频。本公开通过指定声学特征和指定情感类型来控制文本的语音合成,使得语音合成模型输出的目标音频能够在具有指定情感类型的基础上,符合指定声学特征,能够实现语音合成过程中情感类型和声学特征两个维度的显性控制,提高了目标音频的表现力。
图8是根据一示例性实施例示出的一种语音合成装置的框图,如图8所示,该装置200包括:
获取模块201,用于获取待合成文本、指定声学特征和指定情感类型,指定声学特征用于指示音频的韵律特征;
提取模块202,用于提取待合成文本对应的音素序列;
扩展模块203,用于将指定声学特征按照音素序列进行扩展,得到声学特征序列;
合成模块204,用于将音素序列、声学特征序列和指定情感类型,输入预先训练的语音合成模型,以得到语音合成模型输出的,待合成文本对应的具有指定情感类型的目标音频,目标音频的声学特征与指定声学特征匹配。
在一些实施例中,指定声学特征包括:基频、音量、或语速中的至少一种。
图9是根据一示例性实施例示出的另一种语音合成装置的框图,如图9所示,扩展模块203可以包括:
确定子模块2031,用于根据指定声学特征,确定音素序列中每个音素对应的声学特征;
扩展子模块2032,用于将每个音素对应的声学特征组成声学特征序列。
在一些实施例中,语音合成模型可以用于执行以下步骤:
步骤A,根据音素序列确定待合成文本对应的文本特征序列,文本特征序列包括音素序列中每个音素对应的文本特征;
步骤B,确定指定情感类型对应的指定情感特征,并将指定情感特征按照音素序列进行扩展,得到情感特征序列;
步骤C,根据文本特征序列、声学特征序列和情感特征序列,生成目标音频;
在另一些实施例中,上述语音合成模型是通过如下方式训练获得的:
步骤D,提取训练文本对应的训练音频的真实声学特征,真实声学特征用于指示训练音频的韵律特征;
步骤E,将真实声学特征按照训练文本对应的训练音素序列进行扩展,得到训练声学特征序列;
步骤F,将训练音素序列、训练声学特征序列和训练音频对应的训练情感类型,输入语音合成模型,并根据语音合成模型的输出与训练音频,训练语音合成模型。
在另一些实施例中,音合成模型包括:第一模块、第二模块和合成模块,步骤F的实现可以包括以下步骤:
步骤F1,通过第一模块,提取训练音素序列对应的训练文本特征序列,训练文本特征序列包括训练音素序列中每个训练音素对应的文本特征;
步骤F2,通过第二模块,提取训练情感类型对应的训练情感特征,并将训练情感特征按照训练音素序列进行扩展,得到训练情感特征序列;
步骤F3,通过合成模块,根据训练文本特征序列、训练声学特征序列和训练情感特征序列,生成语音合成模型的输出;
步骤F4,根据语音合成模型的输出与训练音频,确定语音合成模型的损失函数,并根据损失函数更新第一模块、第二模块和合成模块。
在又一种应用场景中,真实声学特征包括:基频、音量、或语速中的至少一种, 步骤D可以包括以下步骤:
步骤D1,若真实声学特征中包括语速,根据训练音频和训练音素序列,确定训练音素序列中,每个训练音素对应的时长,以确定训练音频的语速。
首先,根据训练音频和训练音素序列,确定每个训练音素对应的时长。
之后,对每个训练音素对应的时长进行对数运算,以得到每个训练音素对应的对数时长。
最后,将训练音素序列中每个训练音素对应的对数时长的统计值,作为训练音频的语速。
步骤D2,若真实声学特征中包括基频,提取训练音频包括的每个音频帧的基频,以确定训练音频的基频。
首先,对每个音频帧对应的基频进行对数运算,以得到每个音频帧对应的对数基频。
之后,将训练音频中每个音频帧对应的对数基频的统计值,作为训练音频的基频。
步骤D3,若真实声学特征中包括音量,提取训练音频包括的每个音频帧的音量,以确定训练音频的音量。
首先,对每个音频帧对应的音量进行对数运算,以得到每个音频帧对应的对数音量。
之后,并将每个音频帧对应的对数音量的统计值,作为训练音频的音量。
图10是根据一示例性实施例示出的另一种语音合成装置的框图,如图10所示,该装置200还可以包括:
更新模块205,用于在将音素序列、声学特征序列和指定情感类型,输入预先训练的语音合成模型,以得到语音合成模型输出的,待合成文本对应的具有指定情感类型的目标音频之后,根据预设的步进值,更新指定声学特征。
重复执行将指定声学特征按照音素序列进行扩展,得到声学特征序列,至根据预设的步进值,更新指定声学特征的步骤,直至目标音频满足预设条件。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
综上所述,本公开首先获取待合成文本、指定情感类型,和用于指示音频的韵律特征的指定声学特征,之后从待合成文本中,提取出对应的音素序列,再按照音素序列,将指定声学特征进行扩展,得到声学特征序列,最后将音素序列、声学特征序列 和指定情感类型输入预先训练的语音合成模型,从而得到语音合成模型输出的待合成文本对应的具有指定情感类型,且与指定声学特征匹配的目标音频。本公开通过指定声学特征和指定情感类型来控制文本的语音合成,使得语音合成模型输出的目标音频能够在具有指定情感类型的基础上,符合指定声学特征,能够实现语音合成过程中情感类型和声学特征两个维度的显性控制,提高了目标音频的表现力。
下面参考图11,其示出了适于用来实现本公开实施例的电子设备((即上述语音合成方法的执行主体))300的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图11示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图11所示,电子设备300可以包括处理装置(例如中央处理器、图形处理器等)301,其可以根据存储在只读存储器(ROM)302中的程序或者从存储装置308加载到随机访问存储器(RAM)303中的程序而执行各种适当的动作和处理。在RAM 303中,还存储有电子设备300操作所需的各种程序和数据。处理装置301、ROM 302以及RAM 303通过总线304彼此相连。输入/输出(I/O)接口305也连接至总线304。
通常,以下装置可以连接至I/O接口305:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置306;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置307;包括例如磁带、硬盘等的存储装置308;以及通信装置309。通信装置309可以允许电子设备300与其他设备进行无线或有线通信以交换数据。虽然图11示出了具有各种装置的电子设备300,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置309从网络上被下载和安装,或者从存储装置308被安装,或者从ROM 302被安装。在该计算机程序被处理装置301执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是—— 但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,终端设备、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取待合成文本、指定声学特征和指定情感类型,所述指定声学特征用于指示音频的韵律特征;提取所述待合成文本对应的音素序列;将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;将所述音素序列、所述声学特征序列和所述指定情感类型,输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的具有所述指定情感类型的目标音频,所述目标音频的声学特征与所述指定声学特征匹配。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、 Smalltalk、C++,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定,例如,获取模块还可以被描述为“获取待合成文本、指定声学特征和指定情感类型的模块”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储 器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,示例1提供了一种语音合成方法,包括:获取待合成文本、指定声学特征和指定情感类型,所述指定声学特征用于指示音频的韵律特征;提取所述待合成文本对应的音素序列;将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;将所述音素序列、所述声学特征序列和所述指定情感类型,输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的具有所述指定情感类型的目标音频,所述目标音频的声学特征与所述指定声学特征匹配。
根据本公开的一个或多个实施例,示例2提供了示例1的方法,所述将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列,包括:根据所述指定声学特征,确定所述音素序列中每个音素对应的声学特征;根据每个所述音素对应的所述声学特征,生成所述声学特征序列。
根据本公开的一个或多个实施例,示例3提供了示例1的方法,所述语音合成模型用于:根据所述音素序列确定所述待合成文本对应的文本特征序列,所述文本特征序列包括所述音素序列中每个音素对应的文本特征;确定所述指定情感类型对应的指定情感特征,并将所述指定情感特征按照所述音素序列进行扩展,得到情感特征序列;根据所述文本特征序列、所述声学特征序列和所述情感特征序列,生成所述目标音频。
根据本公开的一个或多个实施例,示例4提供了示例1的方法,所述指定声学特征包括:基频、音量、或语速中的至少一种。
根据本公开的一个或多个实施例,示例5提供了示例1的方法,还包括:提取训练文本对应的训练音频的真实声学特征,所述真实声学特征用于指示所述训练音频的韵律特征;将所述真实声学特征按照所述训练文本对应的训练音素序列进行扩展,得到训练声学特征序列;将所述训练音素序列、所述训练声学特征序列和所述训练音频对应的训练情感类型,输入所述语音合成模型,并根据所述语音合成模型的输出与所述训练音频,训练所述语音合成模型。
根据本公开的一个或多个实施例,示例6提供了示例5的方法,所述真实声学特征包括:基频、音量、或语速中的至少一种;所述提取训练文本对应的训练音频的真实声学特征,包括:若所述真实声学特征包括语速,根据所述训练音频和所述训练音素序列,确定所述训练音素序列中,每个训练音素对应的时长,以确定所述训练音频的语速;若所述真实声学特征包括基频,提取所述训练音频包括的每个音频帧的基频, 以确定所述训练音频的基频;若所述真实声学特征包括音量,提取所述训练音频包括的每个音频帧的音量,以确定所述训练音频的音量。
根据本公开的一个或多个实施例,示例7提供了示例6的方法,所述根据所述训练音频和所述训练音素序列,确定所述训练音素序列中,每个训练音素对应的时长,以确定所述训练音频的语速,包括:根据所述训练音频和所述训练音素序列,确定每个所述训练音素对应的时长;对每个所述训练音素对应的时长进行对数运算,以得到每个所述训练音素对应的对数时长;将所述训练音素序列中每个所述训练音素对应的对数时长的统计值,作为所述训练音频的语速;所述提取所述训练音频包括的每个音频帧的基频,以确定所述训练音频的基频,包括:对每个所述音频帧对应的基频进行对数运算,以得到每个所述音频帧对应的对数基频;将所述训练音频中每个所述音频帧对应的对数基频的统计值,作为所述训练音频的基频;所述提取所述训练音频包括的每个音频帧的音量,以确定所述训练音频的音量,包括:对每个所述音频帧对应的音量进行对数运算,以得到每个所述音频帧对应的对数音量;将所述训练音频中每个所述音频帧对应的对数音量的统计值,作为所述训练音频的音量。
根据本公开的一个或多个实施例,示例8提供了示例5的方法,所述语音合成模型包括第一模块、第二模块和合成模块,所述将所述训练音素序列、所述训练声学特征序列和所述训练音频对应的训练情感类型,输入所述语音合成模型,包括:通过所述第一模块,提取所述训练音素序列对应的训练文本特征序列,所述训练文本特征序列包括所述训练音素序列中每个训练音素对应的文本特征;通过所述第二模块,提取所述训练情感类型对应的训练情感特征,并将所述训练情感特征按照所述训练音素序列进行扩展,得到训练情感特征序列;通过所述合成模块,根据所述训练文本特征序列、所述训练声学特征序列和所述训练情感特征序列,生成所述语音合成模型的输出;所述根据所述语音合成模型的输出与所述训练音频,训练所述语音合成模型,包括:根据所述语音合成模型的输出与所述训练音频,确定所述语音合成模型的损失函数,并根据所述损失函数更新所述第一模块、所述第二模块和所述合成模块。
根据本公开的一个或多个实施例,示例9提供了示例1至示例8的方法,还包括:在所述将所述音素序列、所述声学特征序列和所述指定情感类型,输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的具有所述指定情感类型的目标音频之后,根据预设的步进值,更新所述指定声学特征;重复执行所述将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列,至所述根据 预设的步进值,更新所述指定声学特征的步骤,直至所述目标音频满足预设条件。
根据本公开的一个或多个实施例,示例10提供了一种语音合成装置,包括:获取模块,用于获取待合成文本、指定声学特征和指定情感类型,所述指定声学特征用于指示音频的韵律特征;提取模块,用于提取所述待合成文本对应的音素序列;扩展模块,用于将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;合成模块,用于将所述音素序列、所述声学特征序列和所述指定情感类型,输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的具有所述指定情感类型的目标音频,所述目标音频的声学特征与所述指定声学特征匹配。
根据本公开的一个或多个实施例,示例11提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现示例1至示例9中所述方法的步骤。
根据本公开的一个或多个实施例,示例12提供了一种电子设备,包括:存储装置,其上存储有计算机程序;处理装置,用于执行所述存储装置中的所述计算机程序,以实现示例1至示例9中所述方法的步骤。
根据本公开的一个或多个实施例,示例13提供了一种计算机程序,包括:指令,所述指令当由处理器执行时使所述处理器执行示例1至示例9中所述方法的步骤。
根据本公开的一个或多个实施例,示例14提供了一种计算机程序产品,包括指令,所述指令当由处理器执行时使所述处理器执行示例1至示例9中所述方法的步骤。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反, 上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。

Claims (14)

  1. 一种语音合成方法,包括:
    获取待合成文本、指定声学特征和指定情感类型,所述指定声学特征用于指示音频的韵律特征;
    提取所述待合成文本对应的音素序列;
    将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;
    将所述音素序列、所述声学特征序列和所述指定情感类型,输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的具有所述指定情感类型的目标音频,所述目标音频的声学特征与所述指定声学特征匹配。
  2. 根据权利要求1所述的方法,其中,所述将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列,包括:
    根据所述指定声学特征,确定所述音素序列中每个音素对应的声学特征;
    根据每个所述音素对应的所述声学特征,生成所述声学特征序列。
  3. 根据权利要求1所述的方法,其中,所述语音合成模型用于:
    根据所述音素序列确定所述待合成文本对应的文本特征序列,所述文本特征序列包括所述音素序列中每个音素对应的文本特征;
    确定所述指定情感类型对应的指定情感特征,并将所述指定情感特征按照所述音素序列进行扩展,得到情感特征序列;
    根据所述文本特征序列、所述声学特征序列和所述情感特征序列,生成所述目标音频。
  4. 根据权利要求1所述的方法,其中,所述指定声学特征包括:基频、音量、或语速中的至少一种。
  5. 根据权利要求1所述的方法,还包括:
    提取训练文本对应的训练音频的真实声学特征,所述真实声学特征用于指示所述训练音频的韵律特征;
    将所述真实声学特征按照所述训练文本对应的训练音素序列进行扩展,得到训练声学特征序列;
    将所述训练音素序列、所述训练声学特征序列和所述训练音频对应的训练情感类型,输入所述语音合成模型,并根据所述语音合成模型的输出与所述训练音频,训练所述语音合成模型。
  6. 根据权利要求5所述的方法,其中,所述真实声学特征包括基频、音量、或语速中的至少一种;并且,所述提取训练文本对应的训练音频的真实声学特征,包括:
    若所述真实声学特征包括语速,根据所述训练音频和所述训练音素序列,确定所述训练音素序列中,每个训练音素对应的时长,以确定所述训练音频的语速;
    若所述真实声学特征包括基频,提取所述训练音频包括的每个音频帧的基频,以确定所述训练音频的基频;
    若所述真实声学特征包括音量,提取所述训练音频包括的每个音频帧的音量,以确定所述训练音频的音量。
  7. 根据权利要求6所述的方法,其中,
    所述根据所述训练音频和所述训练音素序列,确定所述训练音素序列中,每个训练音素对应的时长,以确定所述训练音频的语速,包括:
    根据所述训练音频和所述训练音素序列,确定每个所述训练音素对应的时长;
    对每个所述训练音素对应的时长进行对数运算,以得到每个所述训练音素对应的对数时长;
    将所述训练音素序列中每个所述训练音素对应的对数时长的统计值,作为所述训练音频的语速;
    所述提取所述训练音频包括的每个音频帧的基频,以确定所述训练音频的基频,包括:
    对每个所述音频帧对应的基频进行对数运算,以得到每个所述音频帧对应的对数基频;
    将所述训练音频中每个所述音频帧对应的对数基频的统计值,作为所述训练音频的基频;
    所述提取所述训练音频包括的每个音频帧的音量,以确定所述训练音频的音量, 包括:
    对每个所述音频帧对应的音量进行对数运算,以得到每个所述音频帧对应的对数音量;
    将所述训练音频中每个所述音频帧对应的对数音量的统计值,作为所述训练音频的音量。
  8. 根据权利要求5所述的方法,其中,所述语音合成模型包括第一模块、第二模块和合成模块,并且所述将所述训练音素序列、所述训练声学特征序列和所述训练音频对应的训练情感类型,输入所述语音合成模型,包括:
    通过所述第一模块,提取所述训练音素序列对应的训练文本特征序列,所述训练文本特征序列包括所述训练音素序列中每个训练音素对应的文本特征;
    通过所述第二模块,提取所述训练情感类型对应的训练情感特征,并将所述训练情感特征按照所述训练音素序列进行扩展,得到训练情感特征序列;
    通过所述合成模块,根据所述训练文本特征序列、所述训练声学特征序列和所述训练情感特征序列,生成所述语音合成模型的输出;
    所述根据所述语音合成模型的输出与所述训练音频,训练所述语音合成模型,包括:
    根据所述语音合成模型的输出与所述训练音频,确定所述语音合成模型的损失函数,并根据所述损失函数更新所述第一模块、所述第二模块和所述合成模块。
  9. 根据权利要求1-8中任一项所述的方法,还包括:
    在所述将所述音素序列、所述声学特征序列和所述指定情感类型,输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的具有所述指定情感类型的目标音频之后,根据预设的步进值,更新所述指定声学特征;
    重复执行所述将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列,至所述根据预设的步进值,更新所述指定声学特征的步骤,直至所述目标音频满足预设条件。
  10. 一种语音合成装置,包括:
    获取模块,用于获取待合成文本、指定声学特征和指定情感类型,所述指定声学 特征用于指示音频的韵律特征;
    提取模块,用于提取所述待合成文本对应的音素序列;
    扩展模块,用于将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;
    合成模块,用于将所述音素序列、所述声学特征序列和所述指定情感类型,输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的具有所述指定情感类型的目标音频,所述目标音频的声学特征与所述指定声学特征匹配。
  11. 一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现权利要求1-9中任一项所述方法的步骤。
  12. 一种电子设备,包括:
    存储装置,其上存储有计算机程序;
    处理装置,用于执行所述存储装置中的所述计算机程序,以实现权利要求1-9中任一项所述方法的步骤。
  13. 一种计算机程序,包括:指令,所述指令当由处理器执行时使所述处理器执行根据权利要求1-9中任一项所述的方法。
  14. 一种计算机程序产品,包括指令,所述指令当由处理器执行时使所述处理器执行根据权利要求1-9中任一项所述的方法。
PCT/CN2022/070638 2021-01-20 2022-01-07 语音合成方法、装置、可读介质及电子设备 WO2022156544A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110075973.1A CN112786007B (zh) 2021-01-20 2021-01-20 语音合成方法、装置、可读介质及电子设备
CN202110075973.1 2021-01-20

Publications (1)

Publication Number Publication Date
WO2022156544A1 true WO2022156544A1 (zh) 2022-07-28

Family

ID=75757375

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/070638 WO2022156544A1 (zh) 2021-01-20 2022-01-07 语音合成方法、装置、可读介质及电子设备

Country Status (2)

Country Link
CN (1) CN112786007B (zh)
WO (1) WO2022156544A1 (zh)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112786007B (zh) * 2021-01-20 2024-01-26 北京有竹居网络技术有限公司 语音合成方法、装置、可读介质及电子设备
US11574624B1 (en) * 2021-03-31 2023-02-07 Amazon Technologies, Inc. Synthetic speech processing
CN113327580A (zh) * 2021-06-01 2021-08-31 北京有竹居网络技术有限公司 语音合成方法、装置、可读介质及电子设备
CN113327577B (zh) * 2021-06-07 2024-01-16 北京百度网讯科技有限公司 语音合成方法、装置和电子设备
CN113409765B (zh) * 2021-06-11 2024-04-26 北京搜狗科技发展有限公司 一种语音合成方法、装置和用于语音合成的装置
CN113506562B (zh) * 2021-07-19 2022-07-19 武汉理工大学 基于声学特征与文本情感特征融合的端到端语音合成方法及系统
CN113689844B (zh) * 2021-07-22 2022-05-27 北京百度网讯科技有限公司 语音合成模型的确定方法、装置、设备和存储介质
CN113450765B (zh) * 2021-07-29 2024-07-09 平安科技(深圳)有限公司 语音合成方法、装置、设备及存储介质
CN113707127B (zh) * 2021-08-30 2023-12-15 中国科学院声学研究所 一种基于线性自注意力的语音合成方法及系统
CN115831089B (zh) * 2021-12-27 2023-12-01 北京百度网讯科技有限公司 声学特征的确定方法、装置、设备、介质及产品
CN117877460A (zh) * 2024-01-12 2024-04-12 汉王科技股份有限公司 语音合成方法、装置、语音合成模型训练方法、装置

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030078780A1 (en) * 2001-08-22 2003-04-24 Kochanski Gregory P. Method and apparatus for controlling a speech synthesis system to provide multiple styles of speech
US20050071163A1 (en) * 2003-09-26 2005-03-31 International Business Machines Corporation Systems and methods for text-to-speech synthesis using spoken example
CN102385858A (zh) * 2010-08-31 2012-03-21 国际商业机器公司 情感语音合成方法和系统
CN110992927A (zh) * 2019-12-11 2020-04-10 广州酷狗计算机科技有限公司 音频生成方法、装置、计算机可读存储介质及计算设备
CN111199724A (zh) * 2019-12-31 2020-05-26 出门问问信息科技有限公司 一种信息处理方法、设备及计算机可读存储介质
CN111583904A (zh) * 2020-05-13 2020-08-25 北京字节跳动网络技术有限公司 语音合成方法、装置、存储介质及电子设备
CN112786007A (zh) * 2021-01-20 2021-05-11 北京有竹居网络技术有限公司 语音合成方法、装置、可读介质及电子设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5999902A (en) * 1995-03-07 1999-12-07 British Telecommunications Public Limited Company Speech recognition incorporating a priori probability weighting factors
CN108597492B (zh) * 2018-05-02 2019-11-26 百度在线网络技术(北京)有限公司 语音合成方法和装置
CN111048062B (zh) * 2018-10-10 2022-10-04 华为技术有限公司 语音合成方法及设备
CN111192568B (zh) * 2018-11-15 2022-12-13 华为技术有限公司 一种语音合成方法及语音合成装置
CN109949791B (zh) * 2019-03-22 2024-07-09 平安科技(深圳)有限公司 基于hmm的情感语音合成方法、装置及存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030078780A1 (en) * 2001-08-22 2003-04-24 Kochanski Gregory P. Method and apparatus for controlling a speech synthesis system to provide multiple styles of speech
US20050071163A1 (en) * 2003-09-26 2005-03-31 International Business Machines Corporation Systems and methods for text-to-speech synthesis using spoken example
CN102385858A (zh) * 2010-08-31 2012-03-21 国际商业机器公司 情感语音合成方法和系统
CN110992927A (zh) * 2019-12-11 2020-04-10 广州酷狗计算机科技有限公司 音频生成方法、装置、计算机可读存储介质及计算设备
CN111199724A (zh) * 2019-12-31 2020-05-26 出门问问信息科技有限公司 一种信息处理方法、设备及计算机可读存储介质
CN111583904A (zh) * 2020-05-13 2020-08-25 北京字节跳动网络技术有限公司 语音合成方法、装置、存储介质及电子设备
CN112786007A (zh) * 2021-01-20 2021-05-11 北京有竹居网络技术有限公司 语音合成方法、装置、可读介质及电子设备

Also Published As

Publication number Publication date
CN112786007B (zh) 2024-01-26
CN112786007A (zh) 2021-05-11

Similar Documents

Publication Publication Date Title
WO2022156544A1 (zh) 语音合成方法、装置、可读介质及电子设备
US11948066B2 (en) Processing sequences using convolutional neural networks
WO2022156464A1 (zh) 语音合成方法、装置、可读介质及电子设备
CN112786006B (zh) 语音合成方法、合成模型训练方法、装置、介质及设备
WO2022105545A1 (zh) 语音合成方法、装置、可读介质及电子设备
WO2022151930A1 (zh) 语音合成方法、合成模型训练方法、装置、介质及设备
CN111369971B (zh) 语音合成方法、装置、存储介质和电子设备
US11450313B2 (en) Determining phonetic relationships
WO2022105553A1 (zh) 语音合成方法、装置、可读介质及电子设备
WO2022095743A1 (zh) 语音合成方法、装置、存储介质及电子设备
CN111899719A (zh) 用于生成音频的方法、装置、设备和介质
WO2022156413A1 (zh) 语音风格的迁移方法、装置、可读介质和电子设备
CN110197655B (zh) 用于合成语音的方法和装置
CN111489735B (zh) 语音识别模型训练方法及装置
CN113327580A (zh) 语音合成方法、装置、可读介质及电子设备
CN111354343B (zh) 语音唤醒模型的生成方法、装置和电子设备
US11322133B2 (en) Expressive text-to-speech utilizing contextual word-level style tokens
CN114255740A (zh) 语音识别方法、装置、计算机设备和存储介质
CN116343747A (zh) 语音合成方法、语音合成装置、电子设备及存储介质
CN114242093A (zh) 语音音色转换方法、装置、计算机设备和存储介质
Gambhir et al. End-to-end multi-modal low-resourced speech keywords recognition using sequential Conv2D nets
CN114155829A (zh) 语音合成方法、装置、可读存储介质及电子设备
CN113450756A (zh) 一种语音合成模型的训练方法及一种语音合成方法
CN114220436A (zh) 语音处理方法、装置、计算机设备和存储介质
Sahu et al. A quinphone-based context-dependent acoustic modeling for LVCSR

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22742023

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22742023

Country of ref document: EP

Kind code of ref document: A1