Speech synthesis method based on neural audio codec

Through the speech synthesis method based on the neural audio codec, the problems of speech synthesis quality and high model deployment cost in the existing technology are solved, and efficient and low-cost speech synthesis is achieved, which is suitable for a variety of application scenarios.

CN118430508BActive Publication Date: 2024-09-17CHINA UNIV OF MINING & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410677482.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-09-17
Estimated Expiration
2044-05-29

AI Technical Summary

Technical Problem

Existing speech synthesis technology requires a large amount of data and complex model training when generating high-quality speech, resulting in insufficient adaptability to new speakers, and high model deployment costs, making it difficult to deploy on a wide range of computing platforms.

Method used

A speech synthesis method based on neural audio codec is adopted, through the pre-built speech synthesis model Zero-TTS, using the speech prediction encoder and speech feature decoupling module, combined with the neural audio codec, to generate a speech that is adapted to the target speaker. Target speech, reducing the need for target speaker data and model fine-tuning.

Benefits of technology

It achieves high-efficiency, high-quality, and high-fidelity speech synthesis, which is suitable for communication among people with visual and hearing impairments and improves the level of human-computer interaction, and reduces the deployment cost of speech synthesis models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118430508B
    Figure CN118430508B
Patent Text Reader

Abstract

The present invention relates to a speech synthesis method based on a neural audio codec. It comprises: loading a reference speech and a text to be synthesized into a pre-built speech synthesis model Zero-TTS, a speech prediction encoder receiving the text to be synthesized, and performing speech prediction on the text to be synthesized to generate text-speech prediction coding after speech prediction, a neural audio codec receiving the reference speech, and reconstructing the text-speech prediction coding and the speaker feature coding of the target speaker in the neural audio codec to generate a target speech adapted to the target speaker after reconstruction. The present invention can improve the speech synthesis quality of the target speaker, greatly reduce the demand for data of the target speaker and model fine-tuning, and realize the generation of the target speech with high efficiency, high quality and high fidelity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a speech synthesis method, in particular to a speech synthesis method based on a neural audio codec. Background Art

[0002] With the development of artificial intelligence, people's demand for intelligent life has become more urgent. At present, speech synthesis technology has played an important role in the fields of auxiliary communication for people with hearing and visual impairments, artificial intelligence art creation, and human-computer interaction of intelligent devices, promoting the development of industrial intelligence and improving people's living standards.

[0003] Traditional speech synthesis methods rely on statistical parameter synthesis and audio splicing, and the synthesized speech is of low quality and unrealistic. Deep learning synthesis models can generate high-quality speech, but deep learning synthesis models need to be trained. During training, a large amount of speech data and text data of the corresponding speakers are required. For new speakers, complex and tedious fine-tuning and new data resources are required. As a result, low-quality speech synthesis can no longer meet people's needs; and complex deep learning models will increase the user's cost of use. The limitations of different speech synthesis methods have restricted the promotion and application of speech synthesis technology and hindered the development of the artificial intelligence industry.

[0004] Existing multi-speaker speech synthesis methods based on deep learning use acoustic models to model the acoustic features of different speakers, but cannot adaptively obtain speaker information, resulting in insufficient generalization of the model for different speakers. Multi-speaker adaptive synthesis methods based on large models are limited by the large number of model parameters and are difficult to deploy on a wider range of computing platforms.

[0005] The application document with publication number CN117649839A records a personalized speech synthesis method based on low-rank adaptation. The application obtains a lighter and more fidelity speech synthesis model through a low-rank speech synthesis network based on variational inference, which can improve the speed and quality of speech synthesis. However, the application only has a good modeling ability for trained speakers. When unknown speakers are input into the network, the invention loses its function.

[0006] The application document with publication number CN117496944A records a multi-emotion multi-speaker speech synthesis method. The application obtains text features through a text feature extraction module, extracts emotional features through an emotional encoding module, and combines emotional features with text features to generate speech with specific emotions. However, the application only models the timbre of a given speaker and converts emotions. When the required emotion category or speaker is beyond the scope of the training set, the model cannot be effectively synthesized. Summary of the invention

[0007] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a speech synthesis method based on a neural audio codec, which can improve the speech synthesis quality of a target speaker, greatly reduce the demand for target speaker data and model fine-tuning, and achieve high-efficiency, high-quality, and high-fidelity generation of the target speech.

[0008] According to the technical solution provided by the present invention, a speech synthesis method based on a neural audio codec comprises:

[0009] Provide the text to be synthesized and the reference speech of the target speaker, and load the reference speech and the text to be synthesized into the pre-built speech synthesis model Zero-TTS, wherein:

[0010] The speech synthesis model Zero-TTS includes a neural audio codec, a speech feature decoupling module and a speech prediction encoder, wherein the speech prediction encoder, the speech feature decoupling module and the neural audio codec are adaptively connected;

[0011] The speech prediction encoder receives the text to be synthesized, and performs speech prediction on the text to be synthesized to generate text-speech prediction code after the speech prediction, and loads the generated text-speech prediction code into the neural audio codec;

[0012] The neural audio codec receives the reference speech, and performs speech encoding and code continuous quantization on the received reference speech in sequence, so as to generate a reference speech continuous residual quantization code after the code continuous quantization, and loads the generated reference speech continuous residual quantization code into the speech feature decoupling module;

[0013] The received reference speech continuous residual is quantized and encoded, and the speech feature decoupling module extracts the speaker feature code of the target speaker, and the extracted speaker feature code of the target speaker is loaded into the neural audio codec;

[0014] Within the neural audio codec, the text-to-speech prediction coding and the speaker feature coding of the target speaker are reconstructed to generate a target speech adapted to the target speaker after reconstruction.

[0015] The neural audio codec includes a neural audio encoder, a neural audio decoder and a continuous residual vector quantizer, wherein:

[0016] For a reference speech, the neural audio encoder performs speech encoding on the reference speech to generate reference speech encoding information after speech encoding;

[0017] The continuous residual vector quantizer performs encoding and continuous quantization on the reference speech coding information to generate a reference speech continuous residual quantization code after encoding and continuous quantization;

[0018] The neural audio decoder reconstructs the speech prediction coding and the speaker feature coding of the target speaker to generate a target speech adapted to the target speaker after reconstruction.

[0019] The speech feature decoupling module at least includes a speaker feature encoder, wherein:

[0020] The continuous residual of the reference speech is quantized and encoded, and the speaker feature encoder extracts the speaker feature code of the target speaker, and the speaker feature code of the target speaker is loaded into the neural audio decoder.

[0021] The speech coding predictor includes a text semantic encoder, a random duration predictor, and a regularization stream, wherein:

[0022] The text semantic encoder encodes the synthetic text to generate a text semantic encoding after encoding;

[0023] A random duration predictor generates duration information of the text to be synthesized based on random sampling;

[0024] Based on the text semantic coding of the text to be synthesized and the duration information of the text to be synthesized, a text-to-speech predictive coding is generated through a regularized flow.

[0025] When building the speech synthesis model Zero-TTS, the construction method includes:

[0026] Construct a basic model for speech synthesis and a basic model training data set for training the basic model for speech synthesis, wherein:

[0027] A speech synthesis basic model, including a neural audio codec basic unit, a speech feature decoupling basic unit and a speech prediction coding basic unit, wherein the speech prediction basic unit and the speech feature decoupling basic unit are both adaptively connected to the neural audio codec basic unit;

[0028] The basic model training data set includes a plurality of basic model training samples, each of which includes a training prompt tone and a training prompt text corresponding to the training prompt tone;

[0029] The basic model training data set is divided to generate at least a training sample set A and a training verification set B, wherein the speaker from which the training prompt sound of the training sample set A comes is consistent with the speaker from which the training prompt sound of the training verification set B comes, and the training samples in the training sample set A are completely different from the training samples in the training verification set B;

[0030] After a round of model training of the speech synthesis basic model using the training sample set A, the model loss of the speech synthesis basic model after the current round of model training is calculated using the training validation set B;

[0031] After performing a target round of model training on the speech synthesis basic model using the training sample set A, a preferred model loss value is determined among all calculated model losses;

[0032] A corresponding speech synthesis basic model is selected based on the determined model loss preferred value, and the selected speech synthesis basic model is configured as a speech synthesis model Zero-TTS.

[0033] The neural audio codec basic unit includes a neural audio basic encoder, a continuous residual vector quantization basic unit, and a neural audio basic decoder;

[0034] Before training the basic model for speech synthesis using the basic model training data set, the encoder pre-training weights generated by the pre-training are loaded into the neural audio basic encoder;

[0035] For each training prompt tone in the basic model training sample, the neural audio basic encoder performs speech encoding on the training prompt tone to generate training speech encoding information after speech encoding;

[0036] The continuous residual vector quantization basic unit performs encoding and continuous quantization on the training speech coding information to generate a training speech continuous vector coding after the encoding and continuous quantization;

[0037] When the selected speech synthesis basic model is used as the speech synthesis model Zero-TTS, a neural audio codec in the speech synthesis model Zero-TTS is formed based on the neural audio codec basic unit in the selected speech synthesis basic model.

[0038] The speech feature decoupling basic unit includes a speech semantic encoder, a speaker feature basic encoder and a logarithmic Mel spectrum decoder, where:

[0039] Encode the training speech continuous vector, extract speech semantics using a speech semantic encoder to generate a sample speech semantic encoding, and extract the speaker feature encoding of the training prompt sound using a speaker feature base encoder;

[0040] During model training, the sample speech semantic coding is compared and purified with the sample text semantic coding generated by the speech prediction basic unit to obtain the speech semantic comparison and purification coding;

[0041] Loading the speech semantic contrast purification code and the speaker feature code of the training prompt sound into a logarithmic Mel spectrum decoder, so that the logarithmic Mel spectrum decoder generates a decoupled logarithmic Mel spectrum of the training sample;

[0042] Maximize the likelihood of synthesized logarithmic Mel spectrum, minimize the distance between text semantics and speech semantics, and purify speaker features based on the information frequency constructed by the encoder-decoder structure of the codec;

[0043] When the selected speech synthesis basic model is used as the speech synthesis model Zero-TTS, a speech feature decoupling module is formed based on the speech feature decoupling basic unit, wherein:

[0044] The speaker feature encoder in the speech feature decoupling module is formed based on the speaker feature base encoder.

[0045] The basic unit for speech prediction includes a basic text semantic encoder, a basic random duration predictor, and a basic regularization flow, wherein:

[0046] For any training sample in the training sample set A, the basic text-to-speech encoder encodes the training prompt text to generate a semantic code of the training text after encoding, and loads the generated semantic code of the training text into the speech feature decoupling basic unit;

[0047] Based on the semantic encoding of the training text, the basic random duration predictor predicts the distribution of the duration alignment information of the training prompt text.

[0048] During model training, the continuous vector of the prompt speech generated by the continuous residual vector quantization basic unit is encoded, and the latent variable is calculated through the basic regularization flow;

[0049] A monotone alignment search method is used to determine the alignment matrix between the latent variable and the current training prompt text;

[0050] A basic random duration predictor predicts the distribution of the alignment matrix, and optimizes the basic random duration predictor based on minimization of a maximum likelihood estimate of the alignment matrix distribution;

[0051] When the selected speech synthesis basic model is used as the speech synthesis model Zero-TTS, a speech prediction encoder in the speech synthesis model Zero-TTS is formed based on the speech prediction basic unit.

[0052] When calculating the model loss, include:

[0053]

[0054] Among them, L backbone is the loss of the backbone network, L C-RVQ is the encoding contrast loss of the backbone network, L recon is the speech contrast loss of the backbone network, L adv is the speech discrimination loss of the backbone network, L disThe training loss of the basic unit for decoupling speech features, L mel is the spectral contrast loss of the logarithmic Mel spectrum decoder, L sem is the semantic contrast loss.

[0055] When building a basic model training dataset, include:

[0056] Providing a basic data set for model training, wherein the basic data set for model training includes a plurality of basic samples, and any basic sample includes a basic prompt tone and a basic text corresponding to the basic prompt tone;

[0057] Each basic sample is standardized to generate a training sample after the standardization, where:

[0058] When the basic prompt sound in the basic sample is standardized, it includes sequential downsampling and loudness normalization;

[0059] Standardization of the base text within the base sample included adding a space after all symbols in the base text and / or capitalizing the first letter of each sentence;

[0060] When the basic samples are standardized to generate training samples, the text to be synthesized and the reference speech are subjected to the same standardization process before speech synthesis.

[0061] The advantages of the present invention are as follows: for synthesized text, a speech prediction encoder is used to perform speech prediction and generate text-speech prediction code; for reference speech, a neural audio codec is used to generate a reference speech continuous residual quantization code, a speech feature decoupling module is used to extract the speaker feature code of the target speaker, and in the neural audio codec, the text-speech prediction code and the speaker feature code of the target speaker are reconstructed to generate a target speech adapted to the target speaker after reconstruction;

[0062] When generating the target speech, the need for reference speech and fine-tuning of the speech synthesis model Zero-TTS can be greatly reduced, achieving efficient, high-quality, and high-fidelity generation of the target speech, which can help the hearing-impaired people communicate and improve the level of artificial intelligence applications and human-computer interaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 A schematic diagram of an embodiment of the present invention for training and generating a speech synthesis model Zero-TTS and performing speech synthesis using the speech synthesis model Zero-TTS.

[0064] Figure 2 A schematic diagram of an embodiment of a neural audio codec of the present invention.

[0065] Figure 3 A schematic diagram of an embodiment of the speech feature decoupling module and the neural audio codec during model training of the present invention.

[0066] Figure 4 It is a schematic diagram of the optimization effect of the speech feature decoupling basic unit in the training stage of the present invention.

[0067] Figure 5 Schematic diagram of the decoupling effect of the speech synthesis model Zero-TTS of the present invention on different data sets.

[0068] Figure 6 A schematic diagram of an embodiment of a neural audio encoder of the present invention.

[0069] Figure 7 for Figure 6 Schematic diagram of an embodiment of a residual unit in FIG.

[0070] Figure 8 A schematic diagram of the operation of a continuous residual vector quantizer according to an embodiment of the present invention. DETAILED DESCRIPTION

[0071] The present invention will be further described below in conjunction with specific drawings and embodiments.

[0072] In order to improve the speech synthesis quality of the target speaker and greatly reduce the demand for target speaker data and model fine-tuning, a speech synthesis method based on a neural audio codec is provided in an embodiment of the present invention, wherein the speech synthesis method comprises:

[0073] Provide the text to be synthesized and the reference speech of the target speaker, and load the reference speech and the text to be synthesized into the pre-built speech synthesis model Zero-TTS, wherein:

[0074] The speech synthesis model Zero-TTS includes a neural audio codec, a speech feature decoupling module and a speech prediction encoder, wherein the speech prediction encoder, the speech feature decoupling module and the neural audio codec are adaptively connected;

[0075] The speech prediction encoder receives the text to be synthesized, and performs speech prediction on the text to be synthesized to generate text-speech prediction code after the speech prediction, and loads the generated text-speech prediction code into the neural audio codec;

[0076] The neural audio codec receives the reference speech, and performs speech encoding and code continuous quantization on the received reference speech in sequence, so as to generate a reference speech continuous residual quantization code after the code continuous quantization, and loads the generated reference speech continuous residual quantization code into the speech feature decoupling module;

[0077] The received reference speech continuous residual is quantized and encoded, and the speech feature decoupling module extracts the speaker feature code of the target speaker, and the extracted speaker feature code of the target speaker is loaded into the neural audio codec;

[0078] Within the neural audio codec, the text-to-speech prediction coding and the speaker feature coding of the target speaker are reconstructed to generate a target speech adapted to the target speaker after reconstruction.

[0079] It should be noted that when performing speech synthesis, it is generally necessary to provide a text to be synthesized and a reference speech of a target speaker. The reference speech of the target speaker is a passage spoken by the target speaker and used as a reference for speech synthesis. The text to be synthesized is the content expressed in words, wherein the text to be synthesized is synthesized with the reference speech, that is, the text to be synthesized is output in speech with the reference speech as a benchmark. Therefore, the purpose of speech synthesis in the present invention is consistent with the prior art.

[0080] In order to achieve high-quality speech synthesis, the present invention needs to pre-build a speech synthesis model Zero-TTS. Figure 1 An embodiment of speech synthesis using a pre-built speech synthesis model Zero-TTS is shown in the figure. In the figure, the speech synthesis model Zero-TTS includes a speech prediction encoder, a speech feature decoupling module and a neural audio codec. The speech prediction encoder, the speech feature decoupling module and the neural audio codec are adaptively connected, wherein the text to be synthesized is loaded into the speech prediction encoder, and the reference speech is loaded into the neural audio codec (neural speech codec).

[0081] During speech synthesis, the speech prediction encoder performs speech prediction on the text to be synthesized, wherein speech prediction is to predict the speech corresponding to the text to be synthesized based on the content of the text to be synthesized. After speech prediction, a text-to-speech prediction code can be generated. In order to perform speech synthesis, the text-to-speech prediction code needs to be loaded into the neural audio codec.

[0082] At the same time, the neural audio codec performs speech encoding and continuous quantization of the reference speech in sequence to generate a continuous residual quantization code of the reference speech after the continuous quantization of the code. In order to obtain the speaker feature coding of the target speaker, it is necessary to load the generated continuous residual quantization code of the reference speech into the speech feature decoupling module. The speech feature decoupling module can perform feature extraction on the continuous residual quantization code of the reference speech to obtain the speaker feature coding of the target speaker, and load the extracted speaker feature coding of the target speaker into the neural audio codec. It should be noted that the continuous residual quantization code of the reference speech generally includes speaker feature coding and reference speech coding. It can be seen that the speaker feature coding of the target speaker is the feature coding other than the reference speech coding.

[0083] In the neural audio codec, the text-to-speech prediction coding and the speaker feature coding of the target speaker are reconstructed to generate a target speech adapted to the target speaker after reconstruction. The target speech is adapted to the target speaker, specifically, the target speech is consistent with the target speaker's speaking style, such as the timbre and speaking style (rhythm, intonation, etc.) of the speech. At this time, the speech synthesis of the text to be synthesized and the reference speech is achieved.

[0084] In one embodiment of the present invention, the neural audio codec includes a neural audio encoder, a neural audio decoder and a continuous residual vector quantizer, wherein:

[0085] For a reference speech, the neural audio encoder performs speech encoding on the reference speech to generate reference speech encoding information after speech encoding;

[0086] The continuous residual vector quantizer performs encoding and continuous quantization on the reference speech coding information to generate a reference speech continuous residual quantization code after encoding and continuous quantization;

[0087] The neural audio decoder reconstructs the speech prediction coding and the speaker feature coding of the target speaker to generate a target speech adapted to the target speaker after reconstruction.

[0088] Figure 1 An embodiment of a neural audio codec is shown in FIG. 1 , in which the neural audio codec includes a neural audio encoder, a neural audio decoder, and a continuous residual vector quantizer, wherein: Figure 1 In the figure, the multiple square grid areas between the neural audio encoder and the neural audio decoder are continuous residual vector quantizers. Figure 2 and Figure 3 An embodiment of a continuous residual vector quantizer is shown in Figure 2 and Figure 3It can be known that the continuous residual vector quantizer may include a residual vector quantizer and a coding layer, wherein the neural audio encoder is connected to the residual vector quantizer, and the residual vector quantizer is adaptively connected to the neural audio decoder through the coding layer.

[0089] During speech synthesis, a neural audio encoder is used to perform speech encoding on a reference speech, so that reference speech coding information can be generated after speech encoding. A continuous residual vector quantizer encodes and continuously quantizes the reference speech coding information to generate a reference speech continuous residual quantization code. As can be seen from the above description, the generated reference speech continuous residual quantization code can be feature extracted by a speech feature decoupling module to obtain a speaker feature code of a target speaker. For a neural audio decoder, the speech prediction code and the speaker feature code of the target speaker can be reconstructed to generate a target speech adapted to the target speaker after reconstruction.

[0090] The following is a detailed explanation of the method and process of encoding and continuous quantization of the continuous residual vector quantizer; specifically:

[0091] The continuous residual vector quantizer uses multiple codebooks to quantize the code layer by layer, extracts different granularity features in a residual manner, and finally uses a learnable weighted vector to sum the different granularity features to obtain a continuous vector, which is called continuous quantization coding. The code can be quantized by the residual vector quantizer, and a continuous vector is generated by weighted summation through the coding layer. Generally, the continuous residual vector quantizer includes N layers of quantizers, such as Figure 2 and Figure 3 As shown, Figure 2 and Figure 3 In the figure, the width of the continuous residual vector quantizer is T, and the width T may be related to the audio duration. For example, the width T may be selected to be 200 times the speech duration. In specific implementation, the width T may be selected and determined according to the speech synthesis scenario.

[0092] Figure 8 An embodiment of the operation of the continuous residual vector quantizer is shown in FIG. In the figure, Q0 to Q11 are quantizers, and RVQ0 to RVQ11 are quantization codes, that is, an embodiment of the continuous residual vector quantizer as a 12-layer quantizer is shown, and N is 12 at this time; quantizers Q0 to Q11 are connected in sequence. When working, the reference speech coding information output by the neural audio encoder is loaded into the quantizer Q0, and the discrete vector code 0 can be obtained through the quantizer Q0, wherein the discrete vector code 0 is also the quantization code RVQ0.

[0093] Subtracting discrete vector code 0 from the reference speech coding information will yield residual 0; thereafter, residual 0 is quantized by quantizer Q1 to yield discrete vector code 1, where discrete vector code 1 is quantized code RVQ1. Subtracting discrete vector code 1 from residual 0 will yield residual 1; residual 1 is quantized by quantizer Q2 to yield discrete vector code 2. The quantization process for other situations can refer to the quantization description of quantizer Q0 to quantizer Q2, that is, the method and process of extracting different granularity features in the form of residuals between quantizer Q2 to quantizer Q11 can refer to the working description of quantizer Q0 to quantizer Q1 here.

[0094] By performing weighted summation on discrete vector code 0 and discrete vector code 1 to discrete vector code 11, a continuous residual quantization code can be generated, so that a reference speech continuous residual quantization code can be generated for the reference speech. Figure 3 The coding layer in is to perform weighted summation on discrete vector code 0, discrete vector code 1 to discrete vector code 11, so as to generate continuous residual quantization code after weighted summation. Figure 2 and Figure 3 The continuous residual quantization coding in is the result of generating the continuous residual quantization coding after weighted summation.

[0095] Figure 2 and Figure 3 An embodiment of a neural audio encoder and a neural audio decoder is also shown in the figure. In the figure, the neural audio encoder includes 4 sequentially connected coding blocks, each coding block can be in the same form. Figure 6 An embodiment of a neural audio encoder is shown in the figure. In addition to four sequentially connected coding blocks, the neural audio encoder also includes a coding preamble and a coding postamble. In the figure, the coding preamble can be used to receive reference speech, and the coding postamble can be used to output reference speech coding information. The coding preamble is connected to the coding postamble through four sequentially connected coding blocks.

[0096] Figure 6 In the encoding, the leading part may include a leading one-dimensional convolution, a leading weight normalization, and a leading Sanke activation function connected in sequence; the trailing part of the encoding may include a trailing Snake activation function, a trailing weight normalization, and a trailing one-dimensional convolution connected in sequence.

[0097] For each coding block, it may include a first residual unit of the coding block, a second residual unit of the coding block, a third residual unit of the coding block, a Snake activation function of the coding block, a one-dimensional convolution of the coding block, and a weight normalization of the coding block, which are connected in sequence. Figure 6 The coding block × 4 in the figure represents four coding blocks of the neural audio encoder. When working, each coding block receives the input of the coding block in the previous layer and performs corresponding coding processing based on the above structure.

[0098] The first residual unit of the coding block, the second residual unit of the coding block, and the third residual unit of the coding block in the coding block may adopt the same structural form. Figure 7 An embodiment of a residual unit is shown in the figure, in which the residual unit includes a Snake activation function in the residual unit, a one-dimensional convolution in the residual unit, and a weight normalization in the residual unit, and the input of the Snake activation function loaded into the residual unit and the weight normalization in the residual unit are multiplied by a multiplier in the residual unit and then output.

[0099] For the neural audio decoder, a structural distribution symmetrical to that of the neural audio encoder can be adopted, so that the form of the neural audio decoder can be obtained based on the symmetry of the neural audio encoder. The method of symmetrically obtaining the neural audio decoder by the neural audio encoder can be consistent with the existing method, and the specific purpose of achieving speech reconstruction shall prevail.

[0100] From the above description, it can be seen that the neural audio codec of the present invention can form the network architecture of the existing VQGan. In the neural network encoder, each Snake activation function can adopt the same form, such as the leading Snake activation function, the trailing Snake activation function, the coding block Snake activation function, and the Snake activation function in the residual unit can adopt the existing commonly used form. For the Snake activation function, a feasible form is:

[0101]

[0102] Where x is the input data and a is the periodic frequency of the input signal, which is a learnable value. The Snake activation function can better capture the frequency information of the periodic signal.

[0103] In one embodiment of the present invention, the speech feature decoupling module comprises at least a speaker feature encoder, wherein:

[0104] The continuous residual of the reference speech is quantized and encoded, and the speaker feature encoder extracts the speaker feature code of the target speaker, and the speaker feature code of the target speaker is loaded into the neural audio decoder.

[0105] Depend on Figure 1 It can be seen that when performing speech synthesis, it is only necessary to use the speech feature decoupling module to extract the speaker coding features of the target speaker. Therefore, when performing speech synthesis, the speech feature decoupling module may only include a speaker feature encoder, and the speaker feature encoder may be used to extract the speaker coding features of the target speaker, and the speaker feature encoding of the target speaker may be recorded in the neural audio decoder. Figure 2 and Figure 3In the embodiment, the speaker feature encoding extracted by the speech feature decoding module is loaded into the adder connected to the neural audio decoder, and can then be read by the neural audio decoder.

[0106] In one embodiment of the present invention, the speech coding predictor includes a text semantic encoder, a random duration predictor and a regularization stream, wherein:

[0107] The text semantic encoder encodes the synthetic text to generate a text semantic encoding after encoding;

[0108] A random duration predictor generates duration information of the text to be synthesized based on random sampling;

[0109] Based on the text semantic coding of the text to be synthesized and the duration information of the text to be synthesized, a text-to-speech predictive coding is generated through a regularized flow.

[0110] Figure 1 An embodiment of a speech coding predictor is shown in the figure, in which the speech prediction encoder may include at least a text-to-speech encoder, a random duration predictor, and a regularization stream, wherein the provided text to be synthesized is loaded into a text semantic encoder and encoded by the text-to-speech encoder to generate a text semantic code after encoding.

[0111] The obtained text semantic coding is predicted by using the anytime duration predictor to obtain the duration information of the text to be synthesized. Since the random duration predictor generates duration distribution information based on random sampling, that is, randomness is introduced, the generated text-semantic prediction coding can be closer to the way humans speak. Specifically, the duration information predicted by the random duration predictor obeys a quasi-Gaussian distribution, and is mapped to the predicted duration information by randomly sampling the standard Gaussian distribution, so as to obtain the duration of the text to be synthesized.

[0112] Based on the text semantic coding of the text to be synthesized and the duration distribution information of the text to be synthesized, a text-to-speech predictive coding is generated through a regularized flow.

[0113] The above-mentioned speech synthesis model Zero-TTS can be constructed by the following construction method. In one embodiment of the present invention, when constructing the speech synthesis model Zero-TTS, the construction method includes:

[0114] Construct a basic model for speech synthesis and a basic model training data set for training the basic model for speech synthesis, wherein:

[0115] A speech synthesis basic model, including a neural audio codec basic unit, a speech feature decoupling basic unit and a speech prediction coding basic unit, wherein the speech prediction basic unit and the speech feature decoupling basic unit are both adaptively connected to the neural audio codec basic unit;

[0116] The basic model training data set includes a plurality of basic model training samples, each of which includes a training prompt tone and a training prompt text corresponding to the training prompt tone;

[0117] The basic model training data set is divided to generate at least a training sample set A and a training verification set B, wherein the speaker from which the training prompt sound of the training sample set A comes is consistent with the speaker from which the training prompt sound of the training verification set B comes, and the training samples in the training sample set A are completely different from the training samples in the training verification set B;

[0118] After a round of model training of the speech synthesis basic model using the training sample set A, the model loss of the speech synthesis basic model after the current round of model training is calculated using the training validation set B;

[0119] After performing a target round of model training on the speech synthesis basic model using the training sample set A, a preferred model loss value is determined among all calculated model losses;

[0120] A corresponding speech synthesis basic model is selected based on the determined model loss preferred value, and the selected speech synthesis basic model is configured as a speech synthesis model Zero-TTS.

[0121] In specific implementation, it is necessary to first construct a speech synthesis basic model. After model training, the speech synthesis model Zero-TTS can be generated from the speech synthesis basic model. Since the speech synthesis model Zero-TTS can be obtained by training the speech synthesis basic model, the architecture of constructing the speech synthesis basic model should be consistent with the architecture of the speech synthesis model Zero-TTS. Therefore, the speech synthesis basic model may include a neural audio codec basic unit, a speech feature decoupling basic unit, and a speech prediction coding basic unit. After model training, a neural audio codec can be formed based on the neural audio codec basic unit, a speech feature decoupling module can be formed based on the speech feature decoupling basic unit, and a speech prediction encoder can be formed based on the speech prediction coding basic unit.

[0122] For the basic model training data set, it may include several basic model training samples, each basic model training sample includes a training prompt sound and a training prompt text corresponding to the training prompt sound, wherein the training prompt text corresponds to the training prompt sound, specifically meaning that the training prompt text can be obtained from the training prompt sound, and the two have the same meaning.

[0123] In one embodiment of the present invention, when constructing a basic model training data set, it includes:

[0124] Providing a basic data set for model training, wherein the basic data set for model training includes a plurality of basic samples, and any basic sample includes a basic prompt tone and a basic text corresponding to the basic prompt tone;

[0125] Each basic sample is standardized to generate a training sample after the standardization, where:

[0126] When the basic prompt sound in the basic sample is standardized, it includes sequential downsampling and loudness normalization;

[0127] Standardization of the base text within the base sample included adding a space after all symbols in the base text and / or capitalizing the first letter of each sentence;

[0128] When the basic samples are standardized to generate training samples, the text to be synthesized and the reference speech are subjected to the same standardization process before speech synthesis.

[0129] During specific implementation, the basic data set for model training can adopt existing commonly used data sets, such as the LibriTTS data set, the VCTK data set, the Hi-Fi TTS data set or one of the TED-LIUM corpus. For example, the LibriTTS data set can be selected as the basic data set for model training. The LibriTTS data set is a multi-speaker English corpus containing about 585 hours of English speech data from 2456 speakers with a sampling rate of 24kHz.

[0130] In addition, it should be noted that the VCTK dataset contains speech samples from 109 native English speakers with different accents. Each speaker contributed about 400 segments of speech data, with a sampling rate of 48kHz and 16 bits. The Hi-Fi TTS dataset contains about 291.6 hours of speech from 10 speakers, with each speaker contributing at least 17 hours of data, with a sampling rate of 44.1kHz. The TED-LIUM corpus includes 118 hours of English TED speeches, with a sampling rate of 16kHz. Of course, other commonly used speech datasets can also be used as the basic datasets for model training, and we will not give examples one by one here.

[0131] It should be noted that in the data set, the loudness of different voices is generally different, and the duration of some text-voice pairs is too long or too short, which is not conducive to model training. Therefore, in order to improve the reliability of model training, it is necessary to filter out the corresponding text-voice pairs, and the filtered text-voice pairs are the voice and the text corresponding to the language. When filtering out text-voice pairs, a feasible way is to filter out the corresponding text-voice pairs by eliminating voices with a length between 2 seconds and 15 seconds; of course, other methods can also be used to filter out the corresponding text-voice pairs.

[0132] After filtering out the text-speech pairs, among the remaining text-speech pairs, a basic training sample is formed using one text-speech pair, that is, in the above-mentioned speech database after filtering out the text-speech pairs, each segment of speech and the text corresponding to each segment of speech are configured as a basic training sample. In the basic training sample, the correspondence between the basic prompt sound and the basic text is consistent with the correspondence between the above-mentioned training prompt sound and the training text. For details, please refer to the above description, which will not be repeated here. In specific implementation, the speaker of the reference speech may be completely different from the speaker of the basic training sample, that is, the speech synthesis model Zero-TTS obtained by the present invention is not limited to the speech synthesis of the speakers involved in the model training, and has a wider range of application.

[0133] For the data in the data set, after filtering the text-speech pairs, the remaining text-speech pairs need to be stored. During storage, the speech in the text-speech pair can be stored as a 16-bit integer sequence. After that, all stored speech can be downsampled, wherein each basic prompt tone is sampled at a uniform sampling frequency during downsampling, and the sampling frequency can be 16000Hz. Of course, the sampling frequency can also be other frequencies, which can be selected according to needs. After downsampling, each speech needs to be normalized for loudness, wherein, when normalizing the loudness, the existing commonly used normalization method can be adopted. The specific loudness normalization method can be selected according to needs, which will not be repeated here.

[0134] It can be seen from the above description that, after the basic prompt sound in the basic training sample undergoes the above storage processing, downsampling processing, loudness normalization processing, and frame-by-frame extraction of spectrum features, the training prompt sound can be formed from the basic prompt sound.

[0135] For the base text, normalization includes: adding a space after all symbols in the base text, capitalizing the first letter of each sentence, and / or converting some special abbreviations to their full names to improve readability.

[0136] In one embodiment of the present invention, when the basic samples are standardized to generate training samples, before speech synthesis, the text to be synthesized and the reference speech are also required to be subjected to the same standardization process; when the reference speech is standardized, the above-mentioned storage process, downsampling process, and loudness normalization process are performed in sequence. The manner and process of performing the above-mentioned standardization process on the reference speech and the text to be synthesized can refer to the above description and will not be repeated here.

[0137] After the basic model training data set is constructed, the basic model training data set is divided to generate at least a training sample set A and a training verification set B after the division. In one embodiment of the present invention, the speaker from which the training prompt sound of the training sample set A comes is consistent with the speaker from which the training prompt sound of the training verification set B comes, and the training samples in the training sample set A are completely different from the training samples in the training verification set B; specifically, the speaker from which the training prompt sound of the training sample set A comes is consistent with the speaker from which the training prompt sound of the training verification set B comes, such as if the training prompt sound in the training sample set A comes from 10 speakers, then the training prompt sound in the training verification set B also comes from the same 10 speakers. The training samples in the training sample set A are completely different from the training samples in the training verification set B, specifically referring to that the training prompt sound and the training prompt text in the training sample set A are completely different from the training prompt sound and the training prompt text in the training verification set B; for example, any training sample in the training sample set A does not have the same training sample in the training verification set B.

[0138] Generally, the number of training samples in training sample set A is greater than the number of training samples in training verification set B. The specific division method to form training sample set A and training verification set B can be selected according to actual needs, so as to meet the above requirements and perform model training on the basic model of speech synthesis.

[0139] When training the basic model of speech synthesis using training sample set A, it is also necessary to configure model training parameters, wherein the configured model training parameters include: batch size, initial learning rate, and optimizer; in one embodiment, the batch size may be 64, the initial learning rate may be 1e-4, and the optimizer may use the AdamW optimizer; in addition, the configured model training parameters may also include an epsilon parameter, a beta1 parameter, and a beta2 parameter, wherein the epsilon parameter may be 1e-9, the beta1 parameter may be 0.9, and the beta2 parameter may be 0.99. When training the basic model of speech synthesis, it may be trained on two RTXA6000 GPUs.

[0140] For those skilled in the art, it is understandable that the batch size is the data input into the speech synthesis basic model for training at one time. For example, when the batch size is 64, 64 training samples are input into the speech synthesis basic model at one time. The initial learning rate is the learning rate at the beginning of training. The larger the learning rate, the higher the sensitivity of the model to update parameters according to the loss. The AdamW optimizer adds weight decay (L2 regularization) to the Adam optimizer, which helps prevent model overfitting. In AdamW, the weight decay parameter is not affected by momentum and can be adjusted independently. Among them, beta1 is the exponential decay rate of the first-order moment estimate, which is used to calculate the exponential moving average of the gradient, reflecting the smoothness of the previous gradient. Beta2 is the exponential decay rate of the second-order moment estimate, which is used to calculate the exponential moving average of the square of the gradient, reflecting the variance of the previous gradient. Epsilon is a very small number used to avoid dividing by zero when calculating gradient updates.

[0141] During specific implementation, the method and process of configuring model training parameters can be consistent with the existing ones, and can be based on whether the needs of model training can be met. The configuration of model training parameters is well known to personnel in this technical field and will not be repeated here.

[0142] When training the basic model of speech synthesis using training sample set A, it is generally necessary to set a target round. Generally, when the basic model of speech synthesis is trained once using all the training samples in training sample set A, it is considered an iteration. The target round is the target number of iterations of the basic model of speech synthesis. In specific implementation, the number of target rounds can be selected as needed to meet the conditions for speech synthesis accuracy and model training.

[0143] It can be seen from the above description that after the target round of model training of the speech synthesis basic model, the target round of verification needs to be performed using the training verification set B, and the model loss of the target round can be obtained. After obtaining the model loss of the target round, the preferred value of the model loss is determined among all the model losses. The preferred value of the model loss can generally be selected as the minimum value of the model loss. In one embodiment of the present invention, the corresponding speech synthesis basic model is selected based on the determined preferred value of the model loss, and the selected speech synthesis basic model is configured as the speech synthesis model Zero-TTS, which means that the construction of the speech synthesis model Zero-TTS is realized.

[0144] In one embodiment of the present invention, the neural audio codec basic unit includes a neural audio basic encoder, a continuous residual vector quantization basic unit, and a neural audio basic decoder;

[0145] Before training the basic model for speech synthesis using the basic model training data set, the encoder pre-training weights generated by the pre-training are loaded into the neural audio basic encoder;

[0146] For each training prompt tone in the basic model training sample, the neural audio basic encoder performs speech encoding on the training prompt tone to generate training speech encoding information after speech encoding;

[0147] The continuous residual vector quantization basic unit performs encoding and continuous quantization on the training speech coding information to generate a training speech continuous vector coding after the encoding and continuous quantization;

[0148] When the selected speech synthesis basic model is used as the speech synthesis model Zero-TTS, a neural audio codec in the speech synthesis model Zero-TTS is formed based on the neural audio codec basic unit in the selected speech synthesis basic model.

[0149] In a specific implementation, the neural audio codec basic unit and the above-mentioned neural audio codec may have the same architectural form, that is, the neural audio codec basic unit also includes a neural audio basic encoder, a continuous residual vector quantization basic unit and a neural audio basic decoder, wherein the neural audio basic decoder corresponds to the neural audio decoder, the neural audio basic encoder corresponds to the neural audio encoder, and the continuous residual vector quantization basic unit corresponds to the continuous residual vector quantizer. Therefore, according to the neural audio codec described above, the neural audio codec basic unit can be constructed, and the method and process of constructing the neural audio codec basic unit can be consistent with the existing ones, which will not be repeated here.

[0150] In order to enable speech coding to obtain a richer amount of information at the beginning of model training, in one embodiment of the present invention, the encoder pre-training weights generated by pre-training can be loaded into the neural audio basic encoder, that is, before model training, the weights of the neural audio basic encoder are first configured. During pre-training, it is generally necessary to provide a pre-training data set. For example, when the above-mentioned LibriTTS data set is used as a model training data set, the Libriheavy data set can be used as the pre-training data set of the present invention. Specifically, the situation of the pre-training data set is related to the selected model training data set, and the encoder pre-training weights of the neural audio basic encoder that can be obtained by pre-training shall prevail.

[0151] After determining the pre-training data set, the pre-training data set is divided into a pre-training training set and a pre-training verification set, wherein the pre-training training set and the pre-training verification set both include a number of pre-training samples. During pre-training, a feasible pre-training method is: batch loading the pre-training samples in the pre-training training set into the neural audio codec basic unit, and obtaining the reconstructed speech, calculating the loss between the reconstructed speech and the original speech, and using the calculated loss to optimize the parameters of the neural audio codec basic unit during the back propagation process. Specifically, the method and process of using the loss to optimize the parameters of the neural audio codec basic unit during the back propagation process are consistent with the existing ones.

[0152] When the neural audio codec basic unit is trained to the target number of iterations, the iterative training of the neural audio codec basic unit is terminated. Specifically, after each iterative training, the validation set loss is calculated using the pre-training validation set, so that after the target number of iterations, a validation set loss consistent with the target number of iterations can be obtained. Among all the validation set losses, the validation set loss with the smallest value is searched and determined, and the neural audio codec basic unit corresponding to the validation set loss with the smallest value is used as the target neural audio codec basic unit. Thereafter, the weight parameters of the neural audio basic encoder in the target neural audio codec basic unit are extracted using technical means commonly used in the field of this technology as the encoder pre-training weights.

[0153] After the encoder pre-trained weights are loaded into the neural audio base encoder, the parameters of the other parts of the speech synthesis base model are initialized using random initialization. After initialization, normal training can be performed until the target training state is reached, such as training the neural audio base model to the target number of rounds mentioned above.

[0154] Since the neural audio codec basic unit and the above-mentioned neural audio codec adopt the same architecture, the working method of the neural audio codec basic unit during training can refer to the working description of the above-mentioned neural audio codec during speech synthesis, which will not be repeated here. When the speech synthesis model Zero-TTS is configured, a neural audio codec can be formed based on the neural coding and decoding basic unit in the corresponding speech synthesis basic model.

[0155] In one embodiment of the present invention, the speech feature decoupling basic unit includes a speech semantic encoder, a speaker feature basic encoder and a logarithmic Mel spectrum decoder, wherein:

[0156] Encode the training speech continuous vector, extract speech semantics using a speech semantic encoder to generate a sample speech semantic encoding, and extract the speaker feature encoding of the training prompt sound using a speaker feature base encoder;

[0157] During model training, the sample speech semantic coding is compared and purified with the sample text semantic coding generated by the speech prediction basic unit to obtain the speech semantic comparison and purification coding;

[0158] Loading the speech semantic contrast purification code and the speaker feature code of the training prompt sound into a logarithmic Mel spectrum decoder, so that the logarithmic Mel spectrum decoder generates a decoupled logarithmic Mel spectrum of the training sample;

[0159] Maximize the likelihood of synthesized logarithmic Mel spectrum, minimize the distance between text semantics and speech semantics, and purify speaker features based on the information frequency constructed by the encoder-decoder structure of the codec;

[0160] When the selected speech synthesis basic model is used as the speech synthesis model Zero-TTS, a speech feature decoupling module is formed based on the speech feature decoupling basic unit, wherein:

[0161] The speaker feature encoder in the speech feature decoupling module is formed based on the speaker feature base encoder.

[0162] Figure 3 An embodiment of a speech feature decoupling basic unit is shown in Figure 3 It can be seen that the speech feature decoupling basic unit needs to include a speech semantic encoder, a speaker feature basic encoder and a log-Mel spectrum decoder. Therefore, the speech feature decoupling basic unit of the speech synthesis basic model is different from the speech feature decoupling module in the speech synthesis model Zero-TTS. From the above description, it can be seen that the speech feature decoupling basic unit has a speech semantic encoder and a log-Mel spectrum decoder compared with the speech feature decoupling module, and the speaker feature basic encoder can correspond to the speaker feature encoder in the speech feature decoupling module, that is, the speech semantic encoder and the log-Mel spectrum decoder are both used for model training and do not participate in subsequent speech synthesis.

[0163] In specific implementation, the speech semantic encoder and speaker feature basic encoder can adopt the same architecture as the above-mentioned neural audio encoder and neural audio basic encoder, but the difference is that the speech semantic encoder and speaker feature basic encoder can omit the Snake activation function. Therefore, based on the above-mentioned neural audio basic encoder, the speech semantic encoder and speaker feature basic encoder of the present invention can be constructed.

[0164] The logarithmic Mel spectrum decoder can adopt the architecture of the decoder of deep voice3 in the prior art. Of course, the logarithmic Mel spectrum decoder can also adopt other architectures to meet the requirements of generating the decoupled logarithmic Mel spectrum of the training samples described below.

[0165] As can be seen from the above description, during model training, the neural audio codec unit can output the training speech continuous vector code, and the speech semantic encoder can be used to extract speech semantics from the training speech continuous vector code, thereby generating a sample speech semantic code. At the same time, the speaker feature base encoder is used to extract the speaker feature code of the training prompt sound, that is, the training speech continuous vector code can at least include the sample speech semantic code and the speaker feature code of the training prompt sound.

[0166] At the same time, during model training, the training prompt text can be encoded using the speech prediction basic unit. At this time, the sample speech semantic encoding is compared and purified with the sample text semantic encoding generated by the speech prediction basic unit to obtain the speech semantic comparison and purification encoding. Specifically, during the comparison and purification, the comparison and purification can be performed through the information bottleneck theory. In addition, after the speech information is purified, the speaker feature basic encoder can selectively abandon the extraction of speech information. Therefore, the speaker information is purified, and the speaker feature encoding of the training prompt sound can be obtained. The method and process of comparison and purification through the information bottleneck theory can be consistent with the existing method, so that the speech semantic comparison and purification encoding can be obtained.

[0167] Furthermore, the speech semantic contrast purification coding and the speaker feature coding of the training prompt sound can be loaded into the logarithmic Mel spectrum decoder through the feature channel splicing method, so that the logarithmic Mel spectrum decoder generates a decoupled logarithmic Mel spectrum of the training sample, such as Figure 3 shown.

[0168] For the training prompt tone in each training sample, the technical means commonly used in the technical field can be used to calculate the initial logarithmic Mel spectrum of the training sample. For each training sample, the loss between the initial logarithmic Mel spectrum of the training sample and the decoupled logarithmic Mel spectrum of the training sample can be determined. When calculating the initial logarithmic Mel spectrum of the training sample of the training prompt tone, it is generally necessary to set the logarithmic Mel spectrum calculation parameters. The set logarithmic Mel spectrum calculation parameters include frame size and frame interval, wherein the frame size can be set to 1024, and the frame interval can be set to 256. Of course, the frame size and frame interval can also be set to other situations, which can be selected according to needs.

[0169] In specific implementation, the likelihood of the training sample decoupled logarithmic Mel spectrum and the training sample initial logarithmic Mel spectrum of each training sample can be calculated, and the parameters of the speech feature decoupling basic unit can be optimized. The method and process of optimizing the parameters of the speech feature decoupling basic unit will be explained in detail below.

[0170] Figure 4The figure shows the changes during the model training process. Specifically, in the first epoch (first iteration of training), the feature decoupler cannot distinguish different speakers. After 5 epochs, different speakers begin to show different distributions. After 10 epochs, it can be seen that the distribution of different speakers is scattered and the same speaker is concentrated. It can be seen that the three figures show the optimization effect of the basic unit of speech feature decoupling during the training stage.

[0171] From the above description, it can be seen that when the selected speech synthesis basic model is used as the speech synthesis model Zero-TTS, a speech feature decoupling module is formed based on the speech feature decoupling basic unit, wherein the speaker feature encoder in the speech feature decoupling module is formed based on the speaker feature basic encoder.

[0172] In one embodiment of the present invention, the speech prediction basic unit includes a basic text semantic encoder, a basic random duration predictor and a basic regularization flow, wherein:

[0173] For any training sample in the training sample set A, the basic text-to-speech encoder encodes the training prompt text to generate a semantic code of the training text after encoding, and loads the generated semantic code of the training text into the speech feature decoupling basic unit;

[0174] Based on the semantic encoding of the training text, the basic random duration predictor predicts the distribution of the duration alignment information of the training prompt text.

[0175] During model training, the continuous vector of the prompt speech generated by the continuous residual vector quantization basic unit is encoded, and the latent variable is calculated through the basic regularization flow;

[0176] A monotone alignment search method is used to determine the alignment matrix corresponding to the latent variable and the current training prompt text;

[0177] The basic random duration predictor predicts the distribution of the alignment matrix, and based on minimization of the maximum likelihood estimate of the alignment matrix distribution, optimizes the basic random duration predictor during model training;

[0178] When the selected speech synthesis basic model is used as the speech synthesis model Zero-TTS, a speech prediction encoder in the speech synthesis model Zero-TTS is formed based on the speech prediction basic unit.

[0179] Specifically, the basic text semantic encoder can be constructed based on the Transformer encoder. In the pre-training stage, the basic text semantic encoder predicts the mask according to the context, has the ability to understand the context, and extracts the semantic code from the training prompt text to generate the semantic code of the training text.

[0180] The regularized flow is a completely reversible probability model. In one embodiment of the present invention, in the forward process, the continuous vector code of the training speech is output through the regularized flow to obtain the text semantic code. In the reverse process, the text semantic code is output as the continuous vector code of the training speech, such as Figure 1 shown.

[0181] When constructing the basic regularization flow, you can refer to the paper published by George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, and Balaji Lakshminarayanan in the Journal of Machine Learning Research in 2021: Normalizing Flows for Probabilistic Modeling and Inference. Of course, other methods can also be used to construct regularization flows.

[0182] The basic regularized flow and the basic random duration predictor can be briefly described as a probability model. Therefore, after the regularized flow is constructed, the basic random duration predictor can be constructed, that is, the main part of the random duration predictor includes the architecture of the basic regularized flow. Unlike the basic regularized flow, the random duration predictor adds a variational dequantization layer and a variational data augmentation layer to the regularized flow. The method and process of constructing the basic random duration prediction period based on the basic regularized flow can be consistent with the existing ones and are well known to those skilled in the art. Of course, the random duration predictor can also be constructed in other ways to meet the working requirements of the random duration predictor of the present invention.

[0183] The basic random duration predictor predicts the distribution of the duration alignment information of each training prompt text corresponding to the training prompt sound. Specifically, the predicted duration distribution obeys a quasi-Gaussian distribution. The output duration is obtained by randomly sampling the standard Gaussian distribution and mapping it to the predicted duration distribution. In model training, a monotone alignment search algorithm is used to obtain the alignment information of the speech features corresponding to the text semantic encoding. Specifically, the monotone alignment search is a hard alignment algorithm that requires monotonicity and surjectivity, calculates all the probabilities of allowed alignment, and searches for a maximum probability search path. The search algorithm uses the Viterbi algorithm, and the Viterbi algorithm is used for search. The method and process of alignment using the monotone alignment search are consistent with the existing ones.

[0184] Figure 1The optimization details of the random duration predictor in model training are shown. The training speech continuous vector encoding is calculated by reverse calculation of the basic regularization flow to obtain the hidden variable. The hard alignment strategy of monotone alignment search is used to obtain the alignment matrix of the text semantic encoding corresponding to the hidden variable. The random duration predictor based on variational inference is used to predict the distribution of the alignment matrix, optimize the random duration predictor, and optimize the random duration prediction period, that is, to update the parameters of the random duration predictor. Among them, variational inference is a Bayesian approximate inference method that converts the posterior inference problem into an optimization problem for solution. The random duration predictor based on variational inference predicts the distribution of the alignment matrix in a manner and process that is consistent with the existing ones. In the speech synthesis stage, the alignment matrix is ​​obtained by randomly sampling the alignment distribution output by the random duration predictor. Among them, the predicted duration distribution is realized by a continuous regularization flow, and the alignment label obtained by the monotone alignment search algorithm is a discrete value, which cannot be directly used for the gradient return of the regularization flow. Therefore, during model training, variational dequantization must be completed inside the duration predictor to make the discrete alignment label continuous.

[0185] In one embodiment of the present invention, when calculating the model loss, it includes:

[0186]

[0187] Among them, L backbone is the loss of the backbone network, L C-RVQ is the encoding contrast loss of the backbone network, L recon is the speech contrast loss of the backbone network, L adv is the speech discrimination loss of the backbone network, L dis The training loss of the basic unit for decoupling speech features, L mel is the spectral contrast loss of the logarithmic Mel spectrum decoder, L sem is the semantic contrast loss.

[0188] In one embodiment of the present invention, the neural audio codec basic unit and the speech prediction coding basic unit are used as a backbone network. At this time, when calculating the model loss, the loss L of the backbone network can be calculated. backbone , and calculate the training loss L of the basic unit of speech feature decoupling dis The following is the loss L of the backbone network backbone And the training loss L of the speech feature decoupling basic unit dis Provide specific instructions.

[0189] The encoding contrast loss L of the backbone network C-RVQ , specifically Figure 1 The continuous vector encoding of the training speech generated by the continuous residual vector quantizer in Figure 1The distance between the continuous vector encodings of the training speech is obtained by basic regularization; wherein, the encoding contrast loss L of the backbone network is calculated C-RVQ When , the loss function can be selected as the existing negative log-likelihood loss function. After determining the continuous vector code of the training speech generated by the continuous residual vector quantizer and the continuous vector code of the training speech obtained by basic regularization, the coding contrast loss L of the backbone network is calculated using the negative log-likelihood loss function. C-RVQ The method and process can be consistent with the existing ones and will not be described in detail here.

[0190] Since any training sample includes a training prompt tone and a training prompt text, during training, a training speech can be generated based on a training sample through a neural audio base decoder. recon , specifically Figure 1 The distance between the training speech output by the neural audio base decoder and the training prompt sound in the training sample corresponding to the current output training speech, where the calculated distance is the speech contrast loss L of the backbone network recon ; In specific implementation, calculate the speech contrast loss L recon When the loss function is used, the commonly used L2 loss function can be used. The speech contrast loss L is calculated based on the L2 loss function. recon The method and process can be consistent with the existing ones.

[0191] The speech discrimination loss L of the backbone network adv , which is the true state contrast loss of the training speech generated by the neural audio base decoder; calculate the speech discrimination loss L of the backbone network adv When the generated training speech is judged as real speech, the speech discrimination loss L of the backbone network is adv The main function is to make the generated training speech look real, and the more difficult it is to distinguish the synthesized speech, the better. Calculate the speech discrimination loss L of the backbone network adv , the speech discrimination loss L can be calculated by generating adversarial loss adv .

[0192] Next, the speech discrimination loss L of the backbone network is calculated by the generative adversarial method. adv In one embodiment, the method includes:

[0193] In order to enable the neural audio base decoder to obtain a better ability to restore audio, in one embodiment of the present invention, a multi-scale discriminator is used for adversarial training of the neural audio base decoder to improve the sound quality and fidelity of the reconstructed speech. Among them, multi-scale discrimination means that the output results of different output layers of the neural audio base decoder are all discriminated to obtain the discrimination loss, that is, the speech discrimination loss L of the backbone network is obtained.adv .

[0194] It can be seen from the above description that the neural audio basic decoder includes four layers of decoder blocks. Specifically, for the four layers of decoder blocks, the losses are summed up in the ratio of 1:4:16:64 from the input to the output layer as the final judgment loss; if the loss of the first layer decoder block is b1, the loss of the second layer decoder block is b2, the loss of the third decoder block is b3, and the loss of the fourth layer decoder block is b4, then the proportional weighting is (1*b1+4*b2+16*b3+64*b4) / (1+4+16+64). In specific implementation, the loss of each layer of decoder blocks in the neural audio basic decoder can be calculated using the existing method, and the present invention judges the loss of each layer of decoder blocks. Of course, the ratio of the proportional summation can also be selected according to actual needs, so as to meet the actual judgment loss calculation.

[0195] For semantic contrast loss L sem , specifically Figure 3 The contrast loss between the semantic encoding of text and the semantic encoding of speech is used to calculate the semantic contrast loss L sem When , the L1+L2+KL divergence loss function can be used as the loss function for calculating the semantic contrast loss, and the corresponding contrast loss is calculated based on the loss function, where the L1, L2, and KL divergence loss functions are the existing common loss function types.

[0196] Spectral contrast loss L for log-Mel spectrum decoder mel Specifically, it is the spectrum contrast loss between the decoupled logarithmic Mel spectrum of the training sample output by the logarithmic Mel spectrum decoder and the initial logarithmic Mel spectrum of the training sample corresponding to the training prompt tone of the generated training sample decoupled logarithmic Mel spectrum. When calculating the spectrum contrast loss, the loss function can adopt the L2 loss function. When the loss function adopts the L2 loss function, the spectrum contrast loss L is calculated. mel The situation is consistent with the existing situation and will not be repeated here.

[0197] From the above description, it can be seen that during model training, training samples are loaded into the basic model of speech synthesis in batches. Therefore, after the basic model of speech synthesis is trained with a batch of training samples, the model loss needs to be calculated once.

[0198] It can be understood that the loss calculated above is used to update the network gradient during back propagation. dis It is only used to update the speech feature decoupling basic unit. A gradient stop is added between the speech feature decoupling basic unit and the backbone network, so that the training of the speech feature decoupling basic unit and the updating of the network gradient do not affect the backbone network.

[0199] In one embodiment of the present invention, when updating the parameters of the speech feature decoupling basic unit, a feasible method may be: after generating the decoupled logarithmic Mel spectrum of the training sample, the spectrum contrast loss L may be calculated. mel , and calculate the above semantic contrast loss L sem , where the parameters of the basic unit of speech feature decoupling are updated so that the spectral contrast loss L mel The likelihood of is as large as possible, and the semantic contrast loss L sem As small as possible, after which the parameters of the basic unit for speech feature decoupling that meet the two conditions can be obtained. After each batch of training samples is loaded, the parameters of the basic unit for speech feature decoupling are updated correspondingly.

[0200] Similarly, the duration prediction loss L of the basic random duration predictor is dur , only the basic random duration predictor is optimized separately, and the backbone network is not affected by gradient stopping, such as Figure 1 Calculate the duration prediction loss L of the basic random duration predictor dur When , the loss function can use the negative log-likelihood loss function. Based on the negative log-likelihood loss function, the duration prediction loss L can be calculated. dur Specifically, the duration prediction loss L is calculated dur When , the predicted duration alignment information output by the basic random duration predictor is aligned with the true duration alignment information obtained by the monotone alignment search to calculate the loss.

[0201] When optimizing and updating the basic random duration predictor, the duration prediction loss L is usually used. dur The parameters of the basic random duration predictor are updated in the direction of minimization; that is, the minimization of the maximum likelihood estimation loss based on the alignment matrix distribution is achieved to optimize the basic random duration predictor.

[0202] For the backbone network, the loss L of the backbone network is backbone Taking the minimum as the basic principle, the network parameters of the backbone network are based on the network parameters to determine the corresponding parameters of the neural audio codec basic unit, the text speech encoder and the basic regularization flow after updating.

[0203] When the training validation set B is used to verify the basic model of speech synthesis, the above model loss calculation method can be used to calculate the model. From the above description, it can be seen that when calculating the model loss, the loss L of the backbone network can be calculated. backbone , the training loss L of the basic unit of speech feature decoupling dis And the duration prediction loss L dur Therefore, when determining the optimal value of model loss on the training validation set B, it specifically refers to selecting the loss L of the backbone network. backbone, the training loss L of the basic unit of speech feature decoupling dis And the duration prediction loss L dur A relatively better model loss value is obtained. Therefore, based on the determined model loss preferred value, a corresponding speech synthesis basic model is selected, and the selected speech synthesis basic model is configured as a speech synthesis model Zero-TTS.

[0204] In addition, a training test set C and an open set test data set D can also be constructed, where the training sample set A, the training validation set B, and the training test set C are from the same model training basic data set, that is, from the same data set, such as the LibriTTS data set mentioned above, where the speakers of the training data set A and the training validation set B are the same, but there is no overlap in the training texts. Compared with the training data set A and the training validation set, the training test set C has different speakers and no data overlap, where no data overlap specifically means that the training prompt tones and training prompt texts in the training samples are different.

[0205] Furthermore, the data distribution of the open set test data set D comes from different data sets and different speakers than the training sample set A, the training validation set B, and the training test set C, and there is no data overlap. The open set test data set D may be composed of multiple data sets and is used to verify the adaptive capability of the speech synthesis model Zero-TTS of the present invention.

[0206] In specific implementation, after obtaining the speech synthesis model Zero-TTS, the training samples in the training test set C can be used to evaluate the quality and timbre similarity of the generated speech; the same experiment is performed using the open set test data set D to evaluate the domain generalization ability of the speech synthesis model Zero-TTS.

[0207] Furthermore, the evaluation method can adopt a method of combining manual subjective scoring with neural network evaluation, specifically:

[0208] Subjective scoring: The file names of the speech synthesis model Zero-TTS and the speech synthesized by the comparison network and the speech recording are encrypted and mixed, and then given to the scorers to evaluate the sound quality and timbre similarity. All subjective scores are based on a five-point system.

[0209] Specifically: The sound quality and timbre similarity of the synthesized speech are evaluated through manual subjective annotation. The mean opinion score (MOS) is used to evaluate the sound quality and naturalness of the speech. In addition, the similarity mean opinion score (SMOS) and the comparative mean opinion score (CMOS) are used to evaluate the timbre similarity and naturalness level between the synthesized speech and the target speech. The final result is obtained by averaging the scores of seven raters. MOS and SMOS are rated on a five-point scale (1: poor, 2: poor, 3: average, 4: good, 5: excellent), and CMOS uses the difference evaluation method with the benchmark.

[0210] Neural network evaluation: DeepSpeaker, a speaker recognition network, is used to identify the speaker of the synthesized data. The closer the result is to the real data, the better the synthesis quality. WhisperV2, a speech recognition network, is used to recognize the synthesized speech text. The higher the recognition accuracy, the more accurate the pronunciation. UTMOS, a sound quality evaluation network, is used to test the sound quality score of the synthesized speech. WeSpeaker, a speaker verification network, is used to extract the speaker feature vector, and the timbre similarity of different voices is calculated through cosine similarity.

[0211] Specifically, in order to objectively evaluate the performance of the speech synthesis model Zero-TTS, several neural networks were used to measure the sound quality, naturalness, and timbre similarity of the synthesized speech. Specifically, Open AI's Whisper v2 was used for generated speech text recognition. Whisper v2 is known for its performance and shows a low word error rate (WER) on our real recording test set. On the generated test set, a lower WER means a higher quality and naturalness of the generated speech.

[0212] In addition, Deep Speaker was used to perform speaker identification on the generated speech. When testing the speech generated by the synthesis model, higher accuracy means smaller intra-class intervals between the same speaker and larger inter-class intervals between different speakers. The generated speech was also measured by a MOS prediction network called UTMOS, which is used to supplement the artificial MOS. Finally, an objective evaluation method based on the speaker verification model WeSpeaker was used to obtain cosine similarity scores for evaluating the degree of timbre similarity.

[0213] Visual Evaluation: Plot the t-SNE plot of the decoupled speaker-dependent features to confirm whether the information from different speakers is distinguished and added to the encoder-decoder. Figure 5 The t-SNE graph shows the decoupling effect on multiple datasets. During the training process, in order to evaluate the training effect, we observe the logarithmic Mel-spectrogram of the output data. By observing the accuracy curve of the speaker recognition network on the test set, the speaker adaptation ability of different synthesis models is evaluated by comparing the changes in multiple speaker curves and the final accuracy.

[0214] Table 1 Speech synthesis quality and naturalness under different methods

[0215]

[0216] As can be seen from Table 1, compared with other mainstream speech synthesis methods, the proposed speech synthesis model Zero-TTS achieves the highest score in network MOS and UTMOS, and is slightly lower than VITS in WER, but stronger than other models. The performance of the speech synthesis model Zero-TTS is close to the real recording, and the synthesized sound quality and naturalness are excellent.

[0217] Table 2 Speech synthesis timbre similarity and naturalness under different methods

[0218]

[0219] As can be seen from Table 2, compared with the speech synthesis method of YourTTS, the proposed speech synthesis model Zero-TTS network achieved the highest score in SMOS, CMOS, UTMOS, and cosine similarity, and was consistent with YourTTS in WER. The performance of the speech synthesis model Zero-TTS is close to the real recording, and the synthesized speech is very similar to the real person's pronunciation and has a high degree of natural pronunciation.

[0220] The above schematically describes the invention and its implementation methods, which is not restrictive. Without departing from the spirit or basic features of the invention, the invention can be implemented in other specific forms. What is shown in the accompanying drawings is only one of the implementation methods of the invention. The actual structure is not limited to this, and any figure mark in the claims should not limit the claims involved. Therefore, if a person of ordinary skill in the art is inspired by it, without departing from the purpose of the invention, a structural method and an embodiment similar to the technical solution are designed without creativity, which should all fall within the scope of protection of this patent. In addition, the word "including" does not exclude other elements or steps, and the word "one" before the element does not exclude the inclusion of "multiple" elements. The multiple elements stated in the product claim can also be implemented by one element through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.

Claims

1. A speech synthesis method based on a neural audio codec, characterized in that: The speech synthesis method comprises: Provide the text to be synthesized and the reference speech of the target speaker, and load the reference speech and the text to be synthesized into the pre-built speech synthesis model Zero-TTS, wherein: The speech synthesis model Zero-TTS includes a neural audio codec, a speech feature decoupling module and a speech prediction encoder, wherein the speech prediction encoder, the speech feature decoupling module and the neural audio codec are adaptively connected; The speech prediction encoder receives the text to be synthesized, and performs speech prediction on the text to be synthesized to generate text-speech prediction code after the speech prediction, and loads the generated text-speech prediction code into the neural audio codec; The neural audio codec receives the reference speech, and performs speech encoding and code continuous quantization on the received reference speech in sequence, so as to generate a reference speech continuous residual quantization code after the code continuous quantization, and loads the generated reference speech continuous residual quantization code into the speech feature decoupling module; The received reference speech continuous residual is quantized and encoded, and the speech feature decoupling module extracts the speaker feature code of the target speaker, and the extracted speaker feature code of the target speaker is loaded into the neural audio codec; Within the neural audio codec, the text-to-speech prediction coding and the speaker feature coding of the target speaker are reconstructed to generate a target speech adapted to the target speaker after reconstruction.

2. The method for speech synthesis based on a neural audio codec according to claim 1, characterized in that: The neural audio codec includes a neural audio encoder, a neural audio decoder and a continuous residual vector quantizer, wherein: For a reference speech, the neural audio encoder performs speech encoding on the reference speech to generate reference speech encoding information after speech encoding; The continuous residual vector quantizer performs encoding and continuous quantization on the reference speech coding information to generate a reference speech continuous residual quantization code after encoding and continuous quantization; The neural audio decoder reconstructs the speech prediction coding and the speaker feature coding of the target speaker to generate a target speech adapted to the target speaker after reconstruction.

3. The method for speech synthesis based on a neural audio codec according to claim 2, characterized in that: The speech feature decoupling module at least includes a speaker feature encoder, wherein: The continuous residual of the reference speech is quantized and encoded, and the speaker feature encoder extracts the speaker feature code of the target speaker, and the speaker feature code of the target speaker is loaded into the neural audio decoder.

4. The method for speech synthesis based on a neural audio codec according to claim 1, characterized in that: The speech coding predictor includes a text semantic encoder, a random duration predictor, and a regularization stream, wherein: The text semantic encoder encodes the synthetic text to generate a text semantic encoding after encoding; A random duration predictor generates duration information of the text to be synthesized based on random sampling; Based on the text semantic coding of the text to be synthesized and the duration information of the text to be synthesized, a text-to-speech predictive coding is generated through a regularized flow.

5. The method for speech synthesis based on a neural audio codec according to any one of claims 1 to 4, characterized in that: When building the speech synthesis model Zero-TTS, the construction method includes: Construct a basic model for speech synthesis and a basic model training data set for training the basic model for speech synthesis, wherein: A speech synthesis basic model, including a neural audio codec basic unit, a speech feature decoupling basic unit and a speech prediction coding basic unit, wherein the speech prediction basic unit and the speech feature decoupling basic unit are both adaptively connected to the neural audio codec basic unit; The basic model training data set includes a plurality of basic model training samples, each of which includes a training prompt tone and a training prompt text corresponding to the training prompt tone; The basic model training data set is divided to generate at least a training sample set A and a training verification set B, wherein the speaker from which the training prompt sound of the training sample set A comes is consistent with the speaker from which the training prompt sound of the training verification set B comes, and the training samples in the training sample set A are completely different from the training samples in the training verification set B; After a round of model training of the speech synthesis basic model using the training sample set A, the model loss of the speech synthesis basic model after the current round of model training is calculated using the training validation set B; After performing a target round of model training on the speech synthesis basic model using the training sample set A, a preferred model loss value is determined among all calculated model losses; A corresponding speech synthesis basic model is selected based on the determined model loss preferred value, and the selected speech synthesis basic model is configured as a speech synthesis model Zero-TTS.

6. The method for speech synthesis based on a neural audio codec according to claim 5, characterized in that: The neural audio codec basic unit includes a neural audio basic encoder, a continuous residual vector quantization basic unit, and a neural audio basic decoder; Before training the basic model for speech synthesis using the basic model training data set, the encoder pre-training weights generated by the pre-training are loaded into the neural audio basic encoder; For each training prompt tone in the basic model training sample, the neural audio basic encoder performs speech encoding on the training prompt tone to generate training speech encoding information after speech encoding; The continuous residual vector quantization basic unit performs encoding and continuous quantization on the training speech coding information to generate a training speech continuous vector coding after the encoding and continuous quantization; When the selected speech synthesis basic model is used as the speech synthesis model Zero-TTS, a neural audio codec in the speech synthesis model Zero-TTS is formed based on the neural audio codec basic unit in the selected speech synthesis basic model.

7. The method for speech synthesis based on a neural audio codec according to claim 6, characterized in that: The speech feature decoupling basic unit includes a speech semantic encoder, a speaker feature basic encoder and a logarithmic Mel spectrum decoder, where: Encode the training speech continuous vector, extract speech semantics using a speech semantic encoder to generate a sample speech semantic encoding, and extract the speaker feature encoding of the training prompt sound using a speaker feature base encoder; During model training, the sample speech semantic coding is compared and purified with the sample text semantic coding generated by the speech prediction basic unit to obtain the speech semantic comparison and purification coding; Loading the speech semantic contrast purification code and the speaker feature code of the training prompt sound into a logarithmic Mel spectrum decoder, so that the logarithmic Mel spectrum decoder generates a decoupled logarithmic Mel spectrum of the training sample; Maximize the likelihood of synthesized logarithmic Mel spectrum, minimize the distance between text semantics and speech semantics, and purify speaker features based on the information frequency constructed by the encoder-decoder structure of the codec; When the selected speech synthesis basic model is used as the speech synthesis model Zero-TTS, a speech feature decoupling module is formed based on the speech feature decoupling basic unit, wherein: The speaker feature encoder in the speech feature decoupling module is formed based on the speaker feature base encoder.

8. The method for speech synthesis based on a neural audio codec according to claim 7, characterized in that: The basic unit for speech prediction includes a basic text semantic encoder, a basic random duration predictor, and a basic regularization flow, wherein: For any training sample in the training sample set A, the basic text-to-speech encoder encodes the training prompt text to generate a semantic code of the training text after encoding, and loads the generated semantic code of the training text into the speech feature decoupling basic unit; Based on the semantic encoding of the training text, the basic random duration predictor predicts the distribution of the duration alignment information of the training prompt text. During model training, the continuous vector of the prompt speech generated by the continuous residual vector quantization basic unit is encoded, and the latent variable is calculated through the basic regularization flow; A monotone alignment search method is used to determine the alignment matrix between the latent variable and the current training prompt text; A basic random duration predictor predicts the distribution of the alignment matrix, and optimizes the basic random duration predictor based on minimization of a maximum likelihood estimate of the alignment matrix distribution; When the selected speech synthesis basic model is used as the speech synthesis model Zero-TTS, a speech prediction encoder in the speech synthesis model Zero-TTS is formed based on the speech prediction basic unit.

9. The method for speech synthesis based on a neural audio codec according to claim 8, characterized in that When calculating the model loss, include: Among them, L backbone is the loss of the backbone network, L C-RVQ is the encoding contrast loss of the backbone network, L recon is the speech contrast loss of the backbone network, L adv is the speech discrimination loss of the backbone network, L dis The training loss of the basic unit for decoupling speech features, L mel is the spectral contrast loss of the logarithmic Mel spectrum decoder, L sem is the semantic contrast loss.

10. The method for speech synthesis based on neural audio codec according to claim 5, characterized in that: When building a basic model training dataset, include: Providing a basic data set for model training, wherein the basic data set for model training includes a plurality of basic samples, and any basic sample includes a basic prompt tone and a basic text corresponding to the basic prompt tone; Each basic sample is standardized to generate a training sample after the standardization, where: When the basic prompt sound in the basic sample is standardized, it includes sequential downsampling and loudness normalization; Standardization of the base text within the base sample included adding a space after all symbols in the base text and / or capitalizing the first letter of each sentence; When the basic samples are standardized to generate training samples, the text to be synthesized and the reference speech are subjected to the same standardization process before speech synthesis.