Speech synthesis method and related product
By obtaining phoneme coding features and discrete features of reference audio for speech style coding, the problems of low speech synthesis quality and mispronunciation in the existing technology are solved, and high-quality speaker style transfer and emotional expression are achieved.
Patent Information
- Application Number
- CN202410156764.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-02
- Publication Date
- 2024-09-17
AI Technical Summary
Existing speech synthesis technology is difficult to generate high-quality synthesized speech, especially in terms of speaker style transfer, where there are problems with pronunciation errors and low synthesis quality.
By obtaining the phoneme coding features of the text to be synthesized and the reference audio with the target audio style, feature extraction and style coding are performed, and discrete features are used to determine the voice style to achieve audio style migration and reduce the impact of the reference audio content on the synthesized speech.
It improves the quality of speech synthesis, achieves synthesized speech that is closer to the reference audio style, reduces pronunciation errors, and enhances the expression of the speaker's emotional style.
Smart Images

Figure CN118658449A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of audio processing, and in particular to a speech synthesis method and related products. Background Art
[0002] With the development of computer technology, audio processing technology has emerged, which can realize the processing and synthesis of voice data, such as generating synthesized speech in different speaker styles. The process of generating synthesized speech in different speaker styles is also called speech synthesis. As the name suggests, speech synthesis (Text To Speech) is the synthesis of input text into human speech that can be played. The processing process can be understood as the reverse process of speech recognition. With the continuous development of smart terminals, the application prospects of speech synthesis have become more extensive, and speech synthesis technology has become particularly important. For example, in the intelligent customer service scenario, speech synthesis technology can be used to synthesize customer service speech to provide services to users; in the intelligent reading scenario, speech synthesis technology can be used to synthesize book content into speech for playback. In this way, a speech synthesis method that can synthesize high-quality speech is urgently needed. Summary of the invention
[0003] Based on this, it is necessary to provide a speech synthesis method and related products that can improve the quality of speech synthesis in response to the above technical problems.
[0004] In a first aspect, the present application provides a speech synthesis method, comprising:
[0005] Obtain reference audio with a target audio style, and obtain phoneme encoding features of the text to be synthesized;
[0006] Predicting the audio attribute features of the text to be synthesized based on the phoneme encoding features;
[0007] Extracting features from the reference audio to obtain discrete features of the reference audio, and determining the speech style based on the discrete features to obtain style coding features;
[0008] Decoding is performed according to the audio attribute features and the style coding features to obtain synthesized speech of the text to be synthesized, and the synthesized speech has a target audio style.
[0009] In a second aspect, the present application further provides a speech synthesis device, comprising:
[0010] An acquisition module, used to acquire reference audio with a target audio style and to acquire phoneme coding features of a text to be synthesized;
[0011] A prediction module, used for predicting the audio attribute features of the phoneme sequence based on the phoneme coding features;
[0012] The acquisition module is further used to extract features from the reference audio to obtain discrete features of the reference audio, and determine the speech style based on the discrete features to obtain style coding features;
[0013] A synthesis module is used to perform decoding processing according to the audio attribute features and the style coding features to obtain a synthesized speech of the text to be synthesized, wherein the synthesized speech has a target audio style.
[0014] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0015] Obtain reference audio with a target audio style, and obtain phoneme encoding features of the text to be synthesized;
[0016] Predicting the audio attribute features of the text to be synthesized based on the phoneme encoding features;
[0017] Extracting features from the reference audio to obtain discrete features of the reference audio, and determining the speech style based on the discrete features to obtain style coding features;
[0018] Decoding is performed according to the audio attribute features and the style coding features to obtain synthesized speech of the text to be synthesized, and the synthesized speech has a target audio style.
[0019] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0020] Obtain reference audio with a target audio style, and obtain phoneme encoding features of the text to be synthesized;
[0021] Predicting the audio attribute features of the text to be synthesized based on the phoneme encoding features;
[0022] Extracting features from the reference audio to obtain discrete features of the reference audio, and determining the speech style based on the discrete features to obtain style coding features;
[0023] Decoding is performed according to the audio attribute features and the style coding features to obtain synthesized speech of the text to be synthesized, and the synthesized speech has a target audio style.
[0024] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0025] Obtain reference audio with a target audio style, and obtain phoneme encoding features of the text to be synthesized;
[0026] Predicting the audio attribute features of the text to be synthesized based on the phoneme encoding features;
[0027] Extracting features from the reference audio to obtain discrete features of the reference audio, and determining the speech style based on the discrete features to obtain style coding features;
[0028] Decoding is performed according to the audio attribute features and the style coding features to obtain synthesized speech of the text to be synthesized, and the synthesized speech has a target audio style.
[0029] The above-mentioned speech synthesis method and related products, on the one hand, predict based on the phoneme coding features of the text to be synthesized to obtain the audio attribute features of the text to be synthesized. On the other hand, feature extraction is performed on the reference audio with the target audio style to obtain discrete features, and the speech style is determined based on the discrete features to obtain style coding features. In this way, decoding processing is performed based on the audio attribute features and the style coding features, and a synthesized speech with the same audio style as the reference audio can be obtained, thereby realizing the transfer of the speaker's style. In the present application, the discrete features of the reference audio are used when determining the style coding features. Since the discrete features can well express the audio characteristics of the reference audio itself, the style coding features that are closer to the audio style of the reference audio can be obtained with the help of the discrete features. This method can better focus on the speaker's emotional style. In this way, the synthesized audio obtained by decoding according to the audio attribute features and the style coding features can well realize the transfer of audio style and greatly improve the quality of speech synthesis. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] FIG1 is a diagram showing an application environment of a speech synthesis method according to an embodiment;
[0032] Figure 2 is a flowchart of a speech synthesis method in one embodiment;
[0033] Figure 3 A schematic diagram of the structure of a speech synthesis model in one embodiment;
[0034] Figure 4A schematic flow chart of the steps of encoding discrete features to obtain style embedding features in one embodiment;
[0035] Figure 5 A network structure diagram of a reference encoder in one embodiment;
[0036] Figure 6 A flowchart of the training steps of a speech synthesis model in one embodiment;
[0037] Figure 7 An application architecture diagram of a speech synthesis method in an embodiment;
[0038] Figure 8 A schematic diagram of the structure of a speech synthesis model in another embodiment;
[0039] Fig. 9 is a structural block diagram of a speech synthesis device in one embodiment;
[0040] FIG. 10 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] For ease of understanding, before describing in detail the speech synthesis method provided in this application, some of the nouns involved in this application are explained first:
[0043] FastSpeech2: is an end-to-end TTS (Text to Speech) model based on Transformer. Based on FastSpeech1 (a fast speech model), FastSpeech2 (a fast speech model) abandons the Teacher-Student knowledge distillation framework to reduce training complexity, directly uses real speech data as the training target to avoid information loss, and introduces more accurate duration information and other variable information in speech, such as pitch, volume, etc. to improve the quality of synthesized speech.
[0044] Transformer: It is a time series model based on the self-attention mechanism. It can effectively encode time series information in the encoder part. Its processing ability of time series information is much better than LSTM (Long Short-Term Memory) and its speed is fast. It is widely used in natural language processing, computer vision, machine translation, speech recognition and other fields.
[0045] In the field of natural language processing, there are often scenarios that require synthesized speech. For example, in intelligent customer service scenarios, speech synthesis technology can be used to synthesize customer service speech to provide services to users; in intelligent reading scenarios, speech synthesis technology can be used to synthesize book content into speech for playback, etc. When synthesizing speech, speech style transfer is involved. For speech style transfer tasks, traditional solutions usually require the introduction of a network structure that includes an encoder. When training this network structure, its input can be a phoneme sequence and a Mel-spectrogram corresponding to the phoneme sequence. Accordingly, when predicting, the Mel-spectrogram of the audio of the speaker belonging to the target style needs to be used as one of the inputs.
[0046] However, this method does not fully decompose the speaker's Mel-spectrogram into style features and retains the content feature information of the audio, which may cause the synthesized speech to have pronunciation errors and low synthesis quality.
[0047] In view of this, the present application provides a speech synthesis method. On the one hand, prediction is performed based on the phoneme coding features of the text to be synthesized to obtain the audio attribute features of the text to be synthesized. On the other hand, feature extraction is performed on the reference audio with the target audio style to obtain discrete features, and the speech style is determined based on the discrete features to obtain style coding features. In this way, decoding processing is performed based on the audio attribute features and the style coding features, and a synthesized speech with the same audio style as the reference audio can be obtained, thereby realizing the transfer of the speaker's style. In the present application, the discrete features of the reference audio are used when determining the style coding features. Since the discrete features can well express the audio characteristics of the reference audio itself and can reduce the attention to the audio content of the reference audio, the style coding features that are closer to the audio style of the reference audio can be obtained with the help of the discrete features. This method can better focus on the emotional style of the speaker. In this way, the synthesized audio obtained by decoding according to the audio attribute features and the style coding features can well realize the transfer of the audio style and greatly improve the quality of speech synthesis.
[0048] Furthermore, the present application uses discrete features of the reference audio, rather than the Mel spectrum, when encoding the style features. Compared to extracting the style encoding features of the reference audio through the Mel spectrum, this method can better focus on the speaker's emotional style, and can avoid the situation where the synthesized speech has pronunciation errors due to the Mel spectrum retaining the content feature information of the audio. Therefore, the speech synthesis method of the present application can not only achieve style transfer, but also reduce the situation where the pronunciation of the synthesized speech is misguided by the audio content of the reference audio, avoid the phenomenon of incorrect pronunciation, and greatly improve the quality of speech synthesis.
[0049] The speech synthesis method of the present application is described in detail below. First, in order to better understand the speech synthesis method, apparatus, computer device and storage medium provided in the embodiment of the present application, the application environment applicable to the embodiment of the present application is described below.
[0050] Please refer to Figure 1, which shows a schematic diagram of an application environment of a speech synthesis method provided by an embodiment of the present application. Among them, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on a cloud or other network server. The speech synthesis method of the present application can be implemented by the terminal and the server in collaboration, or it can be implemented by the terminal or the server alone. For example, the terminal can send the phoneme sequence corresponding to the text to be synthesized to the server, and the server obtains a reference audio with a target audio style, and obtains the phoneme coding features of the text to be synthesized; based on the phoneme coding features, the audio attribute features of the text to be synthesized are predicted; the reference audio is feature extracted to obtain discrete features of the reference audio, and the voice style is determined based on the discrete features to obtain the style coding features; decoding is performed according to the audio attribute features and the style coding features to obtain the synthesized speech of the text to be synthesized, and the synthesized speech has the target audio style, and the server feeds the synthesized speech back to the terminal.
[0051] The network is used to provide a medium for a communication link between the terminal 102 and the server 104. The network may include various connection types, such as a wired communication link, a wireless communication link, etc., which are not limited in the present embodiment. It should be understood that the terminal 102, the network, and the server 104 in FIG. 1 are merely illustrative. Any number of terminals, networks, and servers may be provided as required.
[0052] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0053] In an exemplary embodiment, Figure 2 As shown, a speech synthesis method is provided, and the method is applied to a computer device (the computer device may be a terminal or a server in FIG. 1 ) as an example for description, including the following steps 202 to 210. Among them:
[0054] Step 202, obtaining reference audio with a target audio style, and obtaining phoneme coding features of the text to be synthesized.
[0055] The audio style is the style of the sound corresponding to the audio data, such as sound rhythm, pronunciation characteristics, speaking speed, pitch, volume, pause habits, articulation habits, etc. The target audio style is the audio style expected to be synthesized in this speech synthesis. The reference audio is the audio with the target audio style.
[0056] Phoneme encoding features are features obtained by encoding the phoneme sequence of the text to be synthesized. A phoneme sequence is a sequence of multiple phonemes in order. Phonemes, also known as phonemes, are the smallest phonetic units that distinguish words. In Chinese speech, phonemes can be pinyin and rhythm, and rhythm is the length of pauses between words.
[0057] The following illustrates a phoneme sequence, such as: han2 guo2 7 zui4 da4 de5 7 dao6 yu6 7 ji3 zhou1 dao3. The 2 after the pinyin han2 is the tone, 1 for the first tone, 2 for the second tone, 3 for the third tone, 4 for the fourth tone, 5 for the light tone, and 6 for the altered tone. The numbers 7, 8, and 9 represent the length of the rhythmic pauses, 7 for a shorter pause, 9 for a longer pause, and 8 for the middle.
[0058] Specifically, when speech synthesis is required, the computer device may obtain a phoneme sequence of the text to be synthesized, and then perform a first encoding process on the phoneme sequence to obtain a phoneme encoding feature.
[0059] In some embodiments, a first encoding process is performed on a phoneme sequence to obtain a phoneme encoding feature, including: extracting a phoneme embedding feature of the phoneme sequence, performing position encoding according to the phoneme embedding feature, and performing text encoding based on the phoneme embedding feature and the position encoded feature to obtain the phoneme encoding feature.
[0060] In some embodiments, the speech synthesis method of the present application can be performed by a speech synthesis model, which is a model improved based on FastSpeech2. Figure 3 , Figure 3 FIG. 1 is a schematic diagram of the structure of a speech synthesis model in an embodiment. Figure 3 As shown in the figure, the speech synthesis model, like FastSpeech2, includes a phoneme embedding module (phoneme Embedding), a positional encoding (positional encoding), an encoder (encoder), a variable information adapter (Variance Adaptor) and a decoder (Mel-spectrogram Decoder).
[0061] Among them, the phoneme embedding module is used to perform word embedding processing on the input phoneme sequence to obtain the text information between each phoneme in the phoneme sequence. The position encoder is used to obtain the position information in the phoneme sequence. The encoder can learn the text information between higher-level phonemes, such as syntax. The variable information adapter contains many predictors to predict duration, pitch and energy. After being processed by the variable information adapter, the phoneme sequence will be mapped into an audio attribute feature with the same length as the Mel spectrogram. Then the decoder processes based on the audio attribute features, learns richer information, and predicts the Mel spectrogram, which is the synthesized audio.
[0062] Combination Figure 3 In some embodiments, the phoneme embedding module of the speech synthesis model extracts the phoneme embedding features of the phoneme sequence, and the phoneme embedding features are input into the position encoder for position encoding to obtain the position encoded features. The phoneme embedding features and the position encoded features are then input into the encoder for text encoding to obtain the phoneme encoding features.
[0063] Step 204: predicting audio attribute features of the text to be synthesized based on the phoneme coding features.
[0064] The audio attribute feature is a feature used to represent the audio attribute, and the audio attribute may specifically be pitch, energy, and duration.
[0065] Specifically, the computer device can further process based on the phoneme coding features through the variable information adapter (VarianceAdaptor) in the speech synthesis model to obtain audio attribute features. In some embodiments, the Variance Adaptor contains many predictors to predict audio attributes such as duration, pitch, and energy, and then fuses the features output by multiple predictors to obtain audio attribute features.
[0066] Step 206: extract features from the reference audio to obtain discrete features of the reference audio.
[0067] The audio coding module may specifically be a pre-trained audio coding model, or a pre-trained audio codec model.
[0068] Discrete features (also called discrete codes) are features obtained after encoding the reference audio. The discrete features can be obtained by extracting features from the reference audio by an audio encoding module, or by processing the sample audio by any other model capable of extracting audio features, which is not limited in the embodiments of the present application. Specifically, the audio encoding module can be a pre-trained audio encoding model, or an encoder in a pre-trained audio codec model.
[0069] In some embodiments, the audio encoding module extracts features from the reference audio to obtain discrete features of the reference audio. The audio encoding module is trained by speech samples of a preset scale. The preset scale may specifically be a sample quantity greater than a preset quantity, or a sample quantity greater than a preset order of magnitude, which may be referred to as a large-scale sample quantity.
[0070] Since the retraining process of the audio coding module compresses the original speech sample into sample discrete features, and then generates the original audio sample based on the sample discrete features, the discrete features extracted by the audio coding module also have rich acoustic information, such as speech speed and rhythm, which can well express the audio characteristics of the reference audio itself, and can reduce the focus on the audio content of the reference audio. Therefore, with the help of discrete features, style coding features that are closer to the audio style of the reference audio can be obtained, which can better focus on the speaker's emotional style, so that in the subsequent decoding process, it can not only achieve the transfer of speech style, but also reduce the situation where the audio content of the reference audio leads to the pronunciation of the synthesized speech. It can avoid the phenomenon of incorrect pronunciation and greatly improve the quality of speech synthesis.
[0071] In some embodiments, the audio coding module may specifically be an encoder in an audio coding model, which is a neural network model including an encoder and a decoder, such as an Encodec model (an audio coding model). In this way, the discrete features extracted by the audio coding module obtained through large-scale speech sample training are used for style coding. Compared with extracting the style coding features of the reference audio through the Mel spectrum, this method can better focus on the speaker's emotional style.
[0072] In some embodiments, a large-scale voice sample can be acquired in advance, and these voice samples contain voice data of various styles, and then the audio codec model can be trained by the large-scale voice samples. During the training process, the voice sample can be input into the audio codec model, and the voice sample can be compressed into sample discrete features by the encoder in the audio codec model, and then the sample discrete features can be decoded into predicted speech by the decoder in the audio codec model, and the model weight is adjusted by comparing the difference between the voice sample and the predicted speech to train the audio codec model, and the training is stopped when the training stop condition is reached to obtain a trained audio codec model. Among them, the training stop condition can specifically be that the model performance reaches the preset performance requirements, reaches the preset number of iterations, or reaches the preset training duration, etc., and the embodiments of the present application do not limit this.
[0073] In some embodiments, the computer device can directly obtain an audio codec model that is publicly available on the Internet and trained with speech samples of a preset scale.
[0074] In some embodiments, the computer device can encode the reference audio through the encoder in the trained audio codec model to obtain the corresponding discrete features. Since the audio codec model training process compresses the original speech sample into sample discrete features and then generates the original audio sample based on the sample discrete features, the discrete features extracted by the audio codec model also have rich acoustic information, such as speech speed and rhythm.
[0075] Step 208: Determine the speech style based on the discrete features to obtain style coding features.
[0076] Specifically, the computer device may determine the style encoding feature based on the discrete features.
[0077] In some embodiments, the computer device may directly use the discrete feature as the style coding feature, or perform linear and / or nonlinear transformation on the discrete feature to obtain the style coding feature.
[0078] In some embodiments, please refer to Figure 3 The computer device can encode the discrete feature through a reference encoder to obtain a style embedding feature, and obtain a style encoding feature based on the style embedding feature.
[0079] In some embodiments, the computer device may also obtain a designated speaker identifier, obtain an identifier embedding feature based on the speaker identifier, fuse the style embedding feature and the identifier embedding feature, and obtain the style encoding feature. The specific fusion method may be addition, weighting, or concatenation, which is not limited in the embodiments of the present application.
[0080] Step 210 , performing decoding processing according to the audio attribute features and the style coding features to obtain synthesized speech of the text to be synthesized, wherein the synthesized speech has the target audio style.
[0081] Specifically, the computer device can perform decoding processing according to the audio attribute features and the style coding features to obtain a synthesized speech, wherein the speech content of the synthesized speech is the content specified by the phoneme sequence, and the audio style of the synthesized speech is the audio style of the reference audio.
[0082] In some embodiments, the computer device may input the audio attribute features and the style coding features into a decoder, learn richer information through the decoder, obtain a predicted Mel-spectrogram, and determine the synthesized speech based on the predicted Mel-spectrogram.
[0083] In some embodiments, reference Figure 3 The computer device can input the audio attribute features and style coding features into the position encoder of the speech synthesis model and then input them into the decoder to obtain the predicted Mel-spectrogram, and determine the synthesized speech according to the predicted Mel-spectrogram.
[0084] In the above embodiments, on the one hand, prediction is performed based on the phoneme coding features of the text to be synthesized to obtain the audio attribute features of the text to be synthesized. On the other hand, feature extraction is performed on the reference audio with the target audio style to obtain discrete features, and the voice style is determined based on the discrete features to obtain style coding features. In this way, decoding processing is performed based on the audio attribute features and the style coding features, and a synthesized speech with the same audio style as the reference audio can be obtained, thereby realizing the transfer of the speaker's style. In the present application, the discrete features of the reference audio are used when determining the style coding features. Since the discrete features can well express the audio characteristics of the reference audio itself, the style coding features that are closer to the audio style of the reference audio can be obtained with the help of the discrete features. This method can better focus on the emotional style of the speaker. In this way, the synthesized audio obtained by decoding according to the audio attribute features and the style coding features can well realize the transfer of audio style and greatly improve the quality of speech synthesis.
[0085] In some embodiments, speech style is determined based on discrete features to obtain style coding features, including: encoding discrete features to obtain style embedding features; obtaining an identifier of a speaker with a target timbre, and characterizing the speaker's identifier to obtain an identifier embedding feature; and fusing the style embedding feature and the identifier embedding feature to obtain a style coding feature.
[0086] Specifically, the computer device can obtain the identifier of the designated speaker by looking up the table, and the designated speaker has the target timbre. The computer device can perform word embedding processing on the identifier of the speaker to obtain the corresponding identifier embedding feature. Among them, the identifier of the speaker is used to uniquely identify the speaker, and can specifically be a letter, a number, or a character. In some embodiments, the identifier of the designated speaker can be determined from the identifiers of multiple preset speakers, and these multiple preset speaker identifiers will participate in the training process of the speech synthesis model.
[0087] In some embodiments, the identifiers of multiple preset speakers will participate in the training of the speech synthesis model, specifically as follows: N speakers are pre-selected as samples, and for any speaker, the M audios of the speaker are respectively used as sample audios, so that N*M sample audios are obtained. Wherein, N and M are both natural numbers greater than or equal to 1. For each sample audio, the computer device can obtain the sample phoneme sequence of the sample audio, the sample discrete features corresponding to the sample audio, and the sample spectrogram of the sample audio. Then, the computer device can encode the sample phoneme sequence to obtain the sample phoneme coding features, and predict the sample audio attribute features of the sample phoneme sequence based on the sample phoneme coding features. The computer device can input the sample discrete features and the sample identifier embedding features of the speaker into the speech synthesis model to be trained, encode the discrete features through the speech synthesis model to be trained, obtain the sample style embedding features, and fuse the sample style embedding features and the sample identifier embedding features to obtain the sample style encoding features. Then, decoding processing is performed according to the sample audio attribute features and the sample style encoding features to obtain the predicted speech. The speech synthesis model to be trained is trained based on the predicted speech and the sample spectrogram. After the training is completed, the computer device will save the identifiers corresponding to the N speakers involved in the training process for use in subsequent speech synthesis.
[0088] By training the speech synthesis model in the above manner, the speech synthesis model can learn the ability to use the audio style of discrete features as the audio style of synthesized speech during the training process, and can also learn the timbre features corresponding to the speaker's identifier based on the speaker's sample audio, and learn the ability to apply the timbre features corresponding to the speaker's identifier in the synthesized speech. In this way, when the trained synthesized speech model decodes the style coding features that integrate the identifier embedding features and the style embedding features, it can synthesize synthesized speech with the target audio style and target timbre, making the synthesized audio closer to the real human voice, greatly improving the quality of speech synthesis.
[0089] The computer device encodes the discrete features to obtain style embedding features. Figure 3In some embodiments, the computer device may encode the discrete features through a reference encoder of the speech synthesis model to obtain a style embedding feature. Then, the computer device fuses the style embedding feature and the identifier embedding feature to obtain a style encoding feature. For example, the computer device may add the style embedding feature and the identifier embedding feature to obtain a style encoding feature.
[0090] In the above embodiment, by fusing the style embedding feature with the identification embedding feature corresponding to the speaker identification to obtain the style coding feature, the audio style of the subsequently predicted synthesized speech can be made the audio style of the reference audio, and the timbre of the synthesized speech can be made the timbre indicated by the speaker identification.
[0091] refer to Figure 4 In some embodiments, the discrete features are encoded to obtain style embedding features, including:
[0092] Step 402 , performing dimension transformation on the discrete features, and extracting channel dimension features and time dimension features from the discrete features after the dimension transformation.
[0093] Specifically, the computer device may perform linear changes on the discrete features to achieve the effect of dimensional transformation, and then extract channel dimensional features and time dimensional features from the discrete features after dimensional transformation. In some embodiments, the computer device may extract local features from the discrete features after dimensional transformation, and perform pooling processing based on the extracted local features to obtain channel dimensional features.
[0094] In some embodiments, the computer device may perform one or more one-dimensional convolutions on the discrete features after the dimensional transformation and then activate them to extract local features. Alternatively, the computer device may perform multi-dimensional convolutions on the discrete features after the dimensional transformation and then activate them to extract local features.
[0095] In some embodiments, the computer device may perform average pooling or maximum pooling processing based on the extracted local features to obtain channel dimension features.
[0096] In the above embodiment, by extracting local features of the discrete features after dimensional transformation and performing pooling processing according to the extracted local features, significant features in the channel dimension can be extracted.
[0097] In some embodiments, the computer device may perform pooling processing on the discrete features after dimensional transformation, such as average pooling or maximum pooling processing, to obtain time dimension features. The time dimension features are significant features in the time dimension, and the features in the time dimension are very critical feature information in speech.
[0098] Step 404: Fuse the channel dimension features and the time dimension features, and perform pooling processing on the fused features to obtain style embedding features.
[0099] Specifically, the computer device may perform a dot product of the channel dimension feature and the time dimension feature to achieve fusion. Alternatively, the computer device may add the channel dimension feature and the time dimension feature to achieve fusion.
[0100] The computer device may add the fused features and the discrete features after dimensional transformation and then perform pooling processing to obtain the style embedding features. In some embodiments, the computer device may multiply the fused features and the discrete features after dimensional transformation and then perform maximum pooling processing to obtain the style embedding features.
[0101] For example, please refer to Figure 5 , Figure 5 FIG. 1 is a network structure diagram of a reference encoder in an embodiment. Figure 5 As shown in the figure, the reference encoder mainly includes linear layers, convolution + activation (such as Conv1D + ReLU, of course, complex structures such as Transformer and VGG16 can also be used) and multiple pooling layers (such as maximum pooling Maxpooling, or mean pooling Meanpooling, etc.). Figure 5 The reference encoder in can process feature information in time and channel dimensions, among which the feature information in the time dimension is very critical feature information in speech. The following is a detailed explanation through an example:
[0102] Discrete feature Discrete code: {batch_size, time, channel} (where batch_size refers to the batch size, time refers to the length of the discrete feature, and channel refers to the channel information). Figure 5 The result after the linear layer in , that is, the first intermediate feature is: {batch_size, time, channel1}. The linear layer mainly transforms the dimension.
[0103] Figure 5 The left branch:
[0104] The features output by the linear layer are input to the convolution + activation layer, and the output result is: {batch_size, time, channel2}. The main function of the one-dimensional convolution + activation layer is to extract local features and transform the dimension. It should be noted that channel1=channel2 in this application. The output of the one-dimensional convolution + activation layer is then input to the pooling layer, and the channel dimension features are output: {batch_size, time, 1}. The main function of the MaxPooling layer is to extract the most significant features in the channel dimension.
[0105] Figure 5 The right branch:
[0106] The features output by the linear layer are input to the pooling layer, and the pooling layer outputs the time dimension features: {batch_size,1,channel1}. The main function of the pooling layer is to extract the most significant features in the time dimension. It should be noted that the pooling layer in the right branch swaps the order of the second and third dimensions in the features before and after processing.
[0107] Next, the computer device can perform feature point multiplication on the channel dimension features output by the left branch and the time dimension features output by the right branch to obtain fused features of dimension {batch_size, time, channel1}, and add the fused features to the features output by the linear layer, and input them to the pooling layer to obtain style embedding features of dimension {batch_size, 1, channel1}. Here, the purpose of adding the fused features to the discrete features after dimensional transformation is to introduce the discrete features after dimensional transformation as prior features, which can make the model training process more stable.
[0108] In the above embodiment, in the process of encoding discrete features, the features of the discrete features in the channel dimension and the features in the time dimension are extracted and then fused and pooled, so that the encoded style embedding features can better represent the speech style of the reference audio.
[0109] In some embodiments, decoding processing is performed according to audio attribute features and style coding features to obtain synthesized speech of the text to be synthesized, including: obtaining a duration attribute latent feature generated in the process of predicting the audio attribute features based on the phoneme coding features, and positionally encoding the duration attribute latent feature to obtain an encoding result; the duration attribute latent feature refers to a feature representation of the pronunciation duration of each phoneme in the phoneme sequence of the text to be synthesized; according to the encoding result and the style coding features, the audio attribute features are decoded to obtain the synthesized speech of the text to be synthesized.
[0110] Specifically, in the process of predicting audio attribute features, the computer device predicts the hidden features of each attribute. The computer device can obtain the hidden features representing the duration attribute generated in this process, that is, the duration attribute hidden features, and position encode the duration attribute hidden features to obtain the encoding result. The same phonemes representing different meanings at different positions in the encoding result have different encoding information corresponding to them, that is, the encoding result includes the encoding information corresponding to the phonemes at each position in the phoneme sequence, wherein different encoding information corresponds to the same phonemes representing different meanings at different positions. Then, according to the encoding result and the style encoding features, the audio attribute features can be decoded to obtain the synthesized speech of the text to be synthesized.
[0111] In some embodiments, the present application additionally designs a duration position encoder (Duration Positional Encoding) for position encoding of latent features representing duration attributes. The internal structure and processing logic of the Duration Positional Encoding are consistent with the Positional Encoding mentioned above, except that the processed input is different. The Duration Positional Encoding input is the duration attribute latent feature, and the output is the encoding result. It can be understood that when the same person reads the same word in a text, the meaning of the word is different, and the pronunciation duration of the word will also be different, which is mainly reflected in the pronunciation duration corresponding to different positions. Therefore, adding Duration Positional Encoding can better predict the pronunciation duration of phonemes, making the synthesized speech more natural.
[0112] In the above embodiment, a position encoding module is introduced to perform position encoding on latent features representing duration attributes, which can better predict the pronunciation duration of factors and make the synthesized speech more natural.
[0113] In some embodiments, according to the encoding results and style encoding features, the audio attribute features are decoded to obtain the synthesized speech of the text to be synthesized, including: fusing the encoding results, audio attribute features and style encoding features to obtain fused features; position encoding the fused features and performing Mel-spectrogram decoding on the position encoding results to obtain the synthesized speech of the text to be synthesized.
[0114] Specifically, the computer device may fuse the encoding result, the audio attribute feature, and the style encoding feature to obtain a fused feature, perform position encoding based on the fused feature, and then perform Mel spectrum decoding to obtain synthesized speech. The specific method of fusion may be addition, concatenation, or dot multiplication, etc., which is not limited in the embodiments of the present application.
[0115] In an exemplary embodiment, the computer device may add the encoding result, the audio attribute feature, and the style encoding feature and send them to a position encoder for position encoding, and then send the position encoding result to a Mel spectrum decoder for decoding to obtain synthesized speech.
[0116] In the above embodiment, the encoding result obtained by introducing the position encoding of the duration attribute latent feature during decoding can better predict the text duration during speaking, making the synthesized speech more natural.
[0117] In some embodiments, according to the encoding results and style encoding features, the audio attribute features are decoded to obtain the synthesized speech of the text to be synthesized, including: fusing the encoding results, audio attribute features and style encoding features to obtain fused features; position encoding the fused features, and performing Mel-spectrogram decoding on the position encoding results and the audio attribute features to obtain the synthesized speech of the text to be synthesized.
[0118] Specifically, the computer device may fuse the encoding result, the audio attribute feature, and the style encoding feature to obtain a fused feature, perform position encoding based on the fused feature, perform Mel spectrum decoding on the position encoding result and the audio attribute feature, and obtain synthesized speech. The specific method of fusion may be addition, concatenation, or dot multiplication, etc., which is not limited in the embodiments of the present application.
[0119] In an exemplary embodiment, the computer device may add the encoding result, the audio attribute feature, and the style encoding feature and send them to the position encoder for position encoding, and then send them to the Mel spectrum decoder. At the same time, the audio attribute feature is also sent to the Mel spectrum decoder for decoding, and the synthesized speech is output through the Mel spectrum decoder.
[0120] In the above embodiment, the encoding result obtained by position encoding the duration attribute latent feature during decoding can better predict the text duration during speaking, making the synthesized speech more natural. In addition, in addition to using the position encoding result obtained by position encoding based on the fusion feature during decoding, the audio attribute feature is also used, which can make the content of the synthesized speech obtained by decoding closer to the content of the phoneme sequence.
[0121] In some embodiments, the method is performed by a speech synthesis model, which is improved based on the FastSpeech2 model. The model structure of the speech synthesis model in the present application is to add a reference encoder and a duration positional encoding while keeping the original FastSpeech2 network structure unchanged.
[0122] In some embodiments, reference Figure 6 , the training steps of the speech synthesis model include:
[0123] Step 602: Obtain a sample phoneme sequence of the sample audio, a sample discrete feature corresponding to the sample audio, and a sample spectrogram of the sample audio.
[0124] The sample phoneme sequence is a phoneme sequence corresponding to the sample audio and used as a training sample. The sample discrete feature is a discrete feature extracted from the sample audio. The sample spectrogram is a Mel-spectrogram of the sample audio.
[0125] In some embodiments, during the training phase, the computer device may input a data pair of <sample phoneme sequence, sample discrete feature, sample spectrogram> into a speech synthesis model to be trained.
[0126] In some embodiments, N speakers are pre-selected as samples. For any speaker, the computer device may use the M audios of the speaker as sample audios, thus obtaining N*M sample audios. For each sample audio, the computer device may obtain a sample phoneme sequence of the sample audio, a sample discrete feature corresponding to the sample audio, and a sample spectrogram of the sample audio.
[0127] In some embodiments, the sample discrete features can be obtained by extracting features from the sample audio by an audio coding module, or by processing the sample audio by any other model capable of extracting audio features, which is not limited in the embodiments of the present application. The audio coding module can specifically be a pre-trained audio coding model, or an encoder in a pre-trained audio codec model.
[0128] Step 604: the speech synthesis model to be trained encodes the sample phoneme sequence to obtain sample phoneme encoding features, and predicts sample audio attribute features of the sample phoneme sequence based on the sample phoneme encoding features.
[0129] The speech synthesis model to be trained includes a phoneme embedding module, a position encoder, an encoder, and a variable information adapter. Specifically, the computer device can extract the sample phoneme embedding features of the sample phoneme sequence through the phoneme embedding module in the speech synthesis model to be trained, input the sample phoneme embedding features into the position encoder for position encoding, and obtain the position encoded features. Then, the sample phoneme embedding features and the position encoded features are input into the encoder for text encoding to obtain the sample phoneme encoding features. The sample phoneme encoding features are further processed by the variable information adapter to obtain the sample audio attribute features.
[0130] Step 606: The speech synthesis model to be trained determines the sample style coding features based on the sample discrete features.
[0131] Specifically, the computer device can input the sample discrete features into the speech synthesis model to be trained for processing to obtain the sample style coding features.
[0132] In some embodiments, the speech synthesis model to be trained can encode the discrete features of the sample to obtain the sample style embedding features; obtain the identifier of the speaker from which the sample audio comes, and obtain the identifier embedding features based on the speaker identifier; and fuse the sample style embedding features and the identifier embedding features to obtain the sample style encoding features.
[0133] In some embodiments, the computer device may encode the sample discrete features through the reference encoder in the speech synthesis model to be trained to obtain the sample style embedding features. For the network structure and specific processing process of the reference encoder, please refer to the description of the model prediction stage in the above embodiment.
[0134] Step 608: The speech synthesis model to be trained performs decoding processing according to the sample audio attribute features and the sample style coding features to obtain predicted speech.
[0135] Among them, the speech synthesis model to be trained is decoded according to the sample audio attribute characteristics and the sample style coding characteristics to obtain the specific process of predicted speech. Please refer to the relevant description of the speech synthesis model in the aforementioned embodiment that is decoded according to the audio attribute characteristics and the style coding characteristics to obtain the synthesized speech.
[0136] Step 610: training the speech synthesis model to be trained based on the predicted speech and the sample spectrogram.
[0137] Specifically, the computer device can input the predicted speech and the sample spectrogram into the loss function to calculate the loss value, and adjust the model weight of the network model by back propagation so that the difference between the two becomes smaller and smaller, until the training stop condition is reached, and the speech synthesis model is obtained. The loss function can be a cross entropy loss function or a mean square error loss function, etc., and the training stop condition can be that the model performance reaches a preset performance requirement, reaches a preset number of iterations, or reaches a preset training time, etc., which is not limited in the embodiments of the present application.
[0138] In the above embodiment, the network model to be trained is trained by using the sample phoneme sequence of the sample audio, the sample discrete features corresponding to the sample audio, and the sample spectrogram of the sample audio, and after the training is completed, a speech synthesis model that can realize speaker style transfer is obtained.
[0139] Please refer to Figure 7 , Figure 7 FIG. 1 is an application architecture diagram of a speech synthesis method in an embodiment. Figure 7, input the phoneme sequence and discrete features into the speech synthesis model, and output the synthesized speech through the speech synthesis model. Among them, the structural block diagram of the speech synthesis model is as follows Figure 8 shown.
[0140] Combine the following Figure 8 The speech synthesis method of this application is described in detail:
[0141] The phoneme embedding features of the phoneme sequence are extracted through the phoneme embedding module of the speech synthesis model, the phoneme embedding features are positionally encoded through the position encoder, and the phoneme embedding features and the position-encoded features are text-encoded through the encoder to obtain the phoneme encoding features. The phoneme encoding features are processed through the variable information adapter to predict the audio attribute features of the phoneme sequence. The duration attribute latent features generated in the process of predicting the audio attribute features are input into the duration position encoder, and the duration attribute latent features are positionally encoded through the duration position encoder to obtain the encoding result. The discrete features corresponding to the reference audio are obtained, and the discrete features are encoded through the reference encoder to obtain the style embedding features. The identification of the speaker with the target timbre is obtained, and the identification of the speaker is characterized to obtain the identification embedding features. The style embedding features and the identification embedding features are fused to obtain the style encoding features. The encoding results, audio attribute features and style encoding features are fused to obtain the fused features, and the fused features are input into the position encoder for position encoding and then sent to the Mel spectrum decoder, and the synthesized speech is decoded by the Mel spectrum decoder.
[0142] The above-mentioned speech synthesis method adds a reference encoder and a duration position encoder while keeping the original FastSpeech2 network structure unchanged. By encoding the discrete features extracted by the Encodec model with the reference encoder, feature information in the time and channel dimensions can be learned. In addition, by introducing the audio codec model to extract the discrete features of the reference audio, the speaking style of the reference audio can be transferred, and the speaking style is more similar to the style of the source speaker. At the same time, since the discrete features extracted by the audio codec model are more inclined to the audio features of the reference audio itself, the attention to the audio content of the reference audio is weaker, so the negative impact of the audio content of the reference audio can be avoided during speech synthesis, and the phenomenon of incorrect pronunciation of the synthesized speech can be avoided. Moreover, the Encodec model is trained by a large amount of speech data, so it can help improve the generalization ability of the speech synthesis model of the present application. In addition, through the duration position encoder, the pronunciation duration of the phoneme sequence can be accurately modeled, which solves the problem of the same duration of the same word of the same speaker in different texts, so that the same word in different texts will have different pronunciation durations, making the synthesized speech more natural.
[0143] It should be noted that the speech synthesis method provided in the embodiments of the present application can be applied to any scenario where speech synthesis is required and to products applicable to the scenario, such as intelligent reading systems, speech style conversion systems, speech interaction systems, etc.
[0144] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0145] Based on the same inventive concept, the embodiment of the present application also provides a speech synthesis device for implementing the speech synthesis method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more speech synthesis device embodiments provided below can refer to the limitations on the speech synthesis method above, and will not be repeated here.
[0146] In an exemplary embodiment, Fig. 9 As shown, a speech synthesis device 900 is provided, comprising: an acquisition module 901, a prediction module 902 and a synthesis module 903, wherein:
[0147] The acquisition module 901 is used to acquire reference audio with a target audio style and to acquire phoneme coding features of the text to be synthesized.
[0148] The prediction module 902 is used to predict the audio attribute features of the text to be synthesized based on the phoneme coding features.
[0149] The acquisition module 901 is further used to extract features from the reference audio to obtain discrete features of the reference audio, and determine the speech style based on the discrete features to obtain style coding features.
[0150] The synthesis module 903 is used to perform decoding processing according to the audio attribute features and the style coding features to obtain the synthesized speech of the text to be synthesized, and the synthesized speech has the target audio style.
[0151] In one embodiment, the acquisition module is specifically used to encode discrete features to obtain style embedding features; obtain the identifier of a speaker with a target timbre, and perform characterization processing on the speaker's identifier to obtain identifier embedding features; and fuse the style embedding features and the identifier embedding features to obtain style coding features.
[0152] In one embodiment, the acquisition module is specifically used to transform the dimension of discrete features, and extract channel dimension features and time dimension features from the discrete features after the dimension transformation; fuse the channel dimension features and the time dimension features, and pool the fused features to obtain style embedding features.
[0153] In one embodiment, the synthesis module is specifically used to obtain the duration attribute latent feature generated in the process of predicting the audio attribute feature based on the phoneme coding feature, and position encode the duration attribute latent feature to obtain the coding result; the duration attribute latent feature refers to the feature representation of the pronunciation duration of each phoneme in the phoneme sequence of the text to be synthesized; according to the coding result and the style coding feature, the audio attribute feature is decoded to obtain the synthesized speech of the text to be synthesized.
[0154] In one embodiment, the synthesis module is specifically used to fuse the encoding results, audio attribute features and style encoding features to obtain fused features; position encode the fused features, and perform Mel spectrum decoding on the position encoding results to obtain synthesized speech of the text to be synthesized.
[0155] In one embodiment, the synthesis module is specifically used to fuse the encoding results, audio attribute features and style encoding features to obtain fused features; position encode the fused features, perform Mel spectrum decoding on the position encoding results and audio attribute features, and obtain synthesized speech of the text to be synthesized.
[0156] In one embodiment, the device also includes a model training module, which is used to obtain a sample phoneme sequence of sample audio, sample discrete features corresponding to the sample audio, and a sample spectrogram of the sample audio; the speech synthesis model to be trained encodes the sample phoneme sequence to obtain sample phoneme coding features, and predicts sample audio attribute features of the sample phoneme sequence based on the sample phoneme coding features; the speech synthesis model to be trained determines sample style coding features based on the sample discrete features; the speech synthesis model to be trained performs decoding processing according to the sample audio attribute features and the sample style coding features to obtain predicted speech; and the speech synthesis model to be trained is trained based on the predicted speech and the sample spectrogram.
[0157] Each module in the above-mentioned speech synthesis device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0158] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG10. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store voice data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a speech synthesis method is implemented.
[0159] Those skilled in the art will understand that the structure shown in FIG. 10 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0160] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0161] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0162] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0163] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0164] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0165] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0166] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A speech synthesis method, characterized in that: The method comprises: Obtain reference audio with a target audio style and obtain phoneme encoding features of the text to be synthesized; Predicting the audio attribute features of the text to be synthesized based on the phoneme encoding features; Extracting features from the reference audio to obtain discrete features of the reference audio, and determining the speech style based on the discrete features to obtain style coding features; Decoding is performed according to the audio attribute features and the style coding features to obtain synthesized speech of the text to be synthesized, and the synthesized speech has a target audio style.
2. The method according to claim 1, characterized in that The determining of the speech style based on the discrete features to obtain the style coding features includes: Encoding the discrete features to obtain style embedding features; Obtaining an identifier of a speaker with a target timbre, and performing feature processing on the identifier of the speaker to obtain an identifier embedding feature; The style embedding feature and the logo embedding feature are fused to obtain a style encoding feature.
3. The method according to claim 2, characterized in that The encoding process of the discrete features to obtain style embedding features includes: Performing dimension transformation on the discrete features, and extracting channel dimension features and time dimension features from the discrete features after the dimension transformation; The channel dimension feature and the time dimension feature are fused, and the fused features are pooled to obtain a style embedding feature.
4. The method according to claim 1, characterized in that: The decoding process is performed according to the audio attribute feature and the style coding feature to obtain the synthesized speech of the text to be synthesized, including: Acquire a duration attribute latent feature generated in the process of predicting the audio attribute feature based on the phoneme coding feature, and perform position coding on the duration attribute latent feature to obtain a coding result; the duration attribute latent feature refers to a feature representation of the pronunciation duration of each phoneme in the phoneme sequence of the text to be synthesized; The audio attribute feature is decoded according to the encoding result and the style encoding feature to obtain the synthesized speech of the text to be synthesized.
5. The method according to claim 4, characterized in that The decoding process of the audio attribute feature according to the encoding result and the style encoding feature to obtain the synthesized speech of the text to be synthesized includes: fusing the encoding result, the audio attribute feature and the style encoding feature to obtain a fusion feature; Position encoding is performed on the fused features, and Mel spectrum decoding is performed on the position encoding result to obtain the synthesized speech of the text to be synthesized.
6. The method according to claim 4, characterized in that The decoding process of the audio attribute feature according to the encoding result and the style encoding feature to obtain the synthesized speech of the text to be synthesized includes: fusing the encoding result, the audio attribute feature and the style encoding feature to obtain a fusion feature; Position encoding is performed on the fused features, and Mel-spectrogram decoding is performed on the position encoding result and the audio attribute features to obtain synthesized speech of the text to be synthesized.
7. The method according to any one of claims 1 to 6, characterized in that The method is performed by a speech synthesis model, and the training steps of the speech synthesis model include: Acquire a sample phoneme sequence of a sample audio, a sample discrete feature of the sample audio, and a sample spectrogram of the sample audio; The speech synthesis model to be trained encodes the sample phoneme sequence to obtain sample phoneme encoding features, and predicts sample audio attribute features of the sample phoneme sequence based on the sample phoneme encoding features; The speech synthesis model to be trained determines the sample style coding features based on the sample discrete features; The speech synthesis model to be trained performs decoding processing according to the sample audio attribute features and the sample style coding features to obtain predicted speech; The speech synthesis model to be trained is trained based on the predicted speech and the sample spectrogram.
8. A speech synthesis device, characterized in that: The device comprises: An acquisition module, used to acquire reference audio with a target audio style and to acquire phoneme encoding features of a text to be synthesized; A prediction module, used for predicting the audio attribute features of the text to be synthesized based on the phoneme encoding features; The acquisition module is further used to extract features from the reference audio to obtain discrete features of the reference audio, and determine the speech style based on the discrete features to obtain style coding features; A synthesis module is used to perform decoding processing according to the audio attribute features and the style coding features to obtain a synthesized speech of the text to be synthesized, wherein the synthesized speech has a target audio style.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
