Speech synthesis method and system based on discrete Diffusion
By using a pre-specified sequence S to intervene in the recovery sequence of audio coding in a discrete Diffusion-based speech synthesis model, the model's over-reliance on the results of the previous step and local conflicts are solved, and the accuracy and robustness of speech synthesis are improved. .
Patent Information
- Application Number
- CN202410919877.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-10
AI Technical Summary
The speech synthesis model based on discrete diffusion is prone to over-reliance on the previous audio encoding step in the reverse process, leading to word swallowing and missing words, and may cause local conflicts.
By defining a pre-specified sequence S, the restoration order of audio discrete coding is intervened, making the model more dependent on acoustic cues and text to be synthesized, reducing dependence on the restoration results of the previous step, and avoiding local conflicts.
It effectively alleviates the problem of swallowing and missing words in speech synthesis, improves the robustness of the model, and ensures the accuracy and consistency of generated speech.
Smart Images

Figure CN118471195B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of speech synthesis, and in particular discloses a speech synthesis method and system based on discrete Diffusion. Background Art
[0002] Zero-shot speech synthesis models based on discrete coding are mainly divided into autoregressive models and non-autoregressive models. Among them, the autoregressive model usually uses a language model to model the discrete coding of audio. In the process of generating speech, the prediction of audio coding at each time step depends on the information of the previous time step. For discrete non-autoregressive models, the modeling method of discrete Diffusion is mainly used. This method is divided into a forward process and a reverse process. The forward process gradually masks the discrete coding into noise and predicts the masked noise for modeling. In the reverse process, the restored audio coding is generally selected in the following forms, namely, randomly selecting several positions, sampling according to probability, or selecting several positions according to the size of entropy, so as to gradually restore the audio discrete coding from the noise to obtain the speech to be synthesized.
[0003] At present, the speech synthesis model based on the discrete Diffusion method usually uses random selection, probability sampling or entropy to select the recovery position in the reverse process of restoring the audio code. However, reasoning based on these methods is prone to the following two problems: first, it is overly dependent on the recovery result of the audio code in the previous step, rather than the audio corresponding to the acoustic prompt and the text information to be synthesized; second, there is a possibility of simultaneously deducing adjacent positions, resulting in local conflicts.
[0004] For example, suppose there is no data with the same discrete code A in adjacent positions in the training set. However, if the above method is used for reasoning, the same discrete code A may be introduced at adjacent positions at the same time, resulting in local conflicts. Therefore, according to the above reasoning process, the model is prone to swallowing and missing words. Summary of the invention
[0005] The present invention provides a speech synthesis method based on discrete Diffusion, which can at least partially improve the above problems.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A speech synthesis method based on discrete diffusion, comprising:
[0008] S101, converting the text to be synthesized into a phoneme code C;
[0009] S102, converting the acoustic prompt and the audio to be synthesized into an acoustic discrete code P and an original audio discrete code X respectively through an audio codec;
[0010] S103, in the forward process of Diffusion, the original audio discrete code X is masked to obtain a completely masked discrete sequence X T ;
[0011] S104, in the inference phase, from the fully masked discrete sequence X T Starting from the probability distribution based on the predefined sequence S The sampled , and recover through T-step iterations to obtain the predicted audio discrete code X0; where T represents the total number of time steps, represents the step length, the sequence S is an even-length sequence, and the elements in the sequence S determine In the The position of the audio discrete code recovered in the step, and the elements in the sequence S satisfy the farthest distance relative to other positions that have been selected; denote the tth step and the Step audio discrete coding; From Diffusion Network The output probability distribution is sampled. are the parameters of the Diffusion network;
[0012] S105, converting the predicted audio discrete code X0 into corresponding audio information through an audio codec.
[0013] Preferably, step S101 specifically includes:
[0014] The text to be synthesized is converted into phonemes through the G2P model, and the phonemes are converted into phoneme codes through the mapping dictionary ; Indicates the length of the phoneme code.
[0015] Preferably, step S103 specifically includes:
[0016] In the forward process of Diffusion, at time step t, a binary mask matrix is defined. Mask the original audio discrete code X to obtain the fully masked discrete sequence X T ; where, for the fully masked discrete sequence X T The mth code in ,satisfy ; Indicates that in the masking process, the original audio discrete code X corresponds to The part that is 1 is replaced by a special character [MASK], and The part that is 0 still retains the original encoding. , is a fixed value, n is the dimension of the original audio discrete code X, and t represents the tth time step.
[0017] Preferably, it also includes:
[0018] In the reverse process of Diffusion, from the fully masked discrete sequence X T Starting from, gradually according to the reverse distribution Sampling is performed to gradually restore the predicted audio discrete code ; In the training phase, the audio discrete code is predicted based on the acoustic discrete code P of the acoustic prompt and the phoneme code C information; during prediction, the Diffusion network is used to predict the masked audio coding information at each step.
[0019] Preferably, the Diffusion network is trained by minimizing the negative log-likelihood of the masked audio encoding:
[0020]
[0021] in, is the loss function, n is the dimension of the original audio discrete encoding, Generate the i-th discrete audio code;
[0022] Based on the Diffusion network, according to Get the predicted audio discrete code ;
[0023] from Sampling to obtain , and and As a condition :
[0024] ,
[0025] E stands for expectation. t represents the expectation at step t.
[0026] Preferably, S104 specifically includes:
[0027] Get the mask matrix according to the sequence S ,in:
[0028]
[0029]
[0030] A is an increasing sequence generated according to the sequence length of the audio to be synthesized, and the sequence length of the audio to be synthesized is equal to the dimension of the discrete encoding of the original audio. is the mask matrix The elements of , r represents the inference position in the sequence S, % represents the modulo operation, and N is the length of the sequence S; the elements related to the inference position r in each row of the mask matrix are 1, and the other elements are 0;
[0031] In getting Afterwards, according to , and To decide The reasoning position of the step, that is:
[0032] ;
[0033] Through T-step iterative recovery, the predicted audio discrete code X0 is obtained.
[0034] The embodiment of the present invention further provides a speech synthesis system based on discrete diffusion, which includes:
[0035] A text conversion unit, used for converting the text to be synthesized into a phoneme code C;
[0036] An encoding unit, used for converting the acoustic prompt and the audio to be synthesized into an acoustic discrete code P and an original audio discrete code X respectively through an audio codec;
[0037] The mask unit is used to perform a mask operation on the original audio discrete code X in the forward process of Diffusion to obtain a completely masked discrete sequence X T ;
[0038] The inference unit is used to generate the fully masked discrete sequence X T Departure, based on a predefined sequence Intervention from probability distribution The sampled , and recover through T-step iterations to obtain the predicted audio discrete code X0; where T represents the total number of time steps, represents the step length, the sequence S is an even-length sequence, and the elements in the sequence S determine In the The position of the audio discrete code recovered in the step, and the elements in the sequence S satisfy the farthest distance relative to other positions that have been selected; denote the tth step and the Step audio discrete coding; From Diffusion Network The output probability distribution is sampled. are the parameters of the Diffusion network;
[0039] The audio synthesis unit is used to convert the predicted audio discrete code X0 into corresponding audio information through the audio codec.
[0040] Preferably, the mask unit is specifically used for:
[0041] In the forward process of Diffusion, at time step t, a binary mask matrix is defined. Mask the original audio discrete code X to obtain the fully masked discrete sequence X T ; where, for the fully masked discrete sequence X T The mth code in ,satisfy ; Indicates that in the masking process, the original audio discrete code X corresponds to The part that is 1 is replaced by a special character [MASK], and The part that is 0 still retains the original encoding. , is a fixed value, n is the dimension of the original audio discrete code X, and t represents the tth time step.
[0042] Preferably, the reasoning unit is specifically used for:
[0043] Get the mask matrix according to the sequence S ,in:
[0044]
[0045]
[0046] A is an increasing sequence generated according to the sequence length of the audio to be synthesized, and the sequence length of the audio to be synthesized is equal to the dimension of the discrete encoding of the original audio. is the mask matrix The elements of , r represents the inference position in the sequence S, % represents the modulo operation, and N is the length of the sequence S; the elements related to the inference position r in each row of the mask matrix are 1, and the other elements are 0;
[0047] In getting Afterwards, according to , and To decide The reasoning position of the step, that is:
[0048] ;
[0049] Through T-step iterative recovery, the predicted audio discrete code X0 is obtained.
[0050] In summary, this embodiment intervenes in the order of the recovered audio discrete codes by setting a sequence S, so that the model relies more on the audio and text to be synthesized corresponding to the acoustic prompts, rather than the audio codes recovered in the previous step, and solves the local conflict problem that occurs in reasoning.
[0051] Specifically, this embodiment selects the farthest audio code position for restoration according to the position of the audio code restored in the previous step, thereby reducing the dependence on the audio code restored in the previous step and preventing local conflicts. This embodiment can effectively alleviate the problem of swallowing and missing words in synthesized speech and improve the robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A flowchart of a speech synthesis method based on discrete diffusion provided in the first embodiment of the present invention;
[0053] Figure 2 Another schematic diagram of the traditional way of reasoning;
[0054] Figure 3 A schematic diagram of a reasoning method provided by an embodiment of the present invention;
[0055] Figure 4 A schematic diagram of the structure of a speech synthesis system based on discrete diffusion provided in the second embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0057] refer to Figure 1 and Figure 2 As shown, the first embodiment of the present invention discloses a speech synthesis method based on discrete diffusion, which can be executed by a speech synthesis device based on discrete diffusion (hereinafter referred to as synthesis device), and in particular, by one or more processors in the synthesis device to implement the following method:
[0058] S101, converting the text to be synthesized into phoneme code C.
[0059] In this embodiment, the synthesis device may be a user terminal, a workstation, or a server, etc., which is not specifically limited in the present invention.
[0060] In this embodiment, the text to be synthesized can be converted into phonemes through the G2P (Grapheme-to-Phoneme) model, and then converted into phoneme codes through a mapping dictionary. ,in Indicates the length of the phoneme code.
[0061] For example, the sentence "quite beautiful" is converted into phonemes as follows:
[0062] ['phase', ['x', 'i', 'aŋ1']], ['when', ['d', 'aŋ1']], ['drift', ['p', 'i', 'au4']], ['bright', ['l', 'i', 'aŋ4']]
[0063] Among them, each phoneme is converted into the corresponding phoneme code through the codebook:
[0064] [105, 47, 30, 37, 30, 80,47,29,73,47,33].
[0065] S102, converting the acoustic prompt and the audio to be synthesized into an acoustic discrete code P and an original audio discrete code X respectively through an audio codec.
[0066] In this embodiment, for example, Encodec codec can be used for conversion. A 5s audio segment is converted into a corresponding For Encodec, the length of the audio discrete code and the audio duration (s) correspond to 1:75.
[0067] S103, in the forward process of Diffusion, the original audio discrete code X is masked to obtain a completely masked discrete sequence X T .
[0068] In this embodiment, T is the length of the fully masked discrete sequence. In the forward process of Diffusion, a binary mask matrix is defined. Mask the audio discrete code X to obtain the fully masked discrete sequence X T ; where, for the fully masked discrete sequence X T The mth code in ,satisfy ; Indicates that in the masking process, the original audio discrete code X corresponds to The part that is 1 is replaced by a special character [MASK], and The part that is 0 still retains the original encoding. , is a fixed value.
[0069] In the reverse process of Diffusion, this embodiment will be a discrete sequence from a completely masked Starting from, step by step according to a reverse distribution Sampling is performed to gradually restore the predicted audio discrete code .but Its information cannot be obtained in the inference stage, so in the training stage, it is necessary to predict the audio discrete code P of the acoustic cue and the phoneme code C of the text information.
[0070] Specifically, a Diffusion network can be used to predict the masked audio code information at each step, so the Diffusion network can be trained by minimizing the negative logarithm likelihood of the masked audio code:
[0071]
[0072] in, is the loss function, is the parameter of the Diffusion network, n is the dimension of audio encoding, is the generated i-th discrete audio code, E t represents the expectation of the tth step. Therefore, according to the above Diffusion network, we can Get the predicted audio discrete code .
[0073] Afterwards, from Sampling to obtain , and As a condition Information:
[0074] .
[0075] S104, in the inference phase, from the fully masked discrete sequence X T Departure, based on a predefined sequence The intervention is sampled from a probability distribution , and through T-step iterative recovery, the predicted audio discrete code X0 is obtained.
[0076] The probability distribution is expressed as , the sequence S is an even-length sequence, and the elements in the sequence S determine In the The position of the audio discrete code restored in the step, and the elements in the sequence S satisfy the farthest distance relative to other positions that have been selected.
[0077] Specifically, in the inference phase, we first start with a completely masked discrete sequence Starting from The results of sampling are obtained .like Figure 2 As shown, according to the reverse process, we can start from the Diffusion network The output probability distribution is sampled , and then according to and ,Right now Random sampling, probability sampling or entropy size is used to obtain . However, this approach will lead to Over-dependence information, which weakens its dependence on acoustic discrete code P and phoneme code C, and is also prone to local conflict problems, resulting in swallowing and missing words.
[0078] To alleviate this problem, Figure 3 As shown, this embodiment defines an even sequence , where the elements in the sequence satisfy The farthest distance from other positions that have been selected. For example, the entire sequence can be regarded as a circle composed of N discrete points, which means that the point selected each time should be as far away from the previously selected point as possible. For example, for the example of N=32, 0 is selected for the first time, and the symmetrical point in the circle is selected for the second time as 16. Then the point farthest from 16 is actually 0, but 0 has been selected, so the point farthest from 0 and 16 is actually 8 or 24. 8 can be selected, and so on. Taking N=32 as an example, the following sequence can be obtained:
[0079] S = [0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30, 1,17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7,23, 15, 31].
[0080] According to the above sequence, we get a mask matrix To intervene from The sampled The result of , thereby determining its reasoning position at each step. The reasoning order of the entire sequence is obtained according to the following formula:
[0081] ,
[0082]
[0083] Where A is an increasing sequence generated according to the length n of the audio sequence to be synthesized, is the mask matrix The elements of , r represents the inference position in the sequence S, % represents the modulo operation, and N is the length of the sequence S. The elements related to the inference position r in each row of the mask matrix are 1, and the other elements are 0.
[0084] In getting After that, the sampling results Perform mask operation. The result of step sampling is based on and To decide The reasoning position of the step, that is:
[0085] = · + ·
[0086] Through T-step iterative recovery, the predicted audio discrete code is obtained .
[0087] S105, converting the predicted audio discrete code X0 into corresponding audio information through an audio codec.
[0088] In summary, this embodiment intervenes in the order of the recovered audio discrete codes by setting a sequence S, so that the model relies more on the audio and text to be synthesized corresponding to the acoustic prompts, rather than the audio codes recovered in the previous step, and solves the local conflict problem that occurs in reasoning.
[0089] Specifically, this embodiment selects the farthest audio code position for restoration according to the position of the audio code restored in the previous step, thereby reducing the dependence on the audio code restored in the previous step and preventing local conflicts. This embodiment can effectively alleviate the problem of swallowing and missing words in synthesized speech and improve the robustness of the model.
[0090] See also Figure 4 The second embodiment of the present invention further provides a speech synthesis system based on discrete diffusion, which includes:
[0091] A text conversion unit 210, used for converting the text to be synthesized into a phoneme code C;
[0092] The encoding unit 220 is used to convert the acoustic prompt and the audio to be synthesized into an acoustic discrete code P and an original audio discrete code X respectively through an audio codec;
[0093] The masking unit 230 is used to perform a masking operation on the original audio discrete code X in the forward process of Diffusion to obtain a completely masked discrete sequence X. T , T is the length of the fully masked discrete sequence;
[0094] The inference unit 240 is used to obtain the fully masked discrete sequence X in the inference phase. T Departure, based on a predefined sequence Intervention from probability distribution The sampled , and through T-step iterative recovery, the predicted audio discrete code X0 is obtained; where the sequence S is a sequence of even length, and the elements in the sequence S determine In the The position of the audio discrete code recovered in the step, and the elements in the sequence S satisfy the farthest distance relative to other positions that have been selected; denote the tth step and the Step audio discrete coding; From Diffusion Network The output probability distribution is sampled. are the parameters of the Diffusion network;
[0095] The audio synthesis unit 250 is used to convert the predicted audio discrete code X0 into corresponding audio information through the audio codec.
[0096] Preferably, the mask unit 230 is specifically used for:
[0097] In the forward process of Diffusion, at time step t, a binary mask matrix is defined. Mask the original audio discrete code X to obtain the fully masked discrete sequence X T ; where, for the fully masked discrete sequence X T The mth code in ,satisfy ; Indicates that in the masking process, the audio discrete code X corresponds to The part that is 1 is replaced by a special character [MASK], and The part that is 0 still retains the original encoding. , is a fixed value, n is the dimension of audio encoding, and t represents the tth time step.
[0098] Preferably, the reasoning unit 240 is specifically used for:
[0099] Get the mask matrix according to the sequence S ,in:
[0100]
[0101]
[0102] A is an increasing sequence generated according to the length of the audio sequence to be synthesized, and the length of the sequence of the audio to be synthesized is equal to the dimension n of the audio encoding, is the mask matrix The elements of , r represents the inference position in the sequence S, % represents the modulo operation, and N is the length of the sequence S; the elements related to the inference position r in each row of the mask matrix are 1, and the other elements are 0;
[0103] In getting After that, the sampling results Perform mask operation, then The result of step sampling is based on and To decide The reasoning position of the step, that is:
[0104] = · + · ;
[0105] Through T-step iterative recovery, the predicted audio discrete code X0 is obtained.
[0106] The third embodiment of the present invention further provides a speech synthesis device based on discrete Diffusion, which includes a memory and a processor. The memory stores a computer program, and the computer program can be executed by the processor to implement the speech synthesis method based on discrete Diffusion as described above.
[0107] The fourth embodiment of the present invention further provides a computer-readable storage medium storing a computer program, wherein the computer program can be executed by the processor to implement the above-mentioned speech synthesis method based on discrete diffusion.
[0108] Exemplarily, the computer program described in the third embodiment and the fourth embodiment of the present invention may be divided into one or more modules, and the one or more modules are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the speech synthesis device. For example, the system described in the second embodiment of the present invention.
[0109] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the speech synthesis method, and uses various interfaces and lines to connect various parts of the entire speech synthesis method.
[0110] The memory can be used to store the computer program and / or module, and the processor realizes various functions of an error correction method by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, a text conversion function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, text message data, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0111] Wherein, if the implemented module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0112] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0113] The above are only preferred implementations of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention.
Claims
1. A speech synthesis method based on discrete diffusion. It is characterized in that include: S101, converting the text to be synthesized into a phoneme code C; S102, converting the acoustic prompt and the audio to be synthesized into an acoustic discrete code P and an original audio discrete code X respectively through an audio codec; S103, in the forward process of Diffusion, a mask operation is performed on the original audio discrete code X to obtain a completely masked discrete sequence X T ; S104, in the inference phase, from the fully masked discrete sequence X T Starting from the probability distribution based on the predefined sequence S The sampled , and through T-step iterative recovery, the predicted audio discrete code X is obtained 0 ; where T represents the total number of time steps, represents the step length, the sequence S is an even-length sequence, and the elements in the sequence S determine In the The position of the audio discrete code recovered in the step, and the elements in the sequence S satisfy the farthest distance relative to other positions that have been selected; Respectively represent Step and Step audio discrete coding; From Diffusion Network The output probability distribution is sampled. is the parameter of the Diffusion network; specifically, it includes: obtaining the mask matrix according to the sequence S ,in: A is an increasing sequence generated according to the sequence length of the audio to be synthesized, and the sequence length of the audio to be synthesized is equal to the dimension of the discrete encoding of the original audio. is the jth element of the increasing sequence A, is the mask matrix The elements of , r represents the inference position in the sequence S, % represents the modulo operation, and N is the length of the sequence S; the elements related to the inference position r in each row of the mask matrix are 1, and the other elements are 0; In getting Afterwards, according to , and To decide The reasoning position of the step, that is: ; Through T-step iterative recovery, the predicted audio discrete code X is obtained. 0 ; S105, discretely encode the predicted audio 0 Converted into corresponding audio information through audio codec.
2. The speech synthesis method based on discrete diffusion according to claim 1, It is characterized in that Step S101 specifically includes: The text to be synthesized is converted into phonemes through the G2P model, and the phonemes are converted into phoneme codes through the mapping dictionary ; Indicates the length of the phoneme code.
3. The speech synthesis method based on discrete diffusion according to claim 1, It is characterized in that Step S103 specifically includes: In the forward process of Diffusion, at time step t, a binary mask matrix is defined. Mask the original audio discrete code X to obtain the fully masked discrete sequence X T ; where, for the fully masked discrete sequence X T The mth code in ,satisfy ; Indicates that in the masking process, the original audio discrete code X corresponds to The part that is 1 is replaced by a special character [MASK], and The part that is 0 still retains the original encoding. , is a fixed value, n is the dimension of the original audio discrete code X, and t represents the tth time step.
4. The speech synthesis method based on discrete diffusion according to claim 3, It is characterized in that Also includes: In the reverse process of Diffusion, from the fully masked discrete sequence X T Starting from, gradually according to the reverse distribution Sampling is performed to gradually restore the predicted audio discrete code ; Wherein, in the training stage, the audio discrete code is predicted according to the acoustic discrete code P and the phoneme code C information; during prediction, the Diffusion network is used to predict the masked audio coding information at each step.
5. The speech synthesis method based on discrete diffusion according to claim 4, It is characterized in that The Diffusion network is trained by minimizing the negative log-likelihood of the masked audio encoding: in, is the loss function, n is the dimension of the original audio discrete encoding, Generate the i-th discrete audio code; Based on the Diffusion network, according to Get the predicted audio discrete code ; from Sampling to obtain , and and As a condition : , E stands for expectation. t represents the expectation at step t.
6. A speech synthesis system based on discrete diffusion. It is characterized in that include: A text conversion unit, used for converting the text to be synthesized into a phoneme code C; An encoding unit, used for converting the acoustic prompt and the audio to be synthesized into an acoustic discrete code P and an original audio discrete code X respectively through an audio codec; The mask unit is used to perform a mask operation on the original audio discrete code X in the forward process of Diffusion to obtain a completely masked discrete sequence X T ; The inference unit is used to generate the fully masked discrete sequence X T Starting from the probability distribution based on the predefined sequence S The sampled , and through T-step iterative recovery, the predicted audio discrete code X is obtained 0 ; where T represents the total number of time steps, represents the step length, the sequence S is an even-length sequence, and the elements in the sequence S determine In the The position of the audio discrete code recovered in the step, and the elements in the sequence S satisfy the farthest distance relative to other positions that have been selected; denote the tth step and the Step audio discrete coding; From Diffusion Network The output probability distribution is sampled. is the parameter of the Diffusion network; wherein the inference unit is specifically used to obtain the mask matrix according to the sequence S ,in: A is an increasing sequence generated according to the sequence length of the audio to be synthesized, and the sequence length of the audio to be synthesized is equal to the dimension of the discrete encoding of the original audio. is the jth element of the increasing sequence A, is the mask matrix The elements of , r represents the inference position in the sequence S, % represents the modulo operation, and N is the length of the sequence S; the elements related to the inference position r in each row of the mask matrix are 1, and the other elements are 0; In getting Afterwards, according to , and To decide The reasoning position of the step, that is: ; Through T-step iterative recovery, the predicted audio discrete code X is obtained. 0 ; Audio synthesis unit, used to discretely encode the predicted audio X 0 Converted into corresponding audio information through audio codec.
7. The speech synthesis system based on discrete diffusion according to claim 6, It is characterized in that The mask unit is specifically used for: In the forward process of Diffusion, at time step t, a binary mask matrix is defined. Mask the original audio discrete code X to obtain the fully masked discrete sequence X T ; where, for the fully masked discrete sequence X T The mth code in ,satisfy ; Indicates that in the masking process, the original audio discrete code X corresponds to The part that is 1 is replaced by a special character [MASK], and The part that is 0 still retains the original encoding. , is a fixed value, n is the dimension of the original audio discrete code X, and t represents the tth time step.
Citation Information
Patent Citations
Reading controllable speech synthesis method and device based on speech self-supervised learning representation
CN117672176A
Speech synthesis method and device, electronic equipment and storage medium
CN117809621A
