Speech synthesis model training method, speech synthesis method, and related apparatuses
By using two sub-models in the speech synthesis model to predict phoneme posterior features and frequency domain features, the problem of difficulty in deploying speech synthesis models in devices with low computing resources in the existing technology is solved, and efficient speech synthesis in terminal devices is achieved. .
Patent Information
- Application Number
- PCT/CN2023/108845
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-09-15
- Filing Date
- 2023-07-24
- Publication Date
- 2024-09-12
AI Technical Summary
Existing speech synthesis models are difficult to deploy in scenarios with low computing resources and consume too much computing power, making it difficult for the models to run on terminal devices.
A speech synthesis model composed of two sub-models is used to obtain the target user's sample phonemes and timbre identifiers, predict the phoneme posterior features and frequency domain features, reduce model parameters, and achieve deployment in devices with low computing resources.
By predicting the posterior characteristics of phonemes and inverse Fourier transform, the model parameters are reduced, the computing consumption is reduced, the speech synthesis model can be effectively deployed in devices with low computing resources, and the stability and performance of the model can be improved.
Smart Images

Figure CN2023108845_12092024_PF_FP_ABST
Abstract
Description
Speech synthesis model training method, speech synthesis method and related device
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on September 15, 2022, with application number 202211121568.X and application name “Training method, speech synthesis method, device and equipment for speech synthesis model”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present invention relates to the field of speech synthesis, and in particular to speech synthesis. Background Art
[0003] Speech synthesis is the process of synthesizing the speech of other texts that matches the user's voice based on the user's recorded speech for part of the text.
[0004] In the related art, a multi-user acoustic model and a vocoder are usually pre-trained. The acoustic model is used to convert text into spectral features that conform to the timbre of a certain user, and the vocoder is used to convert the spectral features into speech signals. Among them, the encoder in the acoustic model is used to model text information, and the decoder in the acoustic model is used to model acoustic information. By using the recording of the target user, the information of the target user can be introduced into the input of the encoder, so that the acoustic model can be fine-tuned, and then the spectral features that conform to the timbre of the target user and correspond to the text can be obtained. Afterwards, the speech signal can be synthesized by the vocoder based on the upsampling structure, thereby obtaining a synthesized speech that conforms to the timbre of the target user and corresponds to the text. For example, the above-mentioned acoustic model is a fast speech (Fastspeech) model, and the vocoder is a high-fidelity generative adversarial network (HifiGAN).
[0005] When performing speech synthesis using the above model, due to the large number of model parameters and high computational complexity, in low-computing resource scenarios such as synthesizing speech in a terminal, the model is difficult to deploy due to the high computational resource consumption.
[0006] Summary of the Invention
[0007] This application provides a speech synthesis model training method, speech synthesis method, apparatus, and device that can reduce the model's computational resources and enable model deployment on low-computing resource devices. The technical solution is as follows:
[0008] According to one aspect of the present application, a method for training a speech synthesis model is provided, the method being executed by a computer device, the method comprising:
[0009] Acquire sample phonemes of a target user and a timbre identifier of the target user, wherein the sample phonemes are determined based on a sample text corresponding to a sample speech of the target user, and the timbre identifier is used to identify the timbre of the target user;
[0010] Inputting the sample phoneme into the first sub-model of the speech synthesis model to obtain predicted phoneme posterior features of the sample phoneme, wherein the predicted phoneme posterior features are used to reflect the features of each phoneme in the sample phoneme and the pronunciation duration features of each phoneme in the sample phoneme;
[0011] Inputting the predicted phoneme posterior feature and the timbre identifier into a second sub-model of the speech synthesis model to obtain a predicted speech corresponding to the sample text and the timbre identifier, wherein the second sub-model obtains the predicted speech by predicting the predicted phoneme posterior feature and a prediction intermediate variable of the predicted speech, wherein the prediction intermediate variable is used to reflect the frequency domain characteristics of the predicted speech;
[0012] The first sub-model is trained according to the predicted phoneme posterior features; and the second sub-model is trained according to the predicted speech and the predicted intermediate variables.
[0013] According to another aspect of the present application, a speech synthesis method is provided. The method is performed by a computer device, wherein the computer device includes the speech synthesis model trained by the method described above. The method includes:
[0014] Acquire a target phoneme of a target user and a timbre identifier of the target user, wherein the target phoneme is determined based on a target text, and the timbre identifier is used to identify the timbre of the target user;
[0015] Inputting the target phoneme into the first sub-model of the speech synthesis model to obtain a phoneme posterior feature of the target phoneme;
[0016] The phoneme posterior features and the timbre identifier are input into a second sub-model of the speech synthesis model to obtain a target speech corresponding to the target text and the timbre identifier.
[0017] According to another aspect of the present application, a device for training a speech synthesis model is provided, the device comprising:
[0018] an acquisition module, configured to acquire sample phonemes of a target user and a timbre identifier of the target user, wherein the sample phonemes are determined based on a sample text corresponding to a sample speech of the target user, and the timbre identifier is used to identify the timbre of the target user;
[0019] an input / output module, configured to input the sample phoneme into the first sub-model of the speech synthesis model to obtain predicted phoneme posterior features of the sample phoneme, wherein the predicted phoneme posterior features are used to reflect the features of each phoneme in the sample phoneme and the pronunciation duration features of each phoneme in the sample phoneme;
[0020] The input-output module is further configured to input the predicted phoneme posterior features and the timbre identifier into a second sub-model of the speech synthesis model to obtain a predicted speech corresponding to the sample text and the timbre identifier, wherein the second sub-model obtains the predicted speech by predicting the predicted phoneme posterior features and a predicted intermediate variable of the predicted speech, wherein the predicted intermediate variable is used to reflect frequency domain features of the predicted speech;
[0021] A training module is used to train the first sub-model according to the predicted phoneme posterior features; and to train the second sub-model according to the predicted speech and the predicted intermediate variables.
[0022] According to another aspect of the present application, a speech synthesis device is provided, wherein the device includes the speech synthesis model trained by the device described in the above aspect, and the device includes:
[0023] An acquisition module, configured to acquire a target phoneme of a target user and a timbre identifier of the target user, wherein the target phoneme is determined based on a target text, and the timbre identifier is used to identify the timbre of the target user;
[0024] An input-output module, configured to input the target phoneme into the first sub-model of the speech synthesis model to obtain a phoneme posterior feature of the target phoneme;
[0025] The input-output module is further configured to input the phoneme posterior features and the timbre identifier into the second sub-model of the speech synthesis model to obtain a target speech corresponding to the target text and the timbre identifier.
[0026] According to another aspect of the present application, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the training method of the speech synthesis model or the speech synthesis method as described above.
[0027] According to another aspect of the present application, a computer-readable storage medium is provided, in which at least one instruction, at least one program, code set or instruction set is stored. The at least one instruction, the at least one program, the code set or instruction set is loaded and executed by a processor to implement the training method of the speech synthesis model or the speech synthesis method as described above.
[0028] According to another aspect of the present application, a computer program product is provided, which includes a computer program. When the computer program product is run on a computer, it enables the computer to execute the speech synthesis model training method or speech synthesis method described in the above aspects.
[0029] The beneficial effects of the technical solution provided by this application include at least:
[0030] By training the aforementioned speech synthesis model, the model can generate a target speech that matches the target user's voice, based on the target user's voice identifier and target text. The target speech synthesis process is achieved by predicting intermediate variables using predicted phoneme posterior features. Because phoneme posterior features contain less information than spectral features, fewer model parameters are required to predict them. This reduces the model's parameters and computational resources, enabling deployment on low-computing-resource devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] FIG1 is a schematic diagram of the structure of a speech synthesis model provided by an exemplary embodiment of the present application;
[0032] FIG2 is a flow chart of a method for training a speech synthesis model according to an exemplary embodiment of the present application;
[0033] FIG3 is a flow chart of a method for training a speech synthesis model according to an exemplary embodiment of the present application;
[0034] FIG4 is a schematic diagram of the structure of a text encoder provided by an exemplary embodiment of the present application;
[0035] FIG5 is a schematic structural diagram of an inverse Fourier transform decoder provided by an exemplary embodiment of the present application;
[0036] FIG6 is a schematic structural diagram of another inverse Fourier transform decoder provided by an exemplary embodiment of the present application;
[0037] FIG7 is a schematic structural diagram of a regularized flow layer provided by an exemplary embodiment of the present application;
[0038] FIG8 is a schematic diagram of the structure of a multi-scale spectrum discriminator provided by an exemplary embodiment of the present application;
[0039] FIG9 is a flow chart of a speech synthesis method provided by an exemplary embodiment of the present application;
[0040] FIG10 is a schematic diagram of the structure of a training device for a speech synthesis model provided by an exemplary embodiment of the present application;
[0041] FIG11 is a schematic structural diagram of a speech synthesis device provided by an exemplary embodiment of the present application;
[0042] FIG12 is a schematic structural diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0044] First, the relevant terms involved in the embodiments of this application are introduced:
[0045] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0046] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0047] Key technologies in speech technology include automatic speech recognition (ASR), text-to-speech (TTS) speech synthesis, and voiceprint recognition. Enabling computers to hear, see, speak, and feel is the future direction of human-computer interaction, with speech becoming one of the most promising methods of human-computer interaction.
[0048] A phone is the smallest speech unit divided according to the natural attributes of speech. Analyzing based on the articulatory movements in a syllable, one movement constitutes one phone. Phones can be divided into two major categories: vowels and consonants. For example, the Chinese syllable "ā" has only one phone, and "ài" has two phones.
[0049] Figure 1 is a schematic structural diagram of a speech synthesis model provided by an exemplary embodiment of the present application. As shown in Figure 1, the speech synthesis model includes a first sub-model 101 and a second sub-model 102. Among them, the first sub-model can be called a Text2PPG (Text to Post-Phonetic Feature) model, and the second sub-model can be called a PPG2Wav (Post-Phonetic Feature to Waveform) model.
[0050] Model training stage:
[0051] The computer device obtains the sample speech of the target user, the timbre identifier of the target user, the sample text corresponding to the sample speech, and the style identifier, and determines the sample phones that make up the sample text according to the sample text, and determines the true pronunciation duration features of each phone in the sample phones according to the sample speech, and determines the true phonetic posterior features (Phonetic Posterior Gram, PPG) of the sample phones according to the sample speech. Then, the sample phones and the style identifier are input into the first sub-model 101. The text encoder 1011 encodes the sample phones according to the style identifier to obtain the hidden layer features of the sample phones corresponding to the style identifier. And, the duration predictor 1012 predicts the hidden layer features of the sample phones to obtain the predicted pronunciation duration features corresponding to each phone in the sample phones corresponding to the style identifier. And, the fundamental frequency predictor 1013 predicts the hidden layer features of the sample phones to obtain the fundamental frequency features corresponding to the style identifier and the sample phones. Among them, different style identifiers have their corresponding model parameters. Then, the computer device performs frame expansion processing on the hidden layer features of the sample phones through the duration regularizer 1014 according to the true pronunciation duration features corresponding to each phone in the sample phones, and performs convolution processing on the hidden layer features of the frame-expanded sample phones through the post-processing network 1015, so as to obtain the predicted phonetic posterior features of the sample phones. The predicted phonetic posterior features are used to reflect the features of each phone in the sample phones and the pronunciation duration features of each phone in the sample phones. When training the first sub-model 101, the computer device calculates the loss function between the predicted phonetic posterior features and the true phonetic posterior features to train the first sub-model. And, calculates the loss function between the predicted pronunciation duration features and the true pronunciation duration features to train the first sub-model.
[0052] The computer device then inputs the predicted phoneme posterior features, timbre identifier, and fundamental frequency features into the second sub-model 102. The phoneme posterior encoder 1021 (also known as a PPG encoder) in the a priori encoder samples the mean and variance of the a priori distribution of the predicted intermediate variable to obtain a predicted intermediate variable. This predicted intermediate variable is an intermediate variable used in the process of synthesizing the predicted speech using the predicted phoneme posterior features. The predicted intermediate variable is used to reflect the frequency domain characteristics of the predicted speech. The computer device also inputs the sample speech (linear spectrum) into the a priori predictor 1024 of the a priori encoder and samples the mean and variance of the a priori distribution of the true intermediate variable to obtain the true intermediate variable. The regularization flow layer 1022 of the a priori encoder then performs affine coupling processing on the true intermediate variable to obtain the processed true intermediate variable. The relative entropy loss (also known as the Kulbak-Leibler (KL) divergence loss) between the predicted intermediate variable and the processed true intermediate variable is then calculated to train the second sub-model. In addition, the a priori encoder also includes a phoneme posterior predictor 1023 (PPG predictor). This predictor is used to predict the predicted phoneme posterior features during pre-training of the second sub-model based on the predicted intermediate variables during pre-training. This allows the computer device to calculate the loss function between the predicted phoneme posterior features during pre-training and the true phoneme posterior features during pre-training, thereby pre-training the second sub-model. After obtaining the predicted intermediate variables, the computer device uses the decoder's inverse Fourier transform decoder 1025 to perform an inverse Fourier transform on the predicted intermediate variables based on the timbre identifier to obtain predicted speech. The mel-spectrogram loss between the predicted speech and the sample speech is then calculated to train the second sub-model. Furthermore, in the model structure shown in Figure 1, the discriminator 1026 in the decoder and the components of the speech synthesis model other than the discriminator 1026 can form a generative adversarial network. The computer device inputs the predicted speech into the discriminator 1026 to obtain a discrimination result for the predicted speech. The generative adversarial loss is then determined based on the discrimination results and the true source of the predicted speech, thereby enabling the training of the above-mentioned generative adversarial network.
[0053] Speech synthesis stage:
[0054] The computer device obtains the target phoneme of the target user, the timbre identifier of the target user, and the target style identifier. The target phoneme is determined based on the target text. By inputting the target phoneme and the target style identifier into the first sub-model 101, the computer device can obtain the phoneme posterior features of the target phoneme corresponding to the target style identifier and the target fundamental frequency features corresponding to the target style identifier and the target phoneme. The phoneme posterior features, the timbre identifier, and the target fundamental frequency features are then input into the second sub-model 102 to obtain the target speech corresponding to the target text, the timbre identifier, and the target style identifier. The target text determines the pronunciation content of the target speech, the timbre identifier determines the timbre of the target speech, and the target style identifier determines the pronunciation style of the target speech, including the pronunciation duration and fundamental frequency of each phoneme.
[0055] It should be noted that, during the model training phase, the fundamental frequency features input by the computer device to the second sub-model 102 are expanded using the pronunciation duration features. During the speech synthesis phase, the pronunciation duration features used by the computer device for frame expansion in the first sub-model 101 are predicted by the duration predictor 1012. In addition, during the speech synthesis phase, the regularized flow layer 1022 in the second sub-model 102 performs reverse flow conversion (opposite to the data flow direction during training) on the intermediate variables output by the phoneme posterior encoder 1021, and inputs them into the decoder for processing, thereby obtaining the target speech. Furthermore, the phoneme posterior predictor 1023 in the second sub-model 102 does not participate in the speech synthesis process.
[0056] By training the aforementioned speech synthesis model, the model can generate a target speech that matches the target user's timbre based on the target user's timbre identifier and target text. The target speech synthesis process involves predicting intermediate variables using predicted phoneme posterior features and performing an inverse Fourier transform. Because phoneme posterior features contain less information than spectral features, fewer model parameters are required to predict them. Furthermore, the inverse Fourier transform requires fewer model parameters than upsampling. This reduces the model's parameters, thereby reducing the model's computational resources and enabling deployment on low-computing-resource devices.
[0057] FIG2 is a flow chart of a method for training a speech synthesis model provided by an exemplary embodiment of the present application. The method can be used on a computer device or a client on a computer device. As shown in FIG2 , the method includes:
[0058] Step 202: Obtain sample phonemes of the target user and the timbre identifier of the target user.
[0059] The target user is a user who needs to perform speech synthesis, and the speech synthesis model obtained by training the computer device can synthesize speech that matches the timbre of the target user and has the target text content.
[0060] Optionally, the computer device also obtains sample text corresponding to the target user's sample speech, which includes the text content corresponding to the sample speech. The sample speech and sample text can support different types of languages, which is not limited in this embodiment of the present application. For example, the sample speech is obtained by recording the target user's pronunciation of a small amount of text. The sample phonemes are determined based on the sample text corresponding to the target user's sample speech.
[0061] The target user's timbre identifier is used to identify the target user's timbre. When training a speech synthesis model, using the timbre identifier allows the model parameters learned by the model to be associated with the timbre identifier. Thus, when synthesizing speech, inputting the timbre identifier into the model allows the model to synthesize speech that matches the timbre corresponding to the timbre identifier (the model parameters corresponding to the timbre identifier).
[0062] Step 204: Input the sample phoneme into the first sub-model of the speech synthesis model to obtain the predicted phoneme posterior features of the sample phoneme.
[0063] The predicted phoneme posterior features are used to reflect the characteristics of each phoneme in the sample phoneme and the pronunciation duration characteristics of each phoneme in the sample phoneme. "Phoneme posterior features" can also be called "PPG".
[0064] Optionally, the computer device extracts the hidden layer features of the sample phonemes through the first sub-model, and predicts the pronunciation duration features of each phoneme in the sample phonemes through the first sub-model or obtains the actual pronunciation duration features of each phoneme in the sample phonemes based on the sample speech, thereby obtaining the pronunciation duration features of each phoneme in the sample phonemes. Thereafter, based on the hidden layer features of the sample phonemes and the pronunciation duration features of each phoneme in the sample phonemes, the predicted phoneme posterior features of the sample phonemes can be determined. Optionally, the determination process is achieved by the computer device expanding the hidden layer features of the sample phonemes through the pronunciation duration features of each phoneme in the sample phonemes.
[0065] Step 206: Input the predicted phoneme posterior features and the timbre identifier into the second sub-model of the speech synthesis model to obtain the predicted speech corresponding to the sample text and the timbre identifier.
[0066] The content of the predicted speech is the sample text, and the timbre of the predicted speech is the timbre corresponding to the timbre identifier, that is, the timbre of the target user identified by the timbre identifier. The second sub-model predicts the aforementioned predicted phoneme posterior features and the predicted intermediate variables of the predicted speech, and obtains the predicted speech from the predicted intermediate variables. The predicted intermediate variables are used to reflect the frequency domain characteristics of the predicted speech. The predicted intermediate variables are intermediate variables predicted by the second sub-model during the process of determining the predicted speech. The predicted intermediate variables can also be called predicted latent variables.
[0067] In one possible implementation, the predicted speech can be obtained based on inverse Fourier transform, that is, the second submodel of the speech synthesis model obtains the predicted speech based on inverse Fourier transform by predicting the posterior features of the predicted phonemes and the predicted intermediate variables of the predicted speech.
[0068] Step 208: Train the first sub-model based on the predicted phoneme posterior features, and train the second sub-model based on the predicted speech and the predicted intermediate variables.
[0069] The computer device determines the true phoneme posterior features based on the sample speech and trains the first sub-model by calculating the loss function between the predicted phoneme posterior features and the true phoneme posterior features. The computer device also trains the second sub-model by calculating the loss function between the sample speech and the predicted speech.
[0070] Optionally, the loss function of the sample speech and the predicted speech refers to the mel spectrum loss of the sample speech and the predicted speech. The computer device can determine the loss function to train the second sub-model by converting the predicted speech and the sample speech into mel spectrum and calculating the L1 norm distance of the mel spectrum of the two.
[0071] The computer device also obtains a true intermediate variable corresponding to the sample speech and the predicted phoneme posterior features. Optionally, the true intermediate variable is determined based on the sample speech. The computer device calculates a loss function between the predicted intermediate variable and the true intermediate variable to train the second sub-model. Optionally, the loss function is a relative entropy loss (KL divergence loss).
[0072] It should be noted that the speech synthesis model trained above is obtained through pre-training. Pre-training is the training of the speech synthesis model using pre-training data. The above training process can refer to the above training process. The purpose of the above training process of the speech synthesis model is to learn the frequency domain characteristics of the target user's pronunciation (which can be called phoneme cloning fine-tuning training), that is, to learn the timbre of the target user and establish a correspondence between the learned model parameters and the timbre identifier. After completing the training of the speech synthesis model, the speech synthesis model can synthesize a target speech that conforms to the timbre of the target user (input timbre identifier) and whose content is the target text (different from the sample text).
[0073] It should be noted that the speech synthesis model trained by the method provided in this embodiment can be deployed and run on low-computing resource devices. Low-computing resource devices include user terminals, including but not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc.
[0074] In summary, the method provided in this embodiment, by training the above-mentioned speech synthesis model, can generate a target speech that matches the timbre of the target user according to the timbre identifier of the target user and the target text through the speech synthesis model. The process of synthesizing the target speech is to predict the intermediate variables through the predicted phoneme posterior features, and to achieve this through inverse Fourier transform. Since the phoneme posterior features contain less information than the spectral features, the model parameters required to predict the phoneme posterior features are also fewer, and the inverse Fourier transform also requires fewer model parameters than upsampling. Therefore, the parameters of the model can be reduced, thereby reducing the computational resources consumed by the model, and the model can be deployed in low-computing resource devices.
[0075] FIG3 is a flow chart of a method for training a speech synthesis model provided by an exemplary embodiment of the present application. The method can be used on a computer device or a client on a computer device. As shown in FIG3 , the method includes:
[0076] Step 302: Obtain sample phonemes of the target user and the timbre identifier of the target user.
[0077] The target user is a user for whom speech synthesis is to be performed, and the target user is determined by a user who trains or uses a speech synthesis model. Optionally, the computer device further obtains a sample text corresponding to the target user's sample speech, the sample text including text content corresponding to the sample speech, and the sample phonemes are determined based on the sample text corresponding to the target user's sample speech.
[0078] The target user's timbre identifier is information used to identify the target user. When training a speech synthesis model, using the timbre identifier allows the learned model parameters to be mapped to the timbre identifier. This allows the model to synthesize speech that matches the timbre associated with the timbre identifier (the target user's timbre) by inputting the timbre identifier into the model.
[0079] Step 304: Encode the sample phoneme through the text encoder of the first sub-model of the speech synthesis model to obtain the hidden layer features of the sample phoneme.
[0080] The computer device inputs the sample phoneme into the first sub-model of the speech synthesis model to obtain the predicted phoneme posterior features of the sample phoneme. The predicted phoneme posterior features are used to reflect the features of each phoneme in the sample phoneme and the pronunciation duration features of each phoneme in the sample phoneme.
[0081] The first sub-model, referred to as the Text2PPG model, is used to convert an input phoneme sequence into language features containing more pronunciation information. This first sub-model includes a text encoder, a duration regularizer, and a post-processing network. The computer device encodes the sample phonemes using the text encoder, thereby obtaining the latent features of the sample phonemes.
[0082] Optionally, the text encoder adopts a feed-forward transformer (FFT) structure. Each FFT module consists of a multi-head self-attention module and a convolution module. Residual connections and layer normalization structures are also added after the self-attention module and convolution module to improve the stability and performance of the structure.
[0083] For example, FIG4 is a schematic diagram of the structure of a text encoder provided by an exemplary embodiment of the present application. As shown in FIG4, the text encoder includes a multi-head attention layer (Multi-Head Attention) 401, a residual & normalization layer (Add&Norm) 402, and a convolutional layer (Conv1D) 403. Among them, the multi-head attention layer 401 adopts a linear attention mechanism. For example, the formula of the linear attention mechanism is as follows: Attention = φ (Q) (φ (K) T V);
[0084] Among them, Q, K, and V all represent the hidden layer representation sequence of the sample phoneme. In order to ensure that the inner product of Q and K is a positive number and the output probability is meaningful, the Exponential Linear Unit (ELU) function is used in linear attention, so that φ(K) can be first T The matrix multiplication of V is performed, with a computational complexity of O(N). Furthermore, the first sub-model does not consider sample user or acoustic information, so that the output is only related to the input phoneme sequence. Compared to dot-product attention, the linear attention mechanism can reduce computational complexity while maintaining the attention effect.
[0085] Step 306: Perform frame expansion processing on the hidden layer features of the sample phonemes through the duration regularizer of the first sub-model of the speech synthesis model.
[0086] Since the phoneme posterior feature can reflect the complete pronunciation information, which includes the information of the pronunciation duration of each phoneme, it is necessary to determine the pronunciation duration feature corresponding to each phoneme in the sample phonemes and expand the hidden layer features of the sample phonemes.
[0087] The computer device also obtains the actual pronunciation duration characteristics corresponding to each phoneme in the sample phoneme. For example, the computer device obtains sample speech and analyzes and processes the sample speech to obtain the actual pronunciation duration characteristics corresponding to each phoneme in the sample phoneme. For example, a pre-trained duration model can be used to determine the actual pronunciation duration characteristics corresponding to each phoneme in the sample phoneme based on the sample speech. The computer device can use a duration regularizer to perform frame expansion processing on the hidden layer characteristics of the sample phoneme based on the actual pronunciation duration characteristics corresponding to each phoneme in the sample phoneme.
[0088] Step 308: Perform convolution processing on the hidden layer features of the expanded sample phonemes through the post-processing network of the first sub-model of the speech synthesis model to obtain the predicted phoneme posterior features of the sample phonemes.
[0089] After the hidden layer features of the sample phoneme are expanded, this information is fed into the post-processing network, which performs convolution on the input information to smooth it. Because the expanded phoneme posterior features already include the phoneme characteristics and pronunciation duration characteristics, the predicted phoneme posterior features of the sample phoneme can be obtained.
[0090] Step 310: Train the first sub-model based on the predicted phoneme posterior features.
[0091] The computer device also obtains the true a posteriori features of the sample phonemes. For example, the true a posteriori features of the sample phonemes can be obtained by inputting the sample speech into a speech recognition model. The computer device trains the first sub-model by calculating a loss function between the predicted a posteriori features and the true a posteriori features. For example, the loss function is an L2 norm loss.
[0092] Optionally, because actual pronunciation duration features cannot be obtained during speech synthesis, the first sub-model also includes a duration predictor. When training the first sub-model, the computer device uses the duration predictor to predict the hidden features of the sample phonemes, thereby obtaining predicted pronunciation duration features corresponding to each phoneme in the sample phonemes. The computer device then calculates a loss function between the predicted pronunciation duration features and the actual pronunciation duration features to train the first sub-model. For example, the loss function is an L2 norm loss.
[0093] After the training is completed, the actual pronunciation duration features used to input the duration regularizer are replaced by the predicted pronunciation duration features obtained by the duration predictor.
[0094] In addition, since the recordings of sample users are often hurried and emotionless, different styles of speech need to be synthesized for different synthetic speech scenarios. The style includes the pronunciation duration (pronunciation duration and pause) and fundamental frequency (fundamental frequency change) of each phoneme in the speech. In the embodiment of the present application, the above-mentioned speech style is identified by a style identifier. The computer device can control the model to generate predicted phoneme posterior features adapted to different scenarios by using different style identifiers. Optionally, in this solution, the computer device also obtains the style identifier, and encodes the sample phoneme according to the style identifier through a text encoder to obtain the hidden layer features of the sample phoneme corresponding to the style identifier.
[0095] It should be noted that different style identifiers have corresponding model parameters. That is, different input style identifiers will result in different model parameters of the model, which will affect the hidden features obtained by the first sub-model encoding the sample phonemes. Inputting different style identifiers can obtain the hidden features of the sample phonemes in the styles corresponding to different style identifiers. The influence of the style identifier on the hidden features will affect the subsequent input of the model, for example, it will affect the pronunciation duration features predicted by the duration predictor (outputting the predicted pronunciation duration features corresponding to the sample phonemes and the style identifier) and the fundamental frequency features predicted by the fundamental frequency predictor (outputting the fundamental frequency features corresponding to the style identifier and the sample phonemes). Optionally, in the process of pre-training the first sub-model, the computer device will use pre-training data of different styles and the corresponding style identifiers for training, so that the first sub-model can learn the model parameters corresponding to different styles.
[0096] Optionally, the first sub-model also includes a fundamental frequency predictor. The computer device uses the fundamental frequency predictor to predict the hidden features of the sample phoneme, thereby obtaining fundamental frequency features corresponding to the style identifier and the sample phoneme. This fundamental frequency feature is input into the second sub-model to obtain predicted speech corresponding to the style identifier, i.e., predicted speech in the style corresponding to the style identifier. Because speech style is related to fundamental frequency, and adding fundamental frequency prediction can improve the predictive effect of the posterior features of the predicted phoneme, the computer device optionally also concatenates the fundamental frequency features predicted by the fundamental frequency predictor onto the output of the text encoder.
[0097] For example, the structure of the first sub-model can be referred to the example in FIG1 .
[0098] Step 312: Input the predicted phoneme posterior features and timbre identifier into the priori encoder of the second sub-model to obtain predicted intermediate variables.
[0099] The computer device inputs the predicted phoneme posterior features and timbre identifier into the second sub-model of the speech synthesis model, thereby obtaining a predicted speech corresponding to the sample text and timbre identifier. The second sub-model obtains the predicted speech based on an inverse Fourier transform by predicting the predicted phoneme posterior features and the predicted intermediate variables of the predicted speech. The predicted intermediate variables are used to reflect the frequency domain characteristics of the predicted speech. Because the speech synthesis model uses the phoneme posterior features as language features, which already provide phoneme duration information, the second sub-model does not need to consider information about the duration of the modeled pronunciation.
[0100] The second sub-model includes a priori encoder and a decoder. The computer device can obtain the above-mentioned predicted intermediate variable by inputting the predicted phoneme posterior feature and timbre identifier into the priori encoder of the second sub-model.
[0101] Optionally, the a priori encoder includes a phoneme posterior encoder (PPG encoder). The computer device inputs the predicted phoneme posterior features and timbre identifier into the phoneme posterior encoder. The phoneme posterior encoder samples the mean and variance of the prior distribution p(z|c) of the predicted intermediate variable z based on the conditional information c containing the predicted phoneme posterior features and timbre identifier, thereby obtaining the above-mentioned predicted intermediate variable. Optionally, the phoneme posterior encoder is based on an FFT structure and adopts a linear attention mechanism. The specific structure can refer to the example in Figure 4.
[0102] Optionally, when the first sub-model outputs fundamental frequency features corresponding to the sample phoneme and style identifier, the computer device also obtains fundamental frequency features corresponding to the sample phoneme and style identifier. The fundamental frequency features are obtained by extracting features of the sample phoneme using the style identifier through the first sub-model. The computer device inputs the predicted phoneme posterior features, timbre identifier, and fundamental frequency features into a priori encoder to obtain a predicted intermediate variable corresponding to the style identifier, i.e., the predicted intermediate variable has the style corresponding to the style identifier. The predicted intermediate variable can be used to synthesize predicted speech having the style corresponding to the style identifier.
[0103] Step 314: Perform inverse Fourier transform on the predicted intermediate variable through the decoder of the second sub-model to obtain predicted speech.
[0104] Optionally, the decoder includes an inverse Fourier transform decoder. The computer device performs an inverse Fourier transform on the prediction intermediate variables through the inverse Fourier transform decoder to obtain the predicted speech. Optionally, in actual applications, if the style identifier of the target user is not input into the decoder, the similarity of the target user's voice cloning (the timbre similarity between the sample voice and the predicted voice) will be significantly reduced. Therefore, the computer device will input the prediction intermediate variables and the style identifier into the inverse Fourier transform decoder, so that the inverse Fourier transform decoder performs an inverse Fourier transform on the prediction intermediate variables according to the style identifier to obtain the predicted speech.
[0105] Optionally, the inverse Fourier transform decoder includes multiple one-dimensional convolution layers, and the last one-dimensional convolution layer is connected to the inverse Fourier transform layer. For example, Figure 5 is a structural diagram of an inverse Fourier transform decoder provided by an exemplary embodiment of the present application. As shown in Figure 5, z represents a predicted intermediate variable, and the speaker id represents a style identifier. The computer device uses multiple one-dimensional convolution layers 501 through the inverse Fourier transform decoder to gradually increase the dimension of the input to (f / 2+1)*2, so that the output conforms to the total dimension of the real part and the imaginary part, where f represents the size of the fast Fourier transform. The stack of residual networks 502 follows each one-dimensional convolution layer 501 to obtain more information at the corresponding scale. Since the modeling is in the frequency domain dimension, dilated convolution is not used, but a smaller kernel size is used to ensure that the receptive field is not too large. By adopting group convolution in the one-dimensional convolution layer 501, the amount of computation can be saved. After passing through the one-dimensional convolution layer 501 and the residual network 502, the output is divided into real and imaginary parts, and the final waveform (predicted speech) can be generated by the inverse Fourier transform layer 503. Optionally, the number of one-dimensional convolution layers 501 is determined according to the effect of model training.
[0106] Optionally, the above-mentioned inverse Fourier transform decoder can also be replaced by a combination of an upsampling structure and an inverse Fourier transform structure. For example, Figure 6 is a structural diagram of another inverse Fourier transform decoder provided by an exemplary embodiment of the present application. As shown in Figure 6, z represents a prediction intermediate variable, and speaker id represents a style identifier. Under this structure, the inverse Fourier transform decoder includes a one-dimensional convolution layer 601, an inverse Fourier transform structure, an upsampling network structure, and a pseudo-orthogonal mirror filter bank 605. Among them, the inverse Fourier transform structure includes a residual network 602, a one-dimensional convolution layer 601, and an inverse Fourier transform layer 603. The upsampling network structure includes an upsampling network 604 and a residual network 602.
[0107] Because mid- and high-frequency features of speech are easily restored, and harmonics are primarily concentrated in the low-frequency portion, an upsampling structure can be used to restore the low-frequency components and an inverse Fourier transform layer can be used to model the mid- and high-frequency components. Subsequently, a pseudo-orthogonal mirror filter bank is used to divide the speech into multiple subbands. The upsampling structure models the first subband, while the remaining subbands are generated using the structure shown in Figure 5. Because the upsampling structure only models low-frequency features, it significantly reduces the number of parameters and computational complexity compared to the original upsampling structure. Although this solution has more parameters and computational complexity than the structure shown in Figure 5, it also achieves improved model performance. This solution can be tailored to the computational and storage requirements of different deployment scenarios.
[0108] Step 316: Train the second sub-model based on the predicted speech and the predicted intermediate variables.
[0109] The computer device also obtains sample speech and calculates the mel spectrum loss between the predicted speech and the sample speech to train the second sub-model.
[0110] Optionally, the second sub-model further includes a posterior encoder. The computer device obtains a speech sample and inputs the speech sample (linear spectrum) into the posterior encoder to obtain a true intermediate variable between the speech sample and the predicted phoneme posterior features. The computer device trains the second sub-model by calculating the relative entropy loss (KL divergence loss) between the predicted intermediate variable and the true intermediate variable.
[0111] Optionally, the posterior encoder includes a posterior predictor (PPG predictor). The computer device inputs the sample speech into the posterior predictor, samples the mean and variance of the posterior distribution p(z|y) of the true intermediate variable, and obtains the true intermediate variable. Where y represents the sample speech.
[0112] Optionally, the a priori encoder further includes a regularization flow layer. The computer device performs affine coupling processing on the real intermediate variables through the regularization flow layer, thereby obtaining processed real intermediate variables. When calculating the KL divergence loss, the computer device calculates the relative entropy loss between the predicted intermediate variables and the processed real intermediate variables, thereby training the second sub-model. The regularization flow can transform the intermediate variable z into a more complex distribution, and the KL divergence loss is used to ensure that the distribution of the real intermediate variables is consistent with that of the predicted intermediate variables.
[0113] The above-mentioned regularized flow layer includes multiple affine coupling layers, and each affine coupling layer is used to perform affine coupling processing on real intermediate variables. Due to the use of multi-layer processing, the regularized flow layer has a large number of parameters. The embodiment of the present application reduces the complexity of the model by making different affine coupling layers share model parameters. For example, Figure 7 is a structural diagram of the regularized flow layer provided by an exemplary embodiment of the present application. As shown in Figure 7, by making different affine coupling layers 701 share model parameters, and each affine coupling layer 701 corresponds to an embedding layer identifier 702, it is possible to control the parameters of the regularized flow layer to a single layer and reduce the model parameters. The embedding layer identifier is information used to identify the affine coupling layer, and the embedding layer identifier of each affine coupling layer is different.
[0114] It should be noted that during the training of the speech synthesis model, the intermediate variable z is converted to f(z) through the flow (regularized flow layer). During the inference process (speech synthesis), the output of the phoneme posterior encoder is reverse-flowed to obtain the intermediate variable z. For example, the expression of the intermediate variable z is as follows:
[0115] Among them, f θ represents the distribution, μ θ represents the mean, σ θ Represents variance.
[0116] In the absence of clear constraints on the intermediate variables, the output predicted speech is prone to pronunciation errors such as incorrect pronunciation and abnormal intonation. The method provided in the embodiment of the present application provides pronunciation constraints by introducing a phoneme posterior predictor (PPG predictor). Optionally, the prior encoder also includes a phoneme posterior predictor, which is used to predict the predicted phoneme posterior features in the pre-training process based on the predicted intermediate variables in the pre-training process during the pre-training of the second sub-model. During the pre-training process of the second sub-model, the loss function of the predicted phoneme posterior features in the pre-training process and the true phoneme posterior features in the pre-training process is calculated to train the second sub-model. Optionally, the loss function is an L1 norm loss. For example, the expression of the loss function is as follows: L PPg =||PPG1-PPG2||1;
[0117] Among them, PPG1 represents the predicted phoneme posterior features during the pre-training process, and PPG2 represents the true phoneme posterior features during the pre-training process.
[0118] It should be noted that the phoneme posterior predictor is only trained during the pre-training of the speech synthesis model and is frozen during the phoneme cloning fine-tuning training.
[0119] In summary, the above loss function in the process of training the second sub-model can be classified as the Conditional Variational Auto Encoder (CVAE) loss, and its loss function is as follows: L cvae =L kl +λ recon *L recon +λ ppg *L ppg ;
[0120] Among them, L kl Represents the KL divergence loss between the predicted intermediate variable and the true intermediate variable, L recon Represents the L1 loss of the Mel spectrum of the sample speech and the predicted speech, L ppg represents the loss of the PPG predictor. recon and λ ppg is the weight parameter.
[0121] Alternatively, the computer device can input the true intermediate variable into the decoder to obtain a predicted speech corresponding to the true intermediate variable, and then calculate the L1 loss of the Mel spectrum based on the predicted speech and the sample speech. In this case, the predicted intermediate variable obtained by the computer device is primarily used to determine the KL divergence loss between the predicted intermediate variable and the true intermediate variable to train the second sub-model.
[0122] Optionally, the decoder also includes a discriminator, which, along with the rest of the speech synthesis model, forms a Generative Adversarial Network (GAN). The computer inputs the predicted speech into the discriminator, which then generates a judgment result regarding the predicted speech. This judgment result indicates whether the predicted speech is real or predicted. A generative adversarial loss is then determined based on the judgment result and the true source of the predicted speech, thereby training the GAN.
[0123] Optionally, the discriminator includes a multi-scale spectral discriminator. Multi-scale spectral discriminators are particularly effective in inverse Fourier transform decoders, with significant gains in high-frequency harmonic reconstruction. The computer device inputs the predicted speech into the multi-scale spectral discriminator. Multiple sub-discriminators of the multi-scale spectral discriminator perform short-time Fourier transforms on the amplitude spectrum of the predicted speech, and then perform two-dimensional convolution processing on the predicted speech through multiple two-dimensional convolution layers to obtain a discrimination result for the predicted speech. Each sub-discriminator has different short-time Fourier transform parameters.
[0124] For example, Figure 8 is a schematic diagram of the structure of a multi-scale spectral discriminator provided by an exemplary embodiment of the present application. As shown in Figure 8, the multi-scale spectral discriminator is composed of multiple sub-discriminators with different short-time Fourier transform parameters. After the predicted speech input discriminator, the real and imaginary parts are obtained through the short-time Fourier transform layer 801, and the amplitude is taken to output the spectral features. After passing through the multi-layer two-dimensional convolution layer 802, it can learn and predict the frequency domain features of different resolutions in the speech, thereby achieving discrimination.
[0125] Optionally, the discriminator includes a multi-scale complex spectrum discriminator. The multi-scale complex spectrum discriminator models the relationship between the real and imaginary parts of the speech signal, which helps to improve the discrimination of phase accuracy. The computer device inputs the predicted speech into the multi-scale complex spectrum discriminator, and performs short-time Fourier transform on the predicted speech on the complex spectrum through multiple sub-discriminators of the multi-scale complex spectrum discriminator, and performs two-dimensional complex convolution processing through multiple two-dimensional complex convolution layers to obtain the discrimination result of the predicted speech. Among them, the short-time Fourier transform parameters of each sub-discriminator are different. The multi-scale complex spectrum discriminator divides the signal into real and imaginary parts at multiple scales through short-time Fourier transform, and then performs two-dimensional complex convolution on the input. This method has good results in the complex value domain.
[0126] In summary, the loss function in the process of training the second sub-model is composed of CVAE loss and GAN loss. The overall loss function is as follows: L G =L adv (G)+λ fm *L fm (G)+L cvae ; L D =Ladv (D);
[0127] Among them, L adv (G) is the loss of the generator in GAN, L adv (D) is the loss of the discriminator in GAN. L fm (G) is the feature matching loss of the generator, specifically the loss of the difference between the output of each network layer in the generator input real data and sample data. fm is the weight parameter.
[0128] For example, the structure of the second sub-model can be referred to the example in FIG. 1 .
[0129] In summary, the method provided in this embodiment, by training the above-mentioned speech synthesis model, can generate a target speech that matches the timbre of the target user according to the timbre identifier of the target user and the target text through the speech synthesis model. The process of synthesizing the target speech is to predict the intermediate variables through the predicted phoneme posterior features, and to achieve this through inverse Fourier transform. Since the phoneme posterior features contain less information than the spectral features, the model parameters required to predict the phoneme posterior features are also fewer, and the inverse Fourier transform also requires fewer model parameters than upsampling. Therefore, the parameters of the model can be reduced, thereby reducing the computational resources consumed by the model, and the model can be deployed in low-computing resource devices.
[0130] The method provided in this embodiment also effectively reduces the number of model parameters and low computational complexity through an inverse Fourier transform decoder, allowing different affine coupling layers of the regularized flow layer to share model parameters, using a linear attention mechanism, and extracting phoneme posterior features rather than spectral features.
[0131] In the two-segment model (Fastspeech) of the related art, since it is divided into an acoustic model and a vocoder, there is an error between the two, which will lead to loss of sound quality of the synthesized speech, and this problem is more obvious in small sample timbre cloning. However, the current end-to-end model (a model that directly outputs speech from input text) still has the problem of unstable speech generation, and even pronunciation errors, which will seriously affect the listening experience. The method provided in this embodiment, based on the end-to-end modeling, improves the above problems and improves the performance of speech synthesis by introducing style identification, generating phoneme posterior features based on duration predictor and fundamental frequency predictor, constraining intermediate variables through phoneme posterior predictor, constraining the distribution of intermediate variables through regularization flow, and training through generative adversarial network.
[0132] How to effectively reduce parameters and computational complexity is an intuitive challenge. In related technologies, since acoustic information and text information are modeled together, directly reducing model parameters will lead to a rapid decline in model performance. For example, model compression algorithms such as distillation and quantization will also lead to significant performance losses. The method provided in this embodiment can not only effectively reduce the number of model parameters and reduce computational complexity by reducing parameters as described above, but also improve the model's speech synthesis performance by constructing a model structure based on an end-to-end basis and adopting the above-mentioned performance-enhancing structure to improve the model's speech synthesis performance, thereby simultaneously reducing model parameters and improving model performance.
[0133] Related technologies, due to rhythm issues such as the user's recorded speech speed, are poorly adapted to application scenarios. For example, in navigation scenarios, users seek a clear and well-pronounced reading style. However, because the related art models jointly model timbre and content, the generated speech style is not suitable. The method provided in this embodiment also separately models timbre and content, and introduces style identifiers and fundamental frequencies for feature extraction and speech synthesis. This allows for the synthesis of speech with a reading style that is suitable for different scenarios.
[0134] FIG9 is a flow chart of a speech synthesis method provided by an exemplary embodiment of the present application. The method can be used on a computer device or a client on a computer device. As shown in FIG9 , the method includes:
[0135] Step 902: Obtain the target phoneme of the target user and the timbre identifier of the target user.
[0136] The target user is the user who needs to perform speech synthesis. The computer device can train a speech synthesis model using sample phonemes and a timbre identifier of the target user. The sample phonemes are determined based on sample text corresponding to the sample speech of the target user. The target phonemes are determined based on the target text. The target text may be identical, partially identical, or different from the sample text, and is determined by the user using the speech synthesis model.
[0137] The target user's timbre identifier is information used to identify the target user. When training a speech synthesis model, using the timbre identifier allows the learned model parameters to be mapped to the timbre identifier. This allows the model to synthesize speech that matches the timbre associated with the timbre identifier by inputting the timbre identifier into the model.
[0138] Step 904: Input the target phoneme into the first sub-model of the speech synthesis model to obtain the phoneme posterior feature of the target phoneme.
[0139] A speech synthesis model is deployed in the above-mentioned computer device or client, and the speech synthesis model is trained using the speech synthesis model training method provided in the embodiment of the present application.
[0140] The phoneme posterior features are used to reflect the characteristics of each phoneme in the target phoneme and the pronunciation duration characteristics of each phoneme in the target phoneme. Optionally, the computer device extracts the hidden layer features of the target phoneme through the first sub-model, and predicts the pronunciation duration characteristics of each phoneme in the target phoneme through the duration predictor of the first sub-model. Thereafter, the predicted phoneme posterior features of the target phoneme can be determined based on the hidden layer features of the target phoneme and the pronunciation duration characteristics of each phoneme in the target phoneme.
[0141] Step 906: Input the phoneme posterior features and the timbre identifier into the second sub-model of the speech synthesis model to obtain the target speech corresponding to the target text and the timbre identifier.
[0142] The target speech content is the target text, and the timbre of the target speech is the timbre corresponding to the timbre identifier, i.e., the timbre of the target user identified by the timbre identifier. The second sub-model obtains the target speech by predicting intermediate variables between the aforementioned phoneme posterior features and the target speech, and performing an inverse Fourier transform on the intermediate variables. The intermediate variables are used to reflect the frequency domain characteristics of the target speech.
[0143] Optionally, the computer device also obtains a target style identifier. The target phoneme and target style identifier are input into a first sub-model of the speech synthesis model to obtain a phoneme posterior feature of the target phoneme corresponding to the target style identifier and a target fundamental frequency feature corresponding to the target style identifier and the target phoneme. The phoneme posterior feature, timbre identifier, and target fundamental frequency feature are then input into a second sub-model of the speech synthesis model to obtain a target speech corresponding to the target text, timbre identifier, and target fundamental frequency feature.
[0144] In summary, the method provided in this embodiment can generate a target speech that matches the timbre of the target user based on the timbre identifier of the target user and the target text through a speech synthesis model. The process of synthesizing the target speech is to predict the intermediate variables through the predicted phoneme posterior features and implement it through inverse Fourier transform. Since the phoneme posterior features contain less information than the spectral features, the model parameters required to predict the phoneme posterior features are also fewer, and the inverse Fourier transform also requires fewer model parameters than upsampling. Therefore, the parameters of the model can be reduced, thereby reducing the computational resources consumed by the model, and the model can be deployed in low-computing resource devices.
[0145] While maintaining the same model performance, the method provided by the embodiments of this application significantly reduces the number of model parameters and computational complexity. This helps reduce resource usage, including computing and storage resources, and facilitates deployment in application scenarios such as on-device. Furthermore, compared to related technologies, the model reduces pronunciation errors, making the model more stable.
[0146] The experimental process and analysis are as follows:
[0147] The models in the embodiments of this application and related art models were pre-trained using an open dataset containing approximately 242 hours of speech from 1,151 speakers. To evaluate the model's performance in the speaker voice cloning task, a multi-speaker corpus with different acoustic conditions was used to fine-tune the pre-trained model. In practice, five male and five female speakers were randomly selected as target speakers for voice cloning. Twenty sentences were randomly sampled from each speaker. In addition, 10 additional sentences were randomly selected from each speaker, resulting in a test set of 100 sentences from 10 speakers.
[0148] The speech synthesis model provided in the embodiments of the present application is compared with the conditional variational autoencoder with adversarial learning for end-to-end Text-to-Speech (VITS) and Fastspeech+HiFiGAN. The VITS model adopts the structure of the original paper. For Fastspeech+HiFiGAN, in order to compare and control the situations under different parameter amounts, two structures are adopted. Structure 1 is called Fastspeech+HiFiGAN v1, and Structure 2 is called Fastspeech+HiFiGAN v2. v1 adopts the original paper structure Fastspeech and HiFiGAN v1. Compared with v1, v2 adopts a smaller structure. v2 uses two layers of FFT in the encoder and decoder, and the dimension of the hidden layer is set to 128. HiFiGAN adopts the v2 version.
[0149] In the objective metric evaluation, each test sample was evaluated by twenty listeners, who rated the sample's naturalness and speaker's voice similarity, with a maximum score of 5 and a minimum score of 1. Computational complexity was measured in Giga Floating-point Operations Per Second (GFLOPS). The word error rate (WER) of each system was also measured to test the stability of each model, particularly in terms of pronunciation and intonation. The experimental results are shown in Table 1.
[0150] Table 1
[0151] As shown in Table 1, compared to the Fastspeech+HifiGAN v2 model of similar size, the model in this embodiment achieves better naturalness and less computational complexity. Compared to Fastspeech+HifiGAN v1, the model in this embodiment still lags behind in naturalness and speaker similarity, but achieves better WER and ensures model stability.
[0152] It should be noted that the order of the method steps provided in the embodiments of the present application can be appropriately adjusted, and the steps can be increased or decreased accordingly according to the circumstances. Any technical personnel familiar with this technical field can easily think of the changed methods within the technical scope disclosed in this application, and they should be covered within the scope of protection of this application, so they will not be repeated here.
[0153] Take, for example, the scenario where the method provided in an embodiment of the present application is applied to the production of user voice packets in an AI broadcast service, such as for map navigation. A computer device obtains target phonemes for a target user's target text, a timbre identifier for the target user, and a target style identifier. The target user can be the user themselves or a celebrity, and the target text includes the text of the voice broadcast for the map navigation scenario. The target style identifier identifies the style corresponding to the voice broadcast for the map navigation scenario, for example, a style that pronounces the phonemes slowly and with accurate fundamental frequency. By inputting the target phonemes and target style identifier into a first sub-model, the computer device obtains the phoneme posterior features corresponding to the target style identifier and the target fundamental frequency features corresponding to the target style identifier and the target phoneme. The phoneme posterior features, timbre identifier, and target fundamental frequency features are then input into a second sub-model to obtain a target voice corresponding to the target text, timbre identifier, and target style identifier. The target text determines the pronunciation content of the target voice, i.e., the pronunciation content of the target voice is the text of the voice broadcast for the map navigation scenario. The timbre identifier determines the timbre of the target voice, i.e., the timbre of the target user selected by the user. The target style identifier determines the pronunciation style of the target speech, including the pronunciation duration and fundamental frequency of each phoneme. The speech synthesis model is obtained by timbre cloning and fine-tuning using the target user's sample speech and timbre identifier. The content of the sample speech differs from the target text. For example, the sample speech is obtained by recording the target user reading a small amount of text, while the target text may include a large amount of text different from the small amount. This allows the user's recorded speech for a small amount of text to be used to synthesize speech for other texts that matches the user's timbre.
[0154] FIG10 is a schematic diagram of a training device for a speech synthesis model provided by an exemplary embodiment of the present application. As shown in FIG10 , the device includes:
[0155] An acquisition module 1001 is configured to acquire sample phonemes of a target user and a timbre identifier of the target user, wherein the sample phonemes are determined based on a sample text corresponding to a sample speech of the target user, and the timbre identifier is used to identify the timbre of the target user;
[0156] An input / output module 1002 is configured to input the sample phoneme into the first sub-model of the speech synthesis model to obtain a predicted phoneme posterior feature of the sample phoneme, wherein the predicted phoneme posterior feature is used to reflect the characteristics of each phoneme in the sample phoneme and the pronunciation duration characteristics of each phoneme in the sample phoneme;
[0157] The input-output module 1002 is further configured to input the predicted phoneme posterior features and the timbre identifier into a second sub-model of the speech synthesis model to obtain a predicted speech corresponding to the sample text and the timbre identifier, wherein the second sub-model obtains the predicted speech by predicting the predicted phoneme posterior features and a predicted intermediate variable of the predicted speech, wherein the predicted intermediate variable is used to reflect the frequency domain characteristics of the predicted speech;
[0158] The training module 1003 is configured to train the first sub-model according to the predicted phoneme posterior features; and train the second sub-model according to the predicted speech and the predicted intermediate variables.
[0159] In an optional design, the second sub-model includes a priori encoder and a decoder; the input-output module 1002 is configured to:
[0160] Inputting the predicted phoneme posterior feature and the timbre identifier into the priori encoder to obtain the predicted intermediate variable;
[0161] The decoder performs inverse Fourier transform on the prediction intermediate variable to obtain the predicted speech.
[0162] In an optional design, the a priori encoder includes a phoneme a posteriori encoder; the input-output module 1002 is configured to:
[0163] The predicted phoneme posterior feature and the timbre identifier are input into the phoneme posterior encoder, and the mean and variance of the prior distribution of the predicted intermediate variable are sampled to obtain the predicted intermediate variable.
[0164] In an optional design, the second sub-model further includes a posterior encoder; the acquisition module 1001 is configured to:
[0165] Acquiring the sample speech;
[0166] The input and output module 1002 is used to:
[0167] Inputting the sample speech into the posterior encoder to obtain a true intermediate variable;
[0168] The training module 1003 is used to:
[0169] The relative entropy loss between the predicted intermediate variable and the true intermediate variable is calculated to train the second sub-model.
[0170] In an optional design, the a posteriori encoder includes a posteriori predictor; the input-output module 1002 is configured to:
[0171] The sample speech is input into the posterior predictor, and the mean and variance of the posterior distribution of the true intermediate variable are sampled to obtain the true intermediate variable.
[0172] In an optional design, the a priori encoder further includes a regularization flow layer; the input-output module 1002 is configured to:
[0173] Performing affine coupling processing on the real intermediate variables through the regularized flow layer to obtain processed real intermediate variables;
[0174] The training module 1003 is used to:
[0175] The relative entropy loss between the predicted intermediate variable and the processed true intermediate variable is calculated to train the second sub-model.
[0176] In an optional design, the regularized flow layer includes multiple affine coupling layers, each of which is used to perform affine coupling processing on the real intermediate variables; different affine coupling layers share model parameters, and each of the affine coupling layers corresponds to an embedding layer identifier.
[0177] In an optional design, the a priori encoder further includes a phoneme posterior predictor, which is used to predict the predicted phoneme posterior features in the pre-training process based on the predicted intermediate variables in the pre-training process during the pre-training of the second sub-model.
[0178] In an optional design, the training module 1003 is used to:
[0179] During the pre-training process of the second sub-model, a loss function between the predicted phoneme posterior features during the pre-training process and the true phoneme posterior features during the pre-training process is calculated to train the second sub-model.
[0180] In an optional design, the acquisition module 1001 is used to:
[0181] Obtaining a fundamental frequency feature corresponding to the sample phoneme and the style identifier, wherein the fundamental frequency feature is obtained by extracting features of the sample phoneme based on the style identifier by the first sub-model, and the style identifier is used to identify a speech style;
[0182] The input and output module 1002 is used to:
[0183] The predicted phoneme posterior feature, the timbre identifier, and the fundamental frequency feature are input into the priori encoder to obtain the predicted intermediate variable corresponding to the style identifier.
[0184] In an optional design, the decoder includes an inverse Fourier transform decoder; the input-output module 1002 is configured to:
[0185] The inverse Fourier transform decoder performs inverse Fourier transform on the prediction intermediate variable to obtain the predicted speech.
[0186] In an optional design, the input-output module 1002 is used to:
[0187] The inverse Fourier transform decoder performs an inverse Fourier transform on the prediction intermediate variable according to the style identifier to obtain the predicted speech.
[0188] In an optional design, the inverse Fourier transform decoder includes multiple one-dimensional convolution layers, and the last one-dimensional convolution layer is connected to the inverse Fourier transform layer.
[0189] In an optional design, the acquisition module 1001 is used to:
[0190] Acquiring the sample speech;
[0191] The training module 1003 is used to:
[0192] The mel spectrum loss between the predicted speech and the sample speech is calculated to train the second sub-model.
[0193] In an optional design, the decoder further includes a discriminator, and the discriminator and the parts of the speech synthesis model other than the discriminator form a generative adversarial network; the input-output module 1002 is used to:
[0194] Inputting the predicted speech into the discriminator to obtain a discrimination result of the predicted speech, wherein the discrimination result is used to reflect whether the predicted speech is real information or predicted information;
[0195] The training module 1003 is used to:
[0196] A generative adversarial loss is determined based on the discrimination result and a true source of the predicted speech, and the generative adversarial network is trained.
[0197] In an optional design, the discriminator includes a multi-scale spectrum discriminator; the input-output module 1002 is used to:
[0198] Inputting the predicted speech into the multi-scale spectrum discriminator, performing short-time Fourier transform on the predicted speech on the amplitude spectrum through multiple sub-discriminators of the multi-scale spectrum discriminator, and performing two-dimensional convolution processing on the predicted speech through multiple two-dimensional convolution layers to obtain a discrimination result of the predicted speech;
[0199] The short-time Fourier transform parameters of each sub-discriminator are different.
[0200] In an optional design, the discriminator includes a multi-scale complex spectrum discriminator; the input-output module 1002 is used to:
[0201] Inputting the predicted speech into the multi-scale complex spectrum discriminator, performing short-time Fourier transform on the predicted speech on the complex spectrum through multiple sub-discriminators of the multi-scale complex spectrum discriminator, and performing two-dimensional complex convolution processing on the predicted speech through multiple two-dimensional complex convolution layers to obtain a discrimination result of the predicted speech;
[0202] The short-time Fourier transform parameters of each sub-discriminator are different.
[0203] In an optional design, the first sub-model includes a text encoder, a duration regularizer, and a post-processing network; the acquisition module 1001 is used to:
[0204] Obtaining the actual pronunciation duration characteristics corresponding to each phoneme in the sample phonemes;
[0205] The input and output module 1002 is used to:
[0206] Encoding the sample phoneme by the text encoder to obtain the hidden layer features of the sample phoneme;
[0207] Performing frame expansion processing on the hidden layer features of the sample phonemes according to the real pronunciation duration features corresponding to each phoneme in the sample phonemes by the duration regularizer;
[0208] The post-processing network performs convolution processing on the hidden layer features of the sample phoneme after frame expansion to obtain the predicted phoneme posterior features of the sample phoneme.
[0209] In an optional design, the acquisition module 1001 is used to:
[0210] Obtaining true phoneme posterior features of the sample phoneme;
[0211] The training module 1003 is used to:
[0212] Calculate the loss function of the predicted phoneme posterior feature and the true phoneme posterior feature, train the first sub-model, and after the training is completed, the true pronunciation duration feature used to input the duration regularizer is replaced by the predicted pronunciation duration feature obtained by the duration predictor.
[0213] In an optional design, the first sub-model further includes a duration predictor, and the input-output module 1002 is configured to:
[0214] Predicting the hidden features of the sample phonemes by the duration predictor to obtain predicted pronunciation duration features corresponding to each phoneme in the sample phonemes;
[0215] The training module 1003 is used to:
[0216] Calculate the loss function of the predicted pronunciation duration feature and the actual pronunciation duration feature to train the first sub-model.
[0217] In an optional design, the acquisition module 1001 is used to:
[0218] Get style identifier;
[0219] The input and output module 1002 is used to:
[0220] The sample phonemes are encoded by the text encoder according to the style identifier to obtain hidden features of the sample phonemes corresponding to the style identifier.
[0221] In an optional design, the first sub-model further includes a fundamental frequency predictor; the input-output module 1002 is configured to:
[0222] The hidden layer features of the sample phonemes are predicted by the fundamental frequency predictor to obtain fundamental frequency features corresponding to the style identifier and the sample phonemes. The fundamental frequency features are used to input the second sub-model to obtain the predicted speech corresponding to the style identifier.
[0223] FIG11 is a schematic diagram of the structure of a speech synthesis device provided by an exemplary embodiment of the present application. The device includes a speech synthesis model trained by the device described in FIG10 . As shown in FIG11 , the device includes:
[0224] An acquisition module 1101 is configured to acquire a target phoneme of a target user and a timbre identifier of the target user, wherein the target phoneme is determined based on a target text, and the timbre identifier is used to identify the timbre of the target user;
[0225] An input-output module 1102 is configured to input the target phoneme into the first sub-model of the speech synthesis model to obtain a phoneme posterior feature of the target phoneme;
[0226] The input-output module 1102 is further configured to input the phoneme posterior features and the timbre identifier into the second sub-model of the speech synthesis model to obtain a target speech corresponding to the target text and the timbre identifier.
[0227] In an optional design, the acquisition module 1101 is used to:
[0228] Obtaining a target style identifier, where the target style identifier is used to identify the speech style of the target speech;
[0229] The input and output module 1102 is used to:
[0230] Inputting the target phoneme and the target style identifier into a first submodel of the speech synthesis model, obtaining the phoneme posterior feature of the target phoneme corresponding to the target style identifier and a target fundamental frequency feature corresponding to the target style identifier and the target phoneme;
[0231] The phoneme posterior feature, the timbre identifier and the target fundamental frequency feature are input into the second sub-model of the speech synthesis model to obtain the target speech corresponding to the target text, the timbre identifier and the target fundamental frequency feature.
[0232] It should be noted that the speech synthesis model training device provided in the above embodiment is merely exemplified by the division of the aforementioned functional modules. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, i.e., the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the speech synthesis model training device provided in the above embodiment and the speech synthesis model training method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0233] Similarly, the speech synthesis device provided in the above embodiment is merely illustrated by the division of the aforementioned functional modules. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, i.e., the internal structure of the device can be divided into different functional modules to perform all or part of the functions described above. Furthermore, the speech synthesis device provided in the above embodiment and the speech synthesis method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0234] An embodiment of the present application also provides a computer device, which includes: a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the training method or speech synthesis method of the speech synthesis model provided by the above-mentioned method embodiments.
[0235] Optionally, the computer device is a server. For example, FIG12 is a schematic diagram of the structure of a computer device provided by an exemplary embodiment of the present application.
[0236] The computer device 1200 includes a central processing unit (CPU) 1201, a system memory 1204 including a random access memory (RAM) 1202 and a read-only memory (ROM) 1203, and a system bus 1205 connecting the system memory 1204 and the CPU 1201. The computer device 1200 also includes a basic input / output system (I / O system) 1206 that facilitates information transmission between various components within the computer device, and a mass storage device 1207 for storing an operating system 1213, application programs 1214, and other program modules 1215.
[0237] The basic input / output system 1206 includes a display 1208 for displaying information and an input device 1209, such as a mouse and keyboard, for user input. Both the display 1208 and the input device 1209 are connected to the central processing unit 1201 via an input / output controller 1210 connected to the system bus 1205. The basic input / output system 1206 may also include an input / output controller 1210 for receiving and processing input from a variety of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1210 also provides output to a display screen, printer, or other types of output devices.
[0238] The mass storage device 1207 is connected to the central processing unit 1201 via a mass storage controller (not shown) connected to the system bus 1205. The mass storage device 1207 and its associated computer-readable storage medium provide non-volatile storage for the computer device 1200. In other words, the mass storage device 1207 may include a computer-readable storage medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0239] Without loss of generality, the computer-readable storage medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable storage instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electronically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other solid-state storage devices, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, tape cassettes, magnetic tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media are not limited to the above-mentioned ones. The above-mentioned system memory 1204 and mass storage device 1207 can be collectively referred to as memory.
[0240] The memory stores one or more programs, and the one or more programs are configured to be executed by one or more central processing units 1201. The one or more programs contain instructions for implementing the above-mentioned method embodiments. The central processing unit 1201 executes the one or more programs to implement the methods provided by the above-mentioned method embodiments.
[0241] According to various embodiments of the present application, the computer device 1200 may also be connected to a remote computer device on a network such as the Internet for operation. That is, the computer device 1200 may be connected to a network 1212 via a network interface unit 1211 connected to the system bus 1205, or the network interface unit 1211 may be used to connect to other types of networks or remote computer device systems (not shown).
[0242] The memory also includes one or more programs, which are stored in the memory and include steps executed by a computer device in the method provided in the embodiment of the present application.
[0243] A computer-readable storage medium is also provided in an embodiment of the present application, which stores at least one instruction, at least one program, code set or instruction set. When the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor of a computer device, the training method or speech synthesis method of the speech synthesis model provided in the above-mentioned method embodiments is implemented.
[0244] The present application also provides a computer program product, which includes a computer program. When the computer program product is run on a computer, it enables the computer device to execute the above-mentioned speech synthesis model training method or speech synthesis method.
[0245] Those skilled in the art will understand that all or part of the steps of implementing the above embodiments may be accomplished by hardware, or may be accomplished by a program instructing the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned readable storage medium may be a read-only memory, a disk or an optical disk, etc.
[0246] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent switches, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for training a speech synthesis model, the method being executed by a computer device, the method comprising: Acquire a sample phoneme of a target user and a timbre identifier of the target user, wherein the sample phoneme is determined based on a sample text corresponding to a sample speech of the target user, and the timbre identifier is used to identify the timbre of the target user; Inputting the sample phoneme into the first sub-model of the speech synthesis model to obtain predicted phoneme posterior features of the sample phoneme, wherein the predicted phoneme posterior features are used to reflect the features of each phoneme in the sample phoneme and the pronunciation duration features of each phoneme in the sample phoneme; Inputting the predicted phoneme posterior feature and the timbre identifier into a second sub-model of the speech synthesis model to obtain a predicted speech corresponding to the sample text and the timbre identifier, wherein the second sub-model obtains the predicted speech by predicting the predicted phoneme posterior feature and a predicted intermediate variable of the predicted speech, wherein the predicted intermediate variable is used to reflect the frequency domain characteristics of the predicted speech; The first sub-model is trained according to the predicted phoneme posterior features; and the second sub-model is trained according to the predicted speech and the predicted intermediate variables.
2. According to the method of claim 1, the second sub-model comprises a priori encoder and a decoder; the step of inputting the predicted phoneme posteriori features and the timbre identifier into the second sub-model of the speech synthesis model to obtain a predicted speech corresponding to the sample text and the timbre identifier comprises: Inputting the predicted phoneme posterior feature and the timbre identifier into the priori encoder to obtain the predicted intermediate variable; The decoder performs inverse Fourier transform on the prediction intermediate variable to obtain the predicted speech.
3. The method according to claim 2, wherein the a priori encoder comprises a phoneme a posteriori encoder; and the step of inputting the predicted phoneme a posteriori features and the timbre identifier into the a priori encoder to obtain the predicted intermediate variable comprises: The predicted phoneme posterior feature and the timbre identifier are input into the phoneme posterior encoder, and the mean and variance of the prior distribution of the predicted intermediate variable are sampled to obtain the predicted intermediate variable.
4. The method according to claim 2, wherein the second sub-model further comprises a posterior encoder; and the step of training the second sub-model according to the predicted intermediate variable comprises: Acquiring the sample speech; Inputting the sample speech into the posterior encoder to obtain a true intermediate variable; The relative entropy loss between the predicted intermediate variable and the true intermediate variable is calculated to train the second sub-model.
5. The method according to claim 4, wherein the a posteriori encoder comprises a posteriori predictor; and the step of inputting the sample speech into the a posteriori encoder to obtain a true intermediate variable comprises: The sample speech is input into the posterior predictor, and the mean and variance of the posterior distribution of the true intermediate variable are sampled to obtain the true intermediate variable.
6. The method according to claim 2, wherein the a priori encoder further comprises a phoneme posterior predictor, wherein the phoneme posterior predictor is used to predict the predicted phoneme posterior features in the pre-training process according to the predicted intermediate variables in the pre-training process during the pre-training of the second sub-model; the method further comprises: During the pre-training process of the second sub-model, a loss function between the predicted phoneme posterior features during the pre-training process and the real phoneme posterior features during the pre-training process is calculated to train the second sub-model.
7. The method according to claim 2, further comprising: Acquire a fundamental frequency feature corresponding to the sample phoneme and the style identifier, wherein the fundamental frequency feature is obtained by extracting features of the sample phoneme by the first sub-model based on the style identifier, and the style identifier is used to identify a speech style; The step of inputting the predicted phoneme posterior feature and the timbre identifier into the priori encoder to obtain the predicted intermediate variable comprises: The predicted phoneme posterior feature, the timbre identifier and the fundamental frequency feature are input into the priori encoder to obtain the predicted intermediate variable corresponding to the style identifier.
8. The method according to claim 2, wherein the decoder comprises an inverse Fourier transform decoder; wherein the decoder performs an inverse Fourier transform on the prediction intermediate variable to obtain the predicted speech, comprising: The predicted speech is obtained by performing inverse Fourier transform on the predicted intermediate variable through the inverse Fourier transform decoder.
9. The method according to claim 8, wherein the inverse Fourier transform decoder comprises a plurality of one-dimensional convolutional layers, and the last one-dimensional convolutional layer is connected to an inverse Fourier transform layer.
10. The method according to any one of claims 2 to 9, wherein the decoder further comprises a discriminator, and the discriminator and the part of the speech synthesis model other than the discriminator form a generative adversarial network; The method further comprises: Inputting the predicted speech into the discriminator to obtain a discrimination result of the predicted speech, wherein the discrimination result is used to reflect whether the predicted speech is real information or predicted information; The generative adversarial loss is determined according to the discrimination result and the true source of the predicted speech, and the generative adversarial network is trained.
11. The method according to any one of claims 1 to 9, wherein the first sub-model comprises a text encoder, a duration regularizer, and a post-processing network; The step of inputting the sample phoneme into the first sub-model of the speech synthesis model to obtain a predicted phoneme posterior feature of the sample phoneme includes: Obtaining the actual pronunciation duration characteristics corresponding to each phoneme in the sample phonemes; Encoding the sample phoneme by the text encoder to obtain the hidden layer features of the sample phoneme; The duration regularizer performs frame expansion processing on the hidden layer features of the sample phonemes according to the real pronunciation duration features corresponding to each phoneme in the sample phonemes; The post-processing network performs convolution processing on the hidden layer features of the sample phoneme after frame expansion to obtain the predicted phoneme posterior features of the sample phoneme.
12. The method according to claim 11, wherein the first sub-model further comprises a duration predictor, and the method further comprises: Predicting the hidden layer features of the sample phonemes by the duration predictor to obtain predicted pronunciation duration features corresponding to each phoneme in the sample phonemes; The loss function of the predicted pronunciation duration feature and the real pronunciation duration feature is calculated, and the first sub-model is trained. After the training is completed, the real pronunciation duration feature used to input the duration regularizer is replaced by the predicted pronunciation duration feature obtained by the duration predictor.
13. The method according to claim 11, further comprising: Get style identifier; The step of encoding the sample phoneme by the text encoder to obtain the hidden features of the sample phoneme includes: The sample phonemes are encoded by the text encoder according to the style identifier to obtain hidden features of the sample phonemes corresponding to the style identifier.
14. The method according to claim 13, wherein the first sub-model further comprises a fundamental frequency predictor; the method further comprising: The hidden layer features of the sample phonemes are predicted by the fundamental frequency predictor to obtain fundamental frequency features corresponding to the style identifier and the sample phonemes, and the fundamental frequency features are used to input the second sub-model to obtain the predicted speech corresponding to the style identifier.
15. A speech synthesis method, the method being executed by a computer device, the computer device comprising the speech synthesis model trained by any one of the methods of claims 1 to 14, the method comprising: Acquire a target phoneme of a target user and a timbre identifier of the target user, wherein the target phoneme is determined based on a target text, and the timbre identifier is used to identify the timbre of the target user; Inputting the target phoneme into the first sub-model of the speech synthesis model to obtain a phoneme posterior feature of the target phoneme; The phoneme posterior features and the timbre identifier are input into the second sub-model of the speech synthesis model to obtain a target speech corresponding to the target text and the timbre identifier.
16. A training device for a speech synthesis model, the device comprising: An acquisition module, used to acquire sample phonemes of a target user and a timbre identifier of the target user, wherein the sample phonemes are determined based on a sample text corresponding to a sample speech of the target user, and the timbre identifier is used to identify the timbre of the target user; An input-output module, used for inputting the sample phoneme into the first sub-model of the speech synthesis model to obtain predicted phoneme posterior features of the sample phoneme, wherein the predicted phoneme posterior features are used to reflect the features of each phoneme in the sample phoneme and the pronunciation duration features of each phoneme in the sample phoneme; The input-output module is further used to input the predicted phoneme posterior feature and the timbre identifier into the second sub-model of the speech synthesis model to obtain the predicted speech corresponding to the sample text and the timbre identifier, wherein the second sub-model obtains the predicted speech by predicting the predicted phoneme posterior feature and the predicted intermediate variable of the predicted speech, and the predicted intermediate variable is used to reflect the frequency domain characteristics of the predicted speech; A training module is used to train the first sub-model according to the predicted phoneme posterior features; and to train the second sub-model according to the predicted speech and the predicted intermediate variables.
17. A speech synthesis device, comprising the speech synthesis model trained by the device according to claim 16, the device comprising: An acquisition module, used for acquiring a target phoneme of a target user and a timbre identifier of the target user, wherein the target phoneme is determined based on a target text, and the timbre identifier is used for identifying the timbre of the target user; An input-output module, used for inputting the target phoneme into the first sub-model of the speech synthesis model to obtain the phoneme posterior feature of the target phoneme; The input-output module is also used to input the phoneme posterior features and the timbre identifier into the second sub-model of the speech synthesis model to obtain a target speech corresponding to the target text and the timbre identifier.
18. A computer device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the training method of the speech synthesis model as described in any one of claims 1 to 14, or the speech synthesis method as described in claim 15.
19. A computer-readable storage medium, wherein at least one instruction, at least one program, code set or instruction set is stored in the readable storage medium, and the at least one instruction, the at least one program, the code set or instruction set is loaded and executed by a processor to implement the training method of the speech synthesis model as described in any one of claims 1 to 14, or the speech synthesis method as described in claim 15.
20. A computer program product, comprising a computer program, which, when executed on a computer, enables the computer to execute the training method for a speech synthesis model as described in any one of claims 1 to 14, or the speech synthesis method as described in claim 15.
