A speech synthesis method, device, electronic device and storage medium
By integrating text features and emotional features in speech synthesis technology, the target emotional speech is synthesized, which solves the problem of insufficient emotional expressiveness in the existing technology, realizes the diversification and intensity control of speech emotional expression, and satisfies the requirements of high anthropomorphism and high fidelity. , requirements for high emotional expressiveness.
Patent Information
- Application Number
- CN202110251885.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-08
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-03-08
AI Technical Summary
The emotional expressiveness of synthesized speech in existing speech synthesis technology is not ideal. The emotional expression is single and the emotional intensity cannot be controlled. It cannot meet the requirements of high anthropomorphism, high lifelikeness and high emotional expressiveness.
By obtaining the phoneme sequence of the text to be synthesized, determining its text features, determining the emotional features based on the input emotional labels and emotional intensity values, fusing text features and emotional features to obtain emotional text features, and then synthesizing the target emotional speech based on the emotional text features. Achieve diversity and intensity control of emotional expressions.
The emotional expressiveness of speech synthesis is improved, so that the emotion of the synthesized speech is associated with the input emotional label and intensity, and can output speech of different emotional categories and different emotional intensities to meet the needs of high anthropomorphism, high fidelity, and high emotional expressiveness.
Smart Images

Figure CN113096640B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a speech synthesis method, device, electronic device and storage medium. Background Art
[0002] With the continuous development of artificial intelligence technology, human-computer interaction, that is, the interaction between virtual people and humans through natural language, has become indispensable. Converting natural language into speech through speech synthesis technology is an important part of realizing human-computer interaction. Speech synthesis is a technology that produces artificial speech through mechanical and electronic methods. It is a technology that converts text information generated by the computer itself or input from the outside into fluent spoken output that humans can understand.
[0003] In the related technologies, although the synthesized speech achieved the level of "clearly audible and understandable" by applying deep learning technology to speech synthesis, its emotional expression is not ideal, the emotional expression is single and the emotional intensity cannot be controlled, which cannot meet the requirements of "high anthropomorphism, high realism, and high emotional expression" for synthesized speech. Summary of the invention
[0004] The present disclosure provides a speech synthesis method, device, electronic device and storage medium to at least solve the problem in the related art that the emotional expression of synthesized speech is not ideal, the emotional expression is single and the emotional intensity cannot be controlled. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a speech synthesis method, comprising:
[0006] Get the text to be synthesized;
[0007] Determining text features of the text to be synthesized according to the phoneme sequence of the text to be synthesized;
[0008] Determining the emotional characteristics of the text to be synthesized according to the input emotional label and emotional intensity value;
[0009] Fusion of the text features and the sentiment features to obtain sentiment text features corresponding to the text to be synthesized;
[0010] Determining the acoustic features corresponding to the text to be synthesized according to the emotional text features;
[0011] The target emotional speech is synthesized according to the acoustic features corresponding to the text to be synthesized.
[0012] As a possible implementation mode, determining the emotional features of the text to be synthesized according to the input emotional label and emotional intensity value includes:
[0013] Determine the one-hot encoding vector corresponding to the input sentiment label;
[0014] Obtaining the emotion coding information corresponding to the emotion tag according to the one-hot encoding vector and a preset emotion dictionary;
[0015] The emotional features of the text to be synthesized are obtained according to the emotional coding information and the input emotional intensity value.
[0016] As a possible implementation mode, determining the acoustic features corresponding to the text to be synthesized according to the emotional text features includes:
[0017] Inputting the emotional text features into an acoustic feature model to obtain a duration feature, a fundamental frequency feature, and an energy feature of each phoneme in the phoneme sequence;
[0018] The emotional text feature is fused with the duration feature, fundamental frequency feature and energy feature of each phoneme in the phoneme sequence to obtain a target fused text feature;
[0019] The text features are fused according to the target to obtain the acoustic features corresponding to the text to be synthesized.
[0020] As a possible implementation method, the emotional text feature is input into an acoustic feature model to obtain a duration feature of each phoneme in the phoneme sequence, including:
[0021] Inputting the emotional text features into a duration prediction network of an acoustic feature model to obtain a predicted duration feature of each phoneme in the phoneme sequence;
[0022] Get the input duration adjustment coefficient;
[0023] The predicted duration feature of each phoneme in the phoneme sequence is adjusted according to the duration adjustment coefficient to obtain the duration feature of each phoneme in the phoneme sequence.
[0024] As a possible implementation method, the step of inputting the emotional text feature into an acoustic feature model to obtain the fundamental frequency feature of each phoneme in the phoneme sequence includes:
[0025] Inputting the emotional text features into the fundamental frequency prediction network of the acoustic feature model to obtain the predicted fundamental frequency features of each phoneme in the phoneme sequence;
[0026] Obtaining an input baseband adjustment value and a preset baseband adjustment method;
[0027] According to the fundamental frequency adjustment value and the preset fundamental frequency adjustment method, the predicted fundamental frequency feature of each phoneme in the phoneme sequence is adjusted to obtain the fundamental frequency feature of each phoneme in the phoneme sequence.
[0028] As a possible implementation, the step of inputting the emotional text feature into an acoustic feature model to obtain the energy feature of each phoneme in the phoneme sequence includes:
[0029] The emotional text feature is fused with the fundamental frequency feature of each phoneme in the phoneme sequence to obtain a first fused text feature;
[0030] Inputting the first fused text feature into the energy prediction network of the acoustic feature model to obtain the predicted energy feature of each phoneme in the phoneme sequence;
[0031] Obtaining an input energy adjustment value and a preset energy adjustment method;
[0032] According to the energy adjustment value and the preset energy adjustment method, the predicted energy feature of each phoneme in the phoneme sequence is adjusted to obtain the energy feature of each phoneme in the phoneme sequence.
[0033] As a possible implementation manner, determining the text features of the text to be synthesized according to the phoneme sequence of the text to be synthesized includes:
[0034] Based on the regular expression, determining characters of a non-preset language in the text to be synthesized;
[0035] Converting the characters in the non-preset language into characters in the preset language to obtain converted text to be synthesized;
[0036] Determining the converted phoneme sequence of the text to be synthesized;
[0037] The phoneme sequence is input into the text encoding network of the acoustic feature model to obtain the text feature.
[0038] According to a second aspect of an embodiment of the present disclosure, there is provided a speech synthesis device, including:
[0039] A text acquisition unit, configured to acquire the text to be synthesized;
[0040] A text feature determination unit, configured to determine the text feature of the text to be synthesized according to the phoneme sequence of the text to be synthesized;
[0041] An emotion feature determination unit is configured to determine the emotion feature of the text to be synthesized according to the input emotion label and emotion intensity value;
[0042] A first fusion unit is configured to fuse the text feature and the emotion feature to obtain the emotion text feature corresponding to the text to be synthesized;
[0043] an acoustic feature determination unit, configured to determine the acoustic feature corresponding to the text to be synthesized according to the emotional text feature;
[0044] The speech synthesis unit is configured to synthesize the target emotional speech according to the acoustic features corresponding to the text to be synthesized.
[0045] As a possible implementation manner, the emotion feature determination unit includes:
[0046] A first determining unit is configured to determine a one-hot encoding vector corresponding to an input sentiment tag;
[0047] The emotion coding information determining unit is configured to obtain the emotion coding information corresponding to the emotion tag according to the one-hot encoding vector and a preset emotion dictionary;
[0048] The emotion feature determination subunit is configured to obtain the emotion feature of the text to be synthesized according to the emotion coding information and the input emotion intensity value.
[0049] As a possible implementation manner, the acoustic feature determination unit includes:
[0050] A second determining unit is configured to input the emotional text feature into an acoustic feature model to obtain a duration feature, a fundamental frequency feature, and an energy feature of each phoneme in the phoneme sequence;
[0051] The second fusion unit is configured to fuse the emotional text feature with the duration feature, fundamental frequency feature and energy feature of each phoneme in the phoneme sequence to obtain a target fused text feature;
[0052] The acoustic feature determination subunit is configured to perform fusion text features according to the target to obtain the acoustic features corresponding to the text to be synthesized.
[0053] As a possible implementation manner, the second determining unit includes:
[0054] A predicted duration feature determination unit is configured to input the emotional text feature into a duration prediction network of an acoustic feature model to obtain a predicted duration feature of each phoneme in the phoneme sequence;
[0055] A first acquisition unit is configured to acquire an input duration adjustment coefficient;
[0056] The first adjustment unit is configured to adjust the predicted duration feature of each phoneme in the phoneme sequence according to the duration adjustment coefficient to obtain the duration feature of each phoneme in the phoneme sequence.
[0057] As a possible implementation manner, the second determining unit includes:
[0058] A predicted fundamental frequency feature determination unit is configured to input the emotional text feature into the fundamental frequency prediction network of the acoustic feature model to obtain the predicted fundamental frequency feature of each phoneme in the phoneme sequence;
[0059] A second acquisition unit is configured to acquire an input baseband adjustment value and a preset baseband adjustment method;
[0060] The second adjustment unit is configured to adjust the predicted fundamental frequency feature of each phoneme in the phoneme sequence according to the fundamental frequency adjustment value and the preset fundamental frequency adjustment method to obtain the fundamental frequency feature of each phoneme in the phoneme sequence.
[0061] As a possible implementation manner, the second determining unit includes:
[0062] A third fusion unit is configured to fuse the emotional text feature with the fundamental frequency feature of each phoneme in the phoneme sequence to obtain a first fused text feature;
[0063] A prediction energy feature determination unit is configured to execute inputting the first fused text feature into the energy prediction network of the acoustic feature model to obtain a prediction energy feature of each phoneme in the phoneme sequence;
[0064] A third acquisition unit is configured to acquire an input energy adjustment value and a preset energy adjustment method;
[0065] The third adjustment unit is configured to adjust the predicted energy feature of each phoneme in the phoneme sequence according to the energy adjustment value and the preset energy adjustment method to obtain the energy feature of each phoneme in the phoneme sequence.
[0066] As a possible implementation manner, the text feature determination unit includes:
[0067] A third determining unit is configured to determine characters of a non-preset language in the text to be synthesized based on regular expression rules;
[0068] A conversion unit, configured to convert the characters in the non-preset language into characters in the preset language to obtain a converted text to be synthesized;
[0069] A fourth determining unit is configured to determine the converted phoneme sequence of the to-be-synthesized text;
[0070] The encoding unit is configured to execute the text encoding network of inputting the phoneme sequence into the acoustic feature model to obtain the text feature.
[0071] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, characterized in that it includes:
[0072] processor;
[0073] a memory for storing instructions executable by the processor;
[0074] The processor is configured to execute the instructions to implement the speech synthesis method in the first aspect above.
[0075] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the speech synthesis method in the above-mentioned first aspect.
[0076] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the speech synthesis method in the first aspect is implemented.
[0077] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0078] The emotional features of the text to be synthesized are determined according to the input emotional label and emotional intensity value, and the emotional features are integrated with the text features of the text to be synthesized to obtain the emotional text features of the text to be synthesized, and then the acoustic features corresponding to the text to be synthesized are determined according to the emotional text features, and the target emotional speech is synthesized according to the acoustic features. Since the acoustic features of the synthesized target emotional speech are determined based on the emotional text features, the emotional expressiveness of the target emotional speech is associated with the input emotional label and emotional intensity value. Different emotional labels can be input to obtain target emotional speech of different emotional categories, and different emotional intensity values can be input to obtain target emotional speech of different emotional intensities, thereby improving the emotional expressiveness of the synthesized speech, realizing the diversification of emotional expression of the synthesized speech, and controlling the emotional intensity of the synthesized speech, meeting the requirements of "high anthropomorphism, high realism, and high emotional expressiveness" for synthesized speech.
[0079] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0081] Figure 1is a schematic diagram of an implementation environment of a speech synthesis method according to an exemplary embodiment;
[0082] Figure 2 is a flow chart of a speech synthesis method according to an exemplary embodiment;
[0083] Figure 3 is a flow chart of another speech synthesis method according to an exemplary embodiment;
[0084] Figure 4 is a structural schematic diagram of an acoustic feature model according to an exemplary embodiment;
[0085] Figure 5 is a flow chart showing a method of determining acoustic features corresponding to a text to be synthesized according to emotional text features according to an exemplary embodiment;
[0086] Figure 6 is a flow chart of a method for obtaining a duration feature of each phoneme in a phoneme sequence according to an exemplary embodiment;
[0087] Figure 7 is a flow chart of a method for obtaining fundamental frequency features of each phoneme in a phoneme sequence according to an exemplary embodiment;
[0088] Figure 8 is a flow chart of a method for obtaining energy features of each phoneme in a phoneme sequence according to an exemplary embodiment;
[0089] Fig. 9 is a block diagram of a speech synthesis device according to an exemplary embodiment;
[0090] Fig.10 is a block diagram showing an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0091] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0092] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0093] See also Figure 1 , which is a schematic diagram of an implementation environment of a speech synthesis method according to an exemplary embodiment, the implementation environment may include a terminal 110 and a server 120, and the terminal 110 and the server 120 may be connected via a wired network or a wireless network.
[0094] The terminal 110 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The terminal 110 may be installed with client software such as an application (Application, referred to as App) that provides a speech synthesis function. The application may be an application that specifically provides speech synthesis, or may be other applications that have a speech synthesis function, such as a live broadcast application with a speech synthesis function, etc. The user of the terminal 110 may log in to the application using pre-registered user information, which may include an account number and a password.
[0095] The server 120 may be a server that provides background services for the application in the terminal 110, or may be other servers that are connected and communicated with the background server of the application. It may be a single server or a server cluster composed of multiple servers. The server 120 may store an acoustic feature model, which may include a text encoding network, an emotion encoding layer, an emotion intensity control layer, a duration prediction network, a fundamental frequency prediction network, an energy prediction network, and an acoustic feature decoding network. The server 120 may train and update the acoustic feature model according to a predetermined period. When the terminal 110 needs to perform speech synthesis, it may send the corresponding data to the server 120, and the server 120 may call the acoustic feature model to perform speech synthesis based on the data, and return the synthesized speech to the terminal 110.
[0096] It is understandable that the terminal 110 can also download the acoustic feature model from the server 120 and store it locally. When a speech synthesis operation is required, the terminal 110 can directly call the locally stored acoustic feature model to implement speech synthesis.
[0097] It can be seen that the speech synthesis method of the embodiment of the present disclosure can be executed by an electronic device, which can be a terminal or a server. It can be executed by the terminal or the server alone, or by the terminal and the server working together.
[0098] Figure 2 is a flow chart of a speech synthesis method according to an exemplary embodiment. Figure 2 As shown, the speech synthesis method is applied to an electronic device for illustration, and includes the following steps:
[0099] In step 21, the text to be synthesized is obtained.
[0100] The text to be synthesized may be Chinese text, English text, Chinese-English mixed text or text in other languages.
[0101] In step 22, the text features of the text to be synthesized are determined according to the phoneme sequence of the text to be synthesized.
[0102] Among them, a phoneme is the smallest unit of speech. For example, in the pronunciation of Chinese, an initial consonant or a final can be used as a phoneme respectively. In the pronunciation of other languages, each pronunciation is also equivalent to a phoneme.
[0103] The phoneme sequence is a sequence in which the phonemes of the text to be synthesized are arranged in the order in which they appear in the text to be synthesized. The phoneme sequence of the text to be synthesized can be obtained by performing corresponding transformations on the text to be synthesized.
[0104] As a possible implementation, when determining the text features of the text to be synthesized according to the phoneme sequence of the text to be synthesized, the following steps may be included:
[0105] Based on the regular expression rules, determine the characters of non-preset language in the text to be synthesized;
[0106] Converting the characters in the non-preset language into characters in the preset language to obtain converted text to be synthesized;
[0107] Determine the phoneme sequence of the text to be synthesized after the above conversion;
[0108] The phoneme sequence of the text to be synthesized is input into the text encoding network of the acoustic feature model to obtain text features.
[0109] In a specific implementation, since there may be non-standard characters in the text to be synthesized, the text to be synthesized may be standardized to convert characters in non-preset languages in the text to be synthesized into characters in the preset language. Taking the text to be synthesized as a Chinese text as an example, there may be non-Chinese phrases such as 5% in the Chinese text. The non-Chinese phrases in the text to be synthesized may be matched by regular expressions, and the non-Chinese phrases may be converted into corresponding Chinese readings, such as converting 5% into 5%. By the above-mentioned standardized processing of the text to be synthesized, the accuracy of the phoneme sequence of the text to be synthesized can be ensured.
[0110] When determining the phoneme sequence of the text to be synthesized based on the converted text to be synthesized, the converted text to be synthesized can be firstly subjected to prosody prediction to obtain a character-level prosody label, which can be a special mark indicating a pause added after the phoneme corresponding to a prosody character such as a prosody word or a prosody phrase. The specific prosody prediction can use a trained Bert model to obtain the character vector of each character in the converted text to be synthesized, and input the character vector of each character into a trained multi-layer perceptron, and obtain the character-level prosody label through the multi-layer perceptron. Among them, the multi-layer perceptron can include an input layer, a hidden layer and an output layer, wherein the number of nodes in the input layer can be 768, the hidden layer can include two layers, namely a first hidden layer and a second hidden layer, the number of nodes in the first hidden layer and the second hidden layer can be the same, for example, both are 256, and the number of nodes in the output layer can be 4. Then, each character in the converted text to be synthesized is converted into a corresponding phoneme according to a preset phoneme conversion dictionary, and a corresponding prosody label is added after the phoneme corresponding to the prosody character, thereby obtaining the phoneme sequence of the text to be synthesized. The preset phoneme conversion dictionary is a phoneme conversion dictionary corresponding to the text to be synthesized in the preset language. Taking the text to be synthesized in the preset language as an example, a pinyin dictionary can be used to convert Chinese characters in the converted text to be synthesized into pinyin, such as China->zhong1guo2, and then a pinyin-phoneme mapping dictionary can be used to convert the pinyin into pronunciation phonemes, such as zhong1 guo2->JH UH1NG1 G UW2AO2.
[0111] In the embodiments of the present disclosure, the text features of the text to be synthesized can be composed of the feature representation of each phoneme in the phoneme sequence of the text to be synthesized, and the feature representation of each phoneme in the phoneme sequence can be obtained by encoding the phoneme sequence through the text encoder of the acoustic feature model. In a specific implementation, the text encoder may include an embedding layer, a three-layer one-dimensional convolutional neural network, and a bidirectional LSTM (Long Short-Term Memory) network connected in sequence, wherein the embedding layer converts each phoneme in the phoneme sequence into an embedding vector, the three-layer one-dimensional convolutional neural network can learn to obtain the local context information of each phoneme according to the embedding vector, and the bidirectional LSTM network can obtain the bidirectional global information of each phoneme according to the local context information of each phoneme, so that the text encoder can obtain the feature representation of each phoneme in the phoneme sequence of the text to be synthesized with strong expressiveness and containing context information through the above-mentioned three-layer one-dimensional convolutional neural network and bidirectional LSTM network.
[0112] The disclosed embodiment ensures the accuracy of the phoneme sequence by converting the text to be synthesized and determining the phoneme sequence based on the converted text to be synthesized, and improves the accuracy of the text features when the phoneme sequence is subsequently input into the text encoding network of the acoustic feature model to obtain the corresponding text features, which in turn helps to improve the accuracy of the synthesized target emotional speech.
[0113] In step 23, the emotional features of the text to be synthesized are determined according to the input emotional labels and emotional intensity values.
[0114] Among them, emotional labels are used to represent emotional categories. For example, emotional categories can include: happiness, sadness, surprise, anger, etc. Different emotional categories can correspond to different emotional labels, and the same emotional category can also have different emotional intensity values when expressed. The emotional intensity value is used to identify the intensity of the emotion. Emotional intensity refers to the selection tendency of people towards things, which is the most important dynamic characteristic of emotion.
[0115] In the embodiments of the present disclosure, the range of emotion intensity values can be preset. Generally, the larger the emotion intensity value, the greater the emotion intensity it represents. For example, the range of emotion intensity values can be set to 0 to 5. When the user needs to input the emotion intensity value, he can input a numerical value within the range according to the requirement for the emotion intensity of the synthesized speech, so as to control the emotion intensity of the final synthesized speech. For example, if you need to express a very happy emotion in the synthesized speech, you can enter an emotion label with the emotion category of happy, and enter a relatively large emotion intensity value such as 4, so that you can express a very happy emotion in the final synthesized speech; if you just want to show a little happiness, you can enter a relatively small emotion intensity value such as 2.
[0116] As a possible implementation, the above step S23 may include the following steps when implemented: Figure 3 The following steps are shown:
[0117] In step S231, the one-hot encoding vector corresponding to the input sentiment tag is determined.
[0118] In step S232, the emotion coding information corresponding to the emotion tag is obtained according to the one-hot encoding vector and a preset emotion dictionary.
[0119] In step S233, the emotional features of the text to be synthesized are obtained according to the emotional coding information and the input emotional intensity value.
[0120] Among them, one-hot encoding is also called one-bit effective encoding, and its method is to use an N-bit state register to encode N states, each state has its own independent register bit, and at any time, only one of them is valid. The sentiment dictionary can be a pre-trained matrix of m rows and n columns, each row in the matrix represents an emotion category, and the elements in each row represent the expression value of the emotion category in the column where the element is located, wherein the specific values of m and n can be initialized and set according to the actual situation at the beginning of the sentiment dictionary training. For example, the sentiment dictionary can be a 6x128 matrix, that is, the sentiment dictionary includes 6 sentiment categories. In the embodiment of the present disclosure, the dimension of the one-hot encoding vector of the emotion label is consistent with the dimension of the column in the sentiment dictionary.
[0121] Specifically, when determining the emotion coding information of the emotion tag according to the one-hot encoding vector of the emotion tag and the preset emotion dictionary, the tensor product of the one-hot encoding vector and the emotion dictionary can be calculated, and the result obtained is the emotion coding information corresponding to the emotion tag. In mathematics, tensor product can be applied to different contexts such as vectors, matrices, tensors, vector spaces, algebra, topological vector spaces and modules. It belongs to the general bilinear operation and is also called outer product in some contexts.
[0122] For example, suppose the one-hot encoding vector of the sentiment label is [0,1,0,……,0] T , the sentiment dictionary is Then the emotion encoding information corresponding to the emotion label is:
[0123] After obtaining the input emotion intensity value, the product between the emotion intensity value and the emotion coding information of the emotion tag can be calculated, so as to obtain the emotion feature of the text to be synthesized. In a specific implementation, the emotion feature can be calculated based on the following formula: y=w*x, where x is the emotion coding information of the input emotion tag, w is the obtained input emotion intensity value, the value range of w can be 0-5, and y is the emotion feature.
[0124] The disclosed embodiment targets an input emotion tag, obtains the emotion coding information of the emotion tag through the one-hot encoding vector of the emotion tag and a preset emotion dictionary, and then obtains the emotion characteristics of the text to be synthesized according to the emotion coding information and the input emotion intensity value, thereby establishing an association between the input emotion tag and the emotion intensity value and the target emotion speech synthesized based on the text to be synthesized.
[0125] In step 24, the text features and the emotional features are fused to obtain the emotional text features corresponding to the text to be synthesized.
[0126] The specific method of fusion can be to add the text features and the sentiment features and use the addition result as the sentiment text features of the text to be synthesized, or to calculate the dot product of the text features and the sentiment features and use the dot product result as the sentiment text features of the text to be synthesized.
[0127] In step 25, the acoustic features corresponding to the text to be synthesized are determined based on the emotional text features.
[0128] The acoustic feature may be a Mel acoustic feature of a preset dimension, for example, the preset dimension may be 80 dimensions, and the Mel acoustic feature may include a fundamental frequency feature, a duration feature, and an energy feature. In a specific implementation, the above emotional text feature may be input into a pre-trained deep neural network to predict the Mel acoustic feature, and then the Mel acoustic feature with emotion may be obtained as the acoustic feature corresponding to the text to be synthesized.
[0129] In step 26, the target emotional speech is synthesized according to the acoustic features corresponding to the text to be synthesized.
[0130] Specifically, a vocoder may be called to convert the acoustic features corresponding to the above text to be synthesized into a speech waveform to obtain the target emotional speech. The vocoder may be Wavenet, Griffin-Lim, a single-layer recurrent neural network model WaveRNN, a Parallel WaveGan based on a non-autoregressive network, etc., to obtain better sound quality and achieve a sound quality effect close to that of a real person speaking.
[0131] In the embodiments of the present invention, since the acoustic features of the synthesized target emotional speech are determined based on the emotional text features, and the emotional text features are obtained by fusing the text features of the text to be synthesized with the emotional features of the emotional label, and the emotional features of the emotional label are determined based on the input emotional label and the emotional intensity value, the emotional expressiveness of the synthesized target emotional speech is associated with the input emotional label and the emotional intensity value, and different emotional categories of target emotional speech can be obtained by inputting different emotional labels, and different emotional intensity values can be input for the same emotional category to obtain target emotional speech of different emotional intensities, thereby improving the emotional expressiveness of the synthesized speech, achieving the diversification of emotional expression of the synthesized speech, and controlling the emotional intensity of the synthesized speech, meeting the requirements for "high anthropomorphism, high realism, and high emotional expressiveness" for the synthesized speech.
[0132] In order to reduce the complexity of the speech synthesis device implementing the speech synthesis method of the embodiment of the present disclosure, as a possible implementation method, an acoustic feature model can be pre-trained, such as Figure 4As shown, the acoustic feature model may include an emotion encoding layer, a text encoding network, an emotion intensity control layer, a duration prediction network, a fundamental frequency prediction network, an energy prediction network, multiple fusion layers and an acoustic feature decoding network.
[0133] The emotion coding layer can map the input emotion label to emotion coding information based on a pre-trained emotion dictionary. The pre-trained emotion dictionary can be a pre-trained matrix of m rows and n columns, where each row in the matrix represents an emotion category, and each element in each row represents the expression value of the emotion category in the column where the element is located.
[0134] The text encoding network may include an embedding layer, a three-layer one-dimensional convolutional neural network, and a bidirectional LSTM (Long Short-Term Memory) network connected in sequence, wherein the embedding layer converts each phoneme in the phoneme sequence into an embedding vector, the three-layer one-dimensional convolutional neural network can learn to obtain the local context information of each phoneme according to the embedding vector, and the bidirectional LSTM network can obtain the bidirectional global information of each phoneme according to the local context information of each phoneme, so that the text encoder can obtain the feature representation of each phoneme in the phoneme sequence to be synthesized that has strong expressiveness and contains context information through the above-mentioned three-layer one-dimensional convolutional neural network and bidirectional LSTM network.
[0135] The emotion intensity control layer can obtain the input emotion intensity value and obtain the emotion feature based on the preset function y=w*x, wherein x is the emotion encoding information of the input emotion label, w is the obtained input emotion intensity value, the value range of w can be 0~5, y is the emotion feature, and the obtained emotion feature is a characteristic representation of the emotion category of the required emotion intensity.
[0136] The network structures of the duration prediction network, the fundamental frequency prediction network, and the energy prediction network can be the same, and can include two layers of one-dimensional convolutional neural networks and one fully connected layer. For the duration prediction network, the predicted pronunciation duration of the character can be output through two layers of one-dimensional convolutional neural networks and then through a fully connected layer; for the fundamental frequency prediction network, the predicted pronunciation fundamental frequency of the character can be output through two layers of one-dimensional convolutional neural networks and then through a fully connected layer; for the energy prediction network, the predicted pronunciation energy of the character can be output through two layers of one-dimensional convolutional neural networks and then through a fully connected layer, and the pronunciation energy can be reflected in decibel values.
[0137] The acoustic feature decoding network can be a decoding network based on a position-sensitive attention mechanism. The position-sensitive attention mechanism is an extension of the previous attention mechanism, which can use the accumulated attention weights of the previous decoding process as additional features, so that the speech synthesis remains consistent when moving forward along the input sequence, reducing potential subsequence duplication and omissions during the decoding process. Specifically, the acoustic feature decoding network may include a position-sensitive attention mechanism layer, a PreNet layer, and a two-layer LSTM network, wherein the PreNet layer is composed of two fully connected layers, and each fully connected layer is followed by an activation function layer.
[0138] Based on the above acoustic feature model, in a possible implementation, when determining the acoustic features corresponding to the text to be synthesized according to the emotional text features, the above step S25 may include: Figure 5 The following steps:
[0139] In step S251, the emotional text feature is input into the acoustic feature model to obtain the duration feature, fundamental frequency feature and energy feature of each phoneme in the phoneme sequence.
[0140] Among them, the duration feature represents the continuous pronunciation duration of the corresponding phoneme in the synthesized speech, the fundamental frequency feature represents the pronunciation fundamental frequency of the corresponding phoneme in the synthesized speech, and the energy feature represents the pronunciation energy size of the corresponding phoneme in the synthesized speech. For example, the pronunciation energy size can be decibel.
[0141] Specifically, the emotional text features can be input into the duration prediction network of the acoustic feature model, and the predicted duration output by the duration prediction network is directly used as the duration feature of the corresponding phoneme in the phoneme sequence. The emotional text features can be input into the fundamental frequency prediction network of the acoustic feature model, and the predicted fundamental frequency features output by the fundamental frequency prediction network are directly used as the fundamental frequency features of the corresponding phoneme in the phoneme sequence. The emotional text features are fused with the fundamental frequency features of each phoneme in the phoneme sequence and then input into the energy prediction network of the acoustic feature model, and the predicted energy features output by the energy prediction network are directly used as the energy features of the corresponding phoneme in the phoneme sequence.
[0142] As a possible implementation method, in order to further improve the flexibility of emotional speech synthesis, the speech rate of the synthesized emotional speech can be controlled, such as Figure 6 As shown, when the emotional text feature is input into the acoustic feature model to obtain the duration feature of each phoneme in the phoneme sequence, the following steps may be included:
[0143] In step S61, the emotional text feature is input into the duration prediction network of the acoustic feature model to obtain the predicted duration feature of each phoneme in the phoneme sequence.
[0144] It can be understood that the predicted duration feature is the output result of the duration prediction network.
[0145] In step S62, the input duration adjustment coefficient is obtained.
[0146] In step S63, the predicted duration feature of each phoneme in the phoneme sequence is adjusted according to the duration adjustment coefficient to obtain the duration feature of each phoneme in the phoneme sequence.
[0147] Specifically, the user can input a corresponding duration adjustment coefficient according to the speed requirement for synthesizing emotional speech in actual applications. When adjusting the predicted duration feature of each phoneme in the phoneme sequence according to the duration adjustment coefficient, the product of the predicted duration feature of each phoneme in the phoneme sequence and the duration adjustment coefficient can be calculated, and the product of the predicted duration feature of the phoneme and the duration adjustment coefficient is used as the duration feature of the phoneme, thereby obtaining the duration feature of each phoneme in the phoneme sequence. Generally, when the duration adjustment coefficient is less than 1, the speaking speed of the synthesized emotional speech can be accelerated, and when the duration adjustment coefficient is greater than 1, the speaking speed of the synthesized emotional speech can be slowed down. Exemplarily, the value range of the duration adjustment system can be 0.5 to 2.
[0148] By using the input duration adjustment coefficient to adjust the predicted duration feature, it is possible to flexibly control the synthesized emotional speech according to the actual speaking speed requirement for the synthesized emotional speech.
[0149] As a possible implementation method, in order to further improve the flexibility of emotional speech synthesis, the frequency of the synthesized emotional speech can be controlled, such as Figure 7 As shown, when the emotional text feature is input into the acoustic feature model to obtain the fundamental frequency feature of each phoneme in the phoneme sequence, the following steps may be included:
[0150] In step S71, the emotional text feature is input into the fundamental frequency prediction network of the acoustic feature model to obtain the predicted fundamental frequency feature of each phoneme in the phoneme sequence.
[0151] It can be understood that the predicted fundamental frequency feature is the output result of the fundamental frequency prediction network.
[0152] In step S72, the input baseband adjustment value and the preset baseband adjustment method are obtained.
[0153] In step S73, the predicted fundamental frequency feature of each phoneme in the phoneme sequence is adjusted according to the fundamental frequency adjustment value and the preset fundamental frequency adjustment method to obtain the fundamental frequency feature of each phoneme in the phoneme sequence.
[0154] Specifically, the user can input the corresponding frequency adjustment value and the preset baseband adjustment method according to the frequency requirements for synthesized emotional speech in actual applications to control the frequency of the synthesized speech. Among them, the preset baseband adjustment method may include adding the frequency adjustment value based on the predicted baseband feature or subtracting the frequency adjustment value based on the predicted baseband feature. The specific preset baseband adjustment method can be selected by the user according to the actual frequency requirements for synthesized emotional speech. If the frequency of the synthesized emotional speech needs to be increased, the frequency adjustment value can be added based on the predicted baseband feature. If the frequency of the synthesized emotional speech needs to be reduced, the frequency adjustment value can be subtracted based on the predicted baseband feature. Among them, the frequency adjustment value can also be input by the user according to the actual required frequency adjustment amplitude. Exemplarily, the value range of the frequency adjustment value can be 0 to 100 Hz.
[0155] By adjusting the predicted fundamental frequency feature using the input fundamental frequency adjustment value and the preset fundamental frequency adjustment method, it is possible to flexibly control the synthesized emotional speech according to the actual frequency requirement for the synthesized emotional speech.
[0156] As a possible implementation method, in order to further improve the flexibility of emotional speech synthesis, the intensity of the synthesized emotional speech can be controlled, such as Figure 8 As shown, when the emotional text feature is input into the acoustic feature model to obtain the energy feature of each phoneme in the phoneme sequence, the following steps may be included:
[0157] In step S81, the emotional text feature is fused with the fundamental frequency feature of each phoneme in the phoneme sequence to obtain a first fused text feature.
[0158] A specific fusion method may be to add the fundamental frequency feature of each phoneme in the phoneme sequence with the feature corresponding to the phoneme in the emotional text feature, and use the sum as the first fused text feature, or to perform dot multiplication of the fundamental frequency feature of each phoneme in the phoneme sequence with the feature corresponding to the phoneme in the emotional text feature in the form of a vector, and use the dot product as the first fused text feature.
[0159] In step S82, the first fused text feature is input into the energy prediction network of the acoustic feature model to obtain the predicted energy feature of each phoneme in the phoneme sequence.
[0160] It can be understood that the predicted energy feature is the output result of the energy prediction network.
[0161] In step S83, the input energy adjustment value and the preset energy adjustment method are obtained.
[0162] In step S84, the predicted energy feature of each phoneme in the phoneme sequence is adjusted according to the energy adjustment value and the preset energy adjustment method to obtain the energy feature of each phoneme in the phoneme sequence.
[0163] Specifically, the user can input the corresponding energy adjustment value and the preset energy adjustment method according to the pronunciation intensity requirement of the synthesized emotional speech in the actual application to control the speech intensity of the synthesized speech. Among them, the preset energy adjustment method may include adding the energy adjustment value based on the predicted energy feature or subtracting the energy adjustment value based on the predicted energy feature. The specific preset energy adjustment method can be selected by the user according to the actual pronunciation intensity requirement of the synthesized emotional speech. If the pronunciation intensity of the synthesized emotional speech needs to be improved, the energy adjustment value can be added based on the predicted energy feature. If the pronunciation intensity of the synthesized emotional speech needs to be reduced, the energy adjustment value can be subtracted based on the predicted energy feature. Among them, the energy adjustment value can also be input by the user according to the actual required energy adjustment range.
[0164] By adjusting the predicted energy feature using the input energy adjustment value and the preset energy adjustment method, it is possible to flexibly control the synthesized emotional speech according to the actual pronunciation intensity requirement for the synthesized emotional speech.
[0165] Understandably, Figure 6 , Figure 7 and Figure 8 The methods shown can be arbitrarily combined according to actual needs, so as to achieve joint control of the speech rate, frequency and intensity of the synthesized emotional speech, or to achieve control of one or more of the speech rate, frequency and intensity of the synthesized emotional speech.
[0166] In step S252, the emotional text feature is fused with the duration feature, fundamental frequency feature and energy feature of each phoneme in the phoneme sequence to obtain a target fused text feature.
[0167] Specifically, the emotional text feature can be first fused with the fundamental frequency feature of each phoneme in the phoneme sequence to obtain a first fused text feature, and then the first fused text feature can be fused with the energy feature of each phoneme in the phoneme sequence to obtain a second fused text feature, and then the second fused text feature can be copied at the frame level according to the duration feature of each phoneme in the phoneme sequence to obtain the target fused text feature. The fusion method corresponding to the first fused text feature and the second fused text feature can be addition or dot product between the corresponding features.
[0168] It can be understood that the second fused text feature is essentially a phoneme feature sequence composed of phoneme features corresponding to each phoneme in the phoneme sequence, and each phoneme feature in the phoneme feature sequence includes text features, emotional features, fundamental frequency features and energy features corresponding to the phoneme. When the second fused text feature is copied at the frame level according to the duration features of each phoneme in the phoneme sequence, each phoneme feature can be expanded into a frame sequence unit, and the number of frames contained in the frame sequence unit is consistent with the duration feature of the phoneme corresponding to the phoneme feature. When the phoneme feature is expanded into a frame unit sequence, the number of times the phoneme feature can be copied is (duration feature-1), so that each frame in the frame unit sequence is the corresponding phoneme feature.
[0169] For example, the phoneme sequence of the text to be synthesized includes 4 phonemes, and the corresponding second fused text feature is a sequence composed of 4 80-dimensional phoneme features. Assuming that the duration features corresponding to each phoneme are 3, 2, 1, and 1 respectively, when the second fused text feature is copied at the frame level, the first phoneme feature is copied 2 (3-1) times to obtain a frame unit sequence corresponding to the first phoneme, and the frame unit sequence includes 3 first phoneme features; the second phoneme feature is copied 1 (2-1) times to obtain a frame unit sequence corresponding to the second phoneme, and the frame unit sequence includes 2 second phoneme features; the third phoneme feature is not copied (1-1), so as to obtain a frame unit sequence corresponding to the third phoneme, and the frame unit sequence includes 1 third phoneme feature; the fourth phoneme feature is not copied (1-1), so as to obtain a frame unit sequence corresponding to the fourth phoneme, and the frame unit sequence includes 1 fourth phoneme feature. After the above-mentioned frame-level copying operation, a target fused text feature consisting of four frame unit sequences can be obtained. Each frame unit sequence includes a number of frames consistent with the duration feature of the corresponding phoneme, and each frame is a phoneme feature corresponding to the phoneme, which includes the text feature, emotional feature, fundamental frequency feature and energy feature corresponding to the corresponding phoneme.
[0170] In step S253, the acoustic features corresponding to the text to be synthesized are obtained according to the target fusion text features.
[0171] Specifically, the target fused text features can be input into the acoustic feature decoding network of the acoustic feature model to obtain the acoustic features corresponding to the text to be synthesized output by the acoustic feature decoding network. In a specific implementation, the target fused text features, the accumulated attention weights of the previous moment, and the decoded hidden state output by the first layer LSTM network at the current moment can be input into the position-sensitive attention mechanism layer to obtain the output attention context vector; the attention context vector is spliced with the decoded hidden state output by the first layer LSTM network at the current moment and input into the second layer LSTM network to obtain the decoded hidden state output by the second layer LSTM network at the current moment. The decoded hidden state output by the second layer LSTM network at the current moment is spliced with the attention context vector and input into the PreNet layer, and the output of the PreNet layer is spliced with the attention context vector as the input of the first layer LSTM network; the Mel acoustic features are predicted based on the splicing results of the decoded hidden state output by the second layer LSTM network at each moment and the attention context vector. Among them, the dimension of the attention context vector is consistent with the dimension of the target fused text features, for example, both can be 512 dimensions.
[0172] The embodiments of the present disclosure can achieve diversified synthesis of emotional speech through a single acoustic feature model. It has a simple structure and not only improves the efficiency of emotional speech synthesis, but also can realize the control of the speaking speed, frequency, sound intensity and emotional intensity of the synthesized emotional speech. It can control any one of the above according to the scene requirements, or control them together, which greatly improves the flexibility of emotional speech synthesis.
[0173] The following briefly introduces the training process of the acoustic feature model, which may include the following steps:
[0174] A training sample set is obtained, wherein the training samples in the training sample set include a sample phoneme sequence and acoustic features (such as Mel spectrum) corresponding to the sample speech, an emotion label and an emotion intensity value corresponding to the sample speech, and a duration, fundamental frequency and energy corresponding to each sample phoneme.
[0175] The sample phoneme sequence in the training sample is input into the text encoding network of the acoustic feature model, the emotion label in the training sample is input into the emotion encoding layer of the acoustic feature model, and the emotion intensity value in the training sample is input into the emotion intensity control layer of the acoustic feature model. At the same time, the acoustic features (such as Mel spectrum) in the training sample, the duration, fundamental frequency and energy corresponding to each sample phoneme are used as the expected output data to train the acoustic feature model. During the training process, the model parameters in the acoustic feature model are reversely adjusted according to the difference between the actual output data and the expected output data until the training end condition is met. Among them, the training end condition can be that the difference between the actual output data and the expected output data is minimized, or the number of iterations reaches a preset iteration number threshold.
[0176] Fig. 9 is a block diagram of a speech synthesis device according to an exemplary embodiment. Fig. 9 The speech synthesis device 900 includes a text acquisition unit 91, a text feature determination unit 92, an emotion feature determination unit 93, a first fusion unit 94, an acoustic feature determination unit 95, and a speech synthesis unit 96.
[0177] The text acquisition unit 91 is configured to acquire the text to be synthesized;
[0178] The text feature determination unit 92 is configured to determine the text feature of the text to be synthesized according to the phoneme sequence of the text to be synthesized;
[0179] The emotion feature determination unit 93 is configured to determine the emotion feature of the text to be synthesized according to the input emotion label and emotion intensity value;
[0180] The first fusion unit 94 is configured to fuse the text feature and the emotion feature to obtain the emotion text feature corresponding to the text to be synthesized;
[0181] The acoustic feature determination unit 95 is configured to determine the acoustic feature corresponding to the text to be synthesized according to the emotional text feature;
[0182] The speech synthesis unit 96 is configured to synthesize the target emotional speech according to the acoustic features corresponding to the text to be synthesized.
[0183] As a possible implementation, the emotion feature determination unit 93 includes:
[0184] A first determining unit is configured to determine a one-hot encoding vector corresponding to an input sentiment tag;
[0185] The emotion coding information determining unit is configured to obtain the emotion coding information corresponding to the emotion tag according to the one-hot encoding vector and a preset emotion dictionary;
[0186] The emotion feature determination subunit is configured to obtain the emotion feature of the text to be synthesized according to the emotion coding information and the input emotion intensity value.
[0187] As a possible implementation, the acoustic feature determination unit 95 includes:
[0188] A second determining unit is configured to input the emotional text feature into an acoustic feature model to obtain a duration feature, a fundamental frequency feature, and an energy feature of each phoneme in the phoneme sequence;
[0189] The second fusion unit is configured to fuse the emotional text feature with the duration feature, fundamental frequency feature and energy feature of each phoneme in the phoneme sequence to obtain a target fused text feature;
[0190] The acoustic feature determination subunit is configured to perform fusion text features according to the target to obtain the acoustic features corresponding to the text to be synthesized.
[0191] As a possible implementation manner, the second determining unit includes:
[0192] A predicted duration feature determination unit is configured to input the emotional text feature into a duration prediction network of an acoustic feature model to obtain a predicted duration feature of each phoneme in the phoneme sequence;
[0193] A first acquisition unit is configured to acquire an input duration adjustment coefficient;
[0194] The first adjustment unit is configured to adjust the predicted duration feature of each phoneme in the phoneme sequence according to the duration adjustment coefficient to obtain the duration feature of each phoneme in the phoneme sequence.
[0195] As a possible implementation manner, the second determining unit includes:
[0196] A predicted fundamental frequency feature determination unit is configured to input the emotional text feature into the fundamental frequency prediction network of the acoustic feature model to obtain the predicted fundamental frequency feature of each phoneme in the phoneme sequence;
[0197] A second acquisition unit is configured to acquire an input baseband adjustment value and a preset baseband adjustment method;
[0198] The second adjustment unit is configured to adjust the predicted fundamental frequency feature of each phoneme in the phoneme sequence according to the fundamental frequency adjustment value and the preset fundamental frequency adjustment method to obtain the fundamental frequency feature of each phoneme in the phoneme sequence.
[0199] As a possible implementation manner, the second determining unit includes:
[0200] A third fusion unit is configured to fuse the emotional text feature with the fundamental frequency feature of each phoneme in the phoneme sequence to obtain a first fused text feature;
[0201] A prediction energy feature determination unit is configured to execute inputting the first fused text feature into the energy prediction network of the acoustic feature model to obtain a prediction energy feature of each phoneme in the phoneme sequence;
[0202] A third acquisition unit is configured to acquire an input energy adjustment value and a preset energy adjustment method;
[0203] The third adjustment unit is configured to adjust the predicted energy feature of each phoneme in the phoneme sequence according to the energy adjustment value and the preset energy adjustment method to obtain the energy feature of each phoneme in the phoneme sequence.
[0204] As a possible implementation, the text feature determination unit 92 includes:
[0205] A third determining unit is configured to determine characters of a non-preset language in the text to be synthesized based on regular expression rules;
[0206] A conversion unit, configured to convert the characters in the non-preset language into characters in the preset language to obtain a converted text to be synthesized;
[0207] A fourth determining unit is configured to determine the converted phoneme sequence of the to-be-synthesized text;
[0208] The encoding unit is configured to execute the text encoding network of inputting the phoneme sequence into the acoustic feature model to obtain the text feature.
[0209] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0210] In an exemplary embodiment, an electronic device is also provided, including a processor; a memory for storing processor executable instructions; wherein the processor is configured to implement the steps of any one of the speech synthesis methods provided in the above embodiments when executing the instructions stored in the memory.
[0211] The electronic device may be a terminal, a server or a similar computing device. For example, the electronic device is a terminal. Fig.10 is a block diagram of a terminal running a speech synthesis method according to an exemplary embodiment, specifically:
[0212] The terminal may include components such as an RF (Radio Frequency) circuit 1010, a memory 1020 including one or more computer-readable storage media, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a WiFi (wireless fidelity) module 1070, a processor 1080 including one or more processing cores, and a power supply 1090. Those skilled in the art will appreciate that Fig.10The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0213] The RF circuit 1010 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 1080 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 1010 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. In addition, the RF circuit 1010 can also communicate with the network and other terminals through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.
[0214] The memory 1020 can be used to store software programs and modules, and the processor 1080 executes various functional applications and data processing by running the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, etc.; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 1020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1020 may also include a memory controller to provide the processor 1080 and the input unit 1030 with access to the memory 1020.
[0215] The input unit 1030 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 1030 may include a touch-sensitive surface 1031 and other input devices 1032. The touch-sensitive surface 1031, also known as a touch display screen or a touch pad, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or near the touch-sensitive surface 1031), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface 1031 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 1080, and can receive and execute commands sent by the processor 1080. In addition, the touch-sensitive surface 1031 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 1031, the input unit 1030 may further include other input devices 1032. Specifically, the other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0216] The display unit 1040 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the terminal, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 1040 may include a display panel 1041, and optionally, the display panel 1041 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 1031 may cover the display panel 1041, and when the touch-sensitive surface 1031 detects a touch operation on or near it, it is transmitted to the processor 1080 to determine the type of the touch event, and then the processor 1080 provides corresponding visual output on the display panel 1041 according to the type of the touch event. Among them, the touch-sensitive surface 1031 and the display panel 1041 can be two independent components to realize the input and output functions, but in some embodiments, the touch-sensitive surface 1031 and the display panel 1041 can also be integrated to realize the input and output functions.
[0217] The terminal may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 1041 and / or the backlight when the terminal is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the terminal posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can be configured in the terminal, they will not be repeated here.
[0218] The audio circuit 1060, the speaker 1061, and the microphone 1062 can provide an audio interface between the user and the terminal. The audio circuit 1060 can transmit the received audio data to the speaker 1061 after converting the electrical signal, which is converted into a sound signal for output by the speaker 1061; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1060 and converted into audio data, and then the audio data is output to the processor 1080 for processing, and then sent to another terminal through the RF circuit 1010, or the audio data is output to the memory 1020 for further processing. The audio circuit 1060 may also include an earplug jack to provide communication between an external headset and the terminal.
[0219] WiFi is a short-range wireless transmission technology. The terminal can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 1070, which provides users with wireless broadband Internet access. Fig.10 A WiFi module 1070 is shown, but it is understandable that it is not an essential component of the terminal and can be omitted as needed without changing the essence of the invention.
[0220] The processor 1080 is the control center of the terminal, and uses various interfaces and lines to connect various parts of the entire terminal. By running or executing software programs and / or modules stored in the memory 1020, and calling data stored in the memory 1020, the processor 1080 performs various functions of the terminal and processes data, thereby monitoring the terminal as a whole. Optionally, the processor 1080 may include one or more processing cores; preferably, the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1080.
[0221] The terminal also includes a power supply 1090 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 1080 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 1090 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0222] Although not shown, the terminal may also include a camera, a Bluetooth module, etc., which will not be described in detail herein. Specifically in this embodiment, the terminal also includes a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors. The one or more programs include instructions for executing the speech synthesis method provided in the above method embodiment.
[0223] It can be understood by those skilled in the art that Fig.10 The structure shown is for illustration only and does not limit the structure of the above electronic device. Fig.10 More or fewer components as shown, or with Fig.10 Different configurations are shown.
[0224] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1020 including instructions, and the instructions can be executed by a processor 1080 of the apparatus 1000 to complete the above method. Alternatively, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0225] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the speech synthesis method provided by the embodiment of the present disclosure is implemented.
[0226] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0227] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A speech synthesis method, It is characterized in that include: Get the text to be synthesized; Determining text features of the text to be synthesized according to the phoneme sequence of the text to be synthesized; Determine a one-hot encoding vector corresponding to an input emotion tag, obtain emotion encoding information corresponding to the emotion tag according to the one-hot encoding vector and a preset emotion dictionary, determine the product between the emotion encoding information and the input emotion intensity value, and obtain the emotion feature of the text to be synthesized; Fusion of the text features and the sentiment features to obtain sentiment text features corresponding to the text to be synthesized; Inputting the emotional text feature into the acoustic feature model to obtain the duration feature, fundamental frequency feature and energy feature of each phoneme in the phoneme sequence, fusing the emotional text feature with the duration feature, fundamental frequency feature and energy feature of each phoneme in the phoneme sequence to obtain a target fused text feature, and obtaining the acoustic feature corresponding to the text to be synthesized according to the target fused text feature; The acoustic feature model includes an emotion encoding layer, a text encoding network, an emotion intensity control layer, a duration prediction network, a fundamental frequency prediction network, an energy prediction network, multiple fusion layers and an acoustic feature decoding network; The target emotional speech is synthesized according to the acoustic features corresponding to the text to be synthesized.
2. The speech synthesis method according to claim 1, It is characterized in that The step of inputting the emotional text feature into the acoustic feature model to obtain the duration feature of each phoneme in the phoneme sequence includes: Inputting the emotional text features into a duration prediction network of an acoustic feature model to obtain a predicted duration feature of each phoneme in the phoneme sequence; Get the input duration adjustment coefficient; The predicted duration feature of each phoneme in the phoneme sequence is adjusted according to the duration adjustment coefficient to obtain the duration feature of each phoneme in the phoneme sequence.
3. The speech synthesis method according to claim 1, It is characterized in that The step of inputting the emotional text feature into the acoustic feature model to obtain the fundamental frequency feature of each phoneme in the phoneme sequence includes: Inputting the emotional text features into the fundamental frequency prediction network of the acoustic feature model to obtain the predicted fundamental frequency features of each phoneme in the phoneme sequence; Obtaining an input baseband adjustment value and a preset baseband adjustment method; According to the fundamental frequency adjustment value and the preset fundamental frequency adjustment method, the predicted fundamental frequency feature of each phoneme in the phoneme sequence is adjusted to obtain the fundamental frequency feature of each phoneme in the phoneme sequence.
4. The speech synthesis method according to claim 1, It is characterized in that The step of inputting the emotional text feature into the acoustic feature model to obtain the energy feature of each phoneme in the phoneme sequence includes: The emotional text feature is fused with the fundamental frequency feature of each phoneme in the phoneme sequence to obtain a first fused text feature; Inputting the first fused text feature into the energy prediction network of the acoustic feature model to obtain the predicted energy feature of each phoneme in the phoneme sequence; Obtaining an input energy adjustment value and a preset energy adjustment method; According to the energy adjustment value and the preset energy adjustment method, the predicted energy feature of each phoneme in the phoneme sequence is adjusted to obtain the energy feature of each phoneme in the phoneme sequence.
5. The speech synthesis method according to claim 1, It is characterized in that Determining the text features of the text to be synthesized according to the phoneme sequence of the text to be synthesized includes: Based on the regular expression, determining characters of a non-preset language in the text to be synthesized; Converting the characters in the non-preset language into characters in the preset language to obtain converted text to be synthesized; Determining the converted phoneme sequence of the text to be synthesized; The phoneme sequence is input into the text encoding network of the acoustic feature model to obtain the text feature.
6. A speech synthesis device, It is characterized in that include: A text acquisition unit, configured to acquire the text to be synthesized; A text feature determination unit, configured to determine the text feature of the text to be synthesized according to the phoneme sequence of the text to be synthesized; The emotional feature determination unit is configured to determine the one-hot encoding vector corresponding to the input emotional tag, obtain the emotional encoding information corresponding to the emotional tag according to the one-hot encoding vector and a preset emotional dictionary, determine the product between the emotional encoding information and the input emotional intensity value, and obtain the emotional feature of the text to be synthesized; A first fusion unit is configured to fuse the text feature and the emotion feature to obtain the emotion text feature corresponding to the text to be synthesized; The acoustic feature determination unit is configured to input the emotional text feature into the acoustic feature model to obtain the duration feature, fundamental frequency feature and energy feature of each phoneme in the phoneme sequence, fuse the emotional text feature with the duration feature, fundamental frequency feature and energy feature of each phoneme in the phoneme sequence to obtain a target fused text feature, and obtain the acoustic feature corresponding to the text to be synthesized according to the target fused text feature; The acoustic feature model includes an emotion coding layer, a text coding network, an emotion intensity control layer, a duration prediction network, a fundamental frequency prediction network, an energy prediction network, multiple fusion layers and an acoustic feature decoding network speech synthesis unit, and is configured to perform synthesis of target emotional speech according to the acoustic features corresponding to the text to be synthesized.
7. The speech synthesis device according to claim 6, It is characterized in that The acoustic feature determination unit second determination unit comprises: A predicted duration feature determination unit is configured to input the emotional text feature into a duration prediction network of an acoustic feature model to obtain a predicted duration feature of each phoneme in the phoneme sequence; A first acquisition unit is configured to acquire an input duration adjustment coefficient; The first adjustment unit is configured to adjust the predicted duration feature of each phoneme in the phoneme sequence according to the duration adjustment coefficient to obtain the duration feature of each phoneme in the phoneme sequence.
8. The speech synthesis device according to claim 6, It is characterized in that The acoustic feature determination unit second determination unit comprises: A predicted fundamental frequency feature determination unit is configured to input the emotional text feature into the fundamental frequency prediction network of the acoustic feature model to obtain the predicted fundamental frequency feature of each phoneme in the phoneme sequence; A second acquisition unit is configured to acquire an input baseband adjustment value and a preset baseband adjustment method; The second adjustment unit is configured to adjust the predicted fundamental frequency feature of each phoneme in the phoneme sequence according to the fundamental frequency adjustment value and the preset fundamental frequency adjustment method to obtain the fundamental frequency feature of each phoneme in the phoneme sequence.
9. The speech synthesis device according to claim 6, It is characterized in that The acoustic feature determination unit second determination unit comprises: A third fusion unit is configured to fuse the emotional text feature with the fundamental frequency feature of each phoneme in the phoneme sequence to obtain a first fused text feature; a predicted energy feature determination unit, configured to execute inputting the first fused text feature into the energy prediction network of the acoustic feature model to obtain a predicted energy feature of each phoneme in the phoneme sequence; A third acquisition unit is configured to acquire an input energy adjustment value and a preset energy adjustment method; The third adjustment unit is configured to adjust the predicted energy feature of each phoneme in the phoneme sequence according to the energy adjustment value and the preset energy adjustment method to obtain the energy feature of each phoneme in the phoneme sequence.
10. The speech synthesis device according to claim 6, It is characterized in that The text feature determination unit comprises: A third determining unit is configured to determine characters of a non-preset language in the text to be synthesized based on regular expression rules; A conversion unit, configured to convert the characters in the non-preset language into characters in the preset language to obtain a converted text to be synthesized; A fourth determining unit is configured to determine the converted phoneme sequence of the to-be-synthesized text; The encoding unit is configured to execute the text encoding network of inputting the phoneme sequence into the acoustic feature model to obtain the text feature.
11. An electronic device, It is characterized in that include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the speech synthesis method as described in any one of claims 1 to 5.
12. A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the speech synthesis method as described in any one of claims 1 to 5.
