Speech synthesis method, speech synthesis model training method and device

By using global and local style representation networks in the speech synthesis model, combined with global instruction information and reference speech, flexible control of speech features is achieved, which solves the problem of a single intonation style in the end-to-end speech synthesis model and improves the diversity of speech synthesis. performance and usability.

CN112712788BActive Publication Date: 2024-09-20BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011545256.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-24
Publication Date
2024-09-20
Estimated Expiration
2040-12-24

AI Technical Summary

Technical Problem

The end-to-end speech synthesis model has deficiencies in flexible control of intonation style, resulting in a relatively single intonation style and lack of diversity in synthesized speech, which affects its usability.

Method used

By obtaining the global instruction information and reference speech, combined with the speech synthesis model, the global instruction information and reference speech are integrated into the text information conversion process, and the global style representation network and local style representation network are used to perform overall and local control of intonation style to achieve Flexible control of speech characteristics.

Benefits of technology

It improves the usability of speech synthesis, makes the intonation styles of synthesized speech more diverse, enhances the accuracy and usability of speech synthesis, and reduces model training costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112712788B
    Figure CN112712788B
Patent Text Reader

Abstract

The present disclosure relates to a speech synthesis method, a training method and a device for a speech synthesis model, and belongs to the field of speech synthesis technology. The method comprises: obtaining global indication information and reference speech, wherein the global indication information is used to indicate the overall intonation style of the speech to be synthesized, and the reference speech is used to indicate the local intonation style of the speech to be synthesized; inputting text information, global indication information and reference speech into the speech synthesis model; outputting speech features corresponding to the text information through the speech synthesis model; wherein the speech synthesis model is trained based on sample text information, sample global indication information and sample reference speech corresponding to the sample text information. The present disclosure integrates the global indication information and the reference speech into the process of converting text information into speech features through the speech synthesis model, thereby realizing flexible control of the intonation style, making the intonation style of the synthesized speech more diversified and improving the usability of speech synthesis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of speech synthesis technology, and in particular to a speech synthesis method, a training method and a device for a speech synthesis model. Background Art

[0002] In order to make machines learn to "speak", researchers are committed to studying speech synthesis technology so that machines can convert text into speech. Currently, speech synthesis technology has been widely used in scenarios such as intelligent question and answer, voice broadcasting, audio books, and virtual anchors.

[0003] With the development of deep learning, speech synthesis technology has also entered the end-to-end development stage. "End-to-end" means that the output result is directly obtained based on the input data. In the field of speech synthesis, the end-to-end speech synthesis model can directly output the speech features corresponding to the text based on the input text.

[0004] Although the end-to-end speech synthesis model has obvious advantages over the speech splicing synthesis method in terms of improving synthesis effects and reducing the workload of data annotation, the end-to-end speech synthesis model is a "black box" speech synthesis system. Through the end-to-end speech synthesis model, it is impossible to achieve flexible control of speech speed, pitch and other intonation styles like the speech splicing synthesis method. The intonation style of the speech synthesized by the end-to-end speech synthesis model is relatively single, and the usability of speech synthesis is insufficient. Summary of the invention

[0005] The embodiments of the present disclosure provide a speech synthesis method, a training method and a device for a speech synthesis model to improve the usability of speech synthesis. The technical solution of the present disclosure is as follows:

[0006] In one aspect, a speech synthesis method is provided, the method comprising:

[0007] Acquire global indication information and reference speech, wherein the global indication information is used to indicate the overall intonation style of the speech to be synthesized, and the reference speech is used to indicate the local intonation style of the speech to be synthesized;

[0008] Inputting text information, the global indication information and the reference speech into a speech synthesis model;

[0009] Outputting speech features corresponding to the text information through the speech synthesis model;

[0010] The speech synthesis model is trained based on sample text information, sample global indication information and sample reference speech corresponding to the sample text information.

[0011] The technical solution provided by the embodiments of the present disclosure uses global indication information to indicate the overall intonation style of speech, and uses reference speech to indicate the local intonation style of speech. Through a speech synthesis model, the global indication information and the reference speech are integrated into the process of converting text information into speech features. On the one hand, the speech features finally obtained conform to the overall intonation style indicated by the global indication information. On the other hand, the local intonation style of the speech features is more finely controlled through the reference speech, thereby achieving flexible control of the intonation style, making the intonation style of the synthesized speech more diversified, thereby improving the usability of speech synthesis.

[0012] In an optional implementation, the speech synthesis model includes a text encoding network, a speech encoding network, a global style representation network, a local style representation network, an attention network and a decoding network, wherein the speech encoding network is connected to the local style representation network, the text encoding network is connected to the local style representation network and the attention network respectively, the global style representation network and the local style representation network are connected to the attention network respectively, and the attention network is connected to the decoding network;

[0013] The step of outputting the speech features corresponding to the text information through the speech synthesis model includes:

[0014] Determine the phoneme vector sequence corresponding to the text information through the text encoding network; determine the reference speech vector sequence corresponding to the reference speech through the speech encoding network;

[0015] Converting the global indication information into a global style vector through the global style representation network;

[0016] Determine, by the local style representation network, a local adjustment vector sequence based on the reference speech vector sequence and the phoneme vector sequence, wherein the local adjustment vector sequence is used to represent the influence of the intonation style of each speech frame of the reference speech on the speech feature corresponding to each phoneme of the text information;

[0017] In any process of determining the speech feature corresponding to a phoneme, an intermediate vector is determined through the attention network based on the phoneme vector sequence, the global style vector and the local adjustment vector sequence; and a speech feature corresponding to a phoneme is determined through the decoding network based on the intermediate vector.

[0018] The above technical solution converts global indication information into a global style vector, uses the global style vector to indicate the overall intonation style, converts text information and reference speech into a phoneme vector sequence and a reference speech vector sequence through an encoding network, uses the phoneme vector sequence and the reference speech vector sequence as inputs to a local style representation network, determines a local adjustment vector sequence, uses the local adjustment vector sequence to represent the influence of the intonation style of each speech frame of the reference speech on the speech features corresponding to each phoneme of the text information, and then determines an intermediate vector based on the phoneme vector sequence, the global style vector and the local adjustment vector sequence through an attention network. On the basis of realizing flexible control over the overall intonation style and local intonation style of speech features, information loss is further reduced, and the accuracy of the intermediate vector representation is improved. Then, based on the intermediate vector with higher accuracy, speech features with higher accuracy are obtained, thereby improving the accuracy of speech synthesis.

[0019] In another optional implementation, the global indication information includes at least one of a mean value of duration indications of syllables of the speech feature, a mean value of fundamental frequency indications of the speech feature, and a variance of fundamental frequency indications of the speech feature.

[0020] The above technical solution can control the mean of the duration of the syllables of the speech feature through the duration indication mean, thereby realizing the control of the overall speech speed of the sentence; can control the mean of the fundamental frequency of the speech feature through the fundamental frequency indication mean, thereby realizing the control of the overall pitch of the sentence; can control the variance of the fundamental frequency of the speech feature through the fundamental frequency indication variance, thereby realizing the control of the degree of change of the overall pitch fluctuation of the sentence. Through the duration indication mean, the fundamental frequency indication mean and the fundamental frequency indication variance, the overall intonation style of the sentence can be controlled from the aspects of speech speed, pitch and pitch fluctuation, so that the intonation style of the synthesized speech can be more diversified, thereby improving the usability of speech synthesis.

[0021] On the one hand, a method for training a speech synthesis model is provided, and the method for training the speech synthesis model comprises:

[0022] In any iteration process, obtaining sample global indication information, wherein the sample global indication information is used to indicate the overall intonation style of the speech to be synthesized;

[0023] Inputting sample text information, sample reference speech and the sample global indication information into a speech synthesis model, wherein the sample reference speech is a speech representation of the sample text information and is used to indicate a local intonation style of the speech to be synthesized;

[0024] Outputting speech features corresponding to the sample text information through the speech synthesis model;

[0025] Based on the speech features output by the speech synthesis model and the speech features of the sample reference speech, the model parameters of the speech synthesis model are updated until the training stop condition is met, and the trained speech synthesis model is output.

[0026] The technical solution provided by the embodiment of the present disclosure uses global indication information to indicate the overall intonation style of the speech during the training process of the speech synthesis model, and uses the speech representation of the text information as the reference speech to indicate the local intonation style of the speech, so that the speech synthesis model refers to the intonation styles indicated by both the global indication information and the reference speech, converts the text information into corresponding speech features, and then updates the model parameters of the speech synthesis model based on the speech features output by the speech synthesis model and the speech features of the reference speech, so that the trained speech synthesis model can output speech features that meet the overall intonation style indicated by the global indication information and the local intonation style indicated by the reference speech, so that the trained speech synthesis model can achieve flexible control of the intonation style, make the intonation style of the synthesized speech more diversified, and improve the usability of speech synthesis.

[0027] In an optional implementation, the speech synthesis model includes a text encoding network, a speech encoding network, a global style representation network, a local style representation network, an attention network and a decoding network, wherein the speech encoding network is connected to the global style representation network and the local style representation network respectively, the text encoding network is connected to the local style representation network and the attention network respectively, the global style representation network and the local style representation network are connected to the attention network respectively, and the attention network is connected to the decoding network;

[0028] The step of outputting the speech features corresponding to the sample text information through the speech synthesis model includes:

[0029] Determine a sample phoneme vector sequence corresponding to the sample text information through the text encoding network; determine a sample reference speech vector sequence corresponding to the sample reference speech through the speech encoding network;

[0030] Determining a global style embedding vector based on the sample global indication information and the sample reference speech vector sequence through the global style representation network;

[0031] Determine, by the local style representation network, a sample local adjustment vector sequence based on the sample phoneme vector sequence and the sample reference speech vector sequence, wherein the sample local adjustment vector sequence is used to represent the influence of the intonation style of each speech frame of the sample reference speech on the speech feature corresponding to each phoneme of the sample text information;

[0032] In any process of determining the speech feature corresponding to a phoneme, the sample intermediate vector is determined through the attention network based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence; and the speech feature corresponding to a phoneme is determined through the decoding network based on the sample intermediate vector.

[0033] The above technical solution converts text information and reference speech into a phoneme vector sequence and a reference speech vector sequence through an encoding network, takes the reference speech vector sequence and the global indication information as the input of the global style representation network, determines the global style embedding vector, makes the global intonation style of the reference speech affect the value of the global style embedding vector, integrates the global intonation style of the reference speech into the global style embedding vector, enhances the diversity of the global style embedding vector used to indicate the overall intonation style, and thus can train a stable speech synthesis model based on fewer training samples, reduce the training cost of the model, and integrate the phoneme vector sequence and the reference speech into the global style embedding vector. The quantity sequence is used as the input of the local style representation network to determine the local adjustment vector sequence, which is used to represent the influence of the intonation style of each speech frame of the reference speech on the speech features corresponding to each phoneme of the text information. Then, through the attention network, based on the phoneme vector sequence, the global style embedding vector and the local adjustment vector sequence, the intermediate vector is determined. On the basis of realizing flexible control of the overall intonation style and local intonation style of the speech features, the information loss is further reduced, and the accuracy of the intermediate vector representation is improved. Then, based on the more accurate intermediate vector, a more accurate speech feature is obtained, thereby improving the accuracy of speech synthesis.

[0034] In another optional implementation, determining the sample reference speech vector sequence corresponding to the sample reference speech through the speech coding network includes:

[0035] In any process of encoding a vector of a speech frame of the sample reference speech, encoding is performed through the speech coding network based on the vector of the speech frame obtained by the previous encoding and the speech features of the speech frame to be encoded this time, so as to obtain the vector of the speech frame to be encoded this time;

[0036] The determining of a global style embedding vector based on the sample global indication information and the sample reference speech vector sequence through the global style representation network includes:

[0037] The global style representation network is used to convert the sample global indication information into a sample global style vector;

[0038] The global style embedding vector is determined based on the sample global style vector and the vector of the last speech frame in the sample reference speech vector sequence, wherein the vector of the last speech frame integrates speech features of multiple speech frames of the sample reference speech.

[0039] The above technical solution obtains the vector of the last speech frame in the sample reference speech vector sequence, and determines the global style embedding vector based on the vector of the last speech frame and the sample global style vector corresponding to the sample global indication information, so that the global intonation style of the sample reference speech affects the value of the global style embedding vector, and the global intonation style of the sample reference speech is integrated into the global style embedding vector, thereby enhancing the diversity of the global style embedding vector used to indicate the overall intonation style, so that a stable speech synthesis model can be trained based on fewer training samples, thereby reducing the training cost of the model.

[0040] In another optional implementation, determining the global style embedding vector based on the sample global style vector and the vector of the last speech frame in the sample reference speech vector sequence includes:

[0041] Resampling is performed based on a Gaussian distribution with each value in the sample global style vector as a mean and each value in the vector of the last speech frame as a variance to obtain each value in the global style embedding vector.

[0042] The above technical solution constructs a Gaussian distribution with each value in the sample global style vector as the mean and each value in the vector of the last speech frame as the variance, and resampling is performed based on the Gaussian distribution. There is a certain probability of sampling other values ​​​​in addition to the values ​​​​in the sample global style vector, thereby increasing the diversity of the values ​​​​of the global style embedding vector, and providing richer indications of the overall intonation style of the synthesized speech. Therefore, based on fewer training samples, a stable speech synthesis model can be trained, thereby reducing the training cost of the model.

[0043] In another optional implementation, determining the sample local adjustment vector sequence based on the sample phoneme vector sequence and the sample reference speech vector sequence through the local style representation network includes:

[0044] Determine, by the local style representation network, the probability that each of the multiple speech frames of the sample reference speech corresponds to each of the multiple phonemes of the sample text information, based on the sample phoneme vector sequence and the sample reference speech vector sequence according to the attention mechanism;

[0045] Based on the probability that each speech frame corresponds to each phoneme and the sample reference speech vector sequence, the sample local adjustment vector sequence is determined, wherein the sequence length of the sample local adjustment vector sequence is equal to the sequence length of the sample phoneme vector sequence.

[0046] The above technical scheme determines the probability that each speech frame of the reference speech corresponds to each phoneme of the text information according to the attention mechanism, and uses the obtained probability to indicate the degree of influence of each speech frame of the reference speech on the intonation style corresponding to each phoneme of the text information. The greater the probability that any speech frame corresponds to any phoneme, the greater the influence of the intonation style of the speech frame on the phoneme. Based on the obtained probability and the reference speech vector sequence, a local adjustment vector sequence is determined, so that the local adjustment vector sequence can represent the influence of the intonation style of the reference speech on the speech features corresponding to each phoneme of the text information according to the corresponding degree of influence. Based on the local adjustment vector sequence, the local intonation style of the reference speech can be correspondingly integrated into the speech features corresponding to the text information, thereby realizing flexible control of the intonation style of the synthesized speech and improving the availability of the speech synthesis model.

[0047] In addition, the above technical solution, based on the attention mechanism, represents the influence of the intonation style of the reference speech on the speech features corresponding to each phoneme of the text information. There is no need to mark the one-to-one correspondence between the speech frames of the reference speech and the phonemes of the text information during the training process. On the basis of ensuring the availability of the model, it does not rely on manual data annotation, thus reducing the cost of manual annotation, reducing the difficulty of producing the corpus based on which the training is based, and improving the efficiency of corpus production.

[0048] In another optional implementation, in the process of determining the speech feature corresponding to a phoneme at any time, determining the sample intermediate vector based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence through the attention network, including:

[0049] In any process of determining a speech feature corresponding to a phoneme, determining, through the attention network, attention weights corresponding to a plurality of phonemes of the sample text information based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence;

[0050] Based on the attention weights corresponding to the multiple phonemes, weighted sum is performed on the vectors corresponding to the multiple phonemes to obtain the sample intermediate vector.

[0051] The above technical solution determines the attention weights corresponding to multiple phonemes of text information according to the attention mechanism, and then performs weighted summation on the vectors corresponding to the multiple phonemes based on the attention weights to obtain an intermediate vector, so that the intermediate vector weights the vectors corresponding to the multiple phonemes together according to the degree of attention to different phonemes. Compared with directly using the vector corresponding to the last phoneme as the intermediate vector, it reduces information loss and enhances the accuracy of vector expression. Furthermore, based on the more accurate intermediate vector, more accurate speech features can be obtained, thereby improving the accuracy of speech synthesis.

[0052] In one aspect, a speech synthesis device is provided, the speech synthesis device comprising:

[0053] A first information acquisition module is configured to acquire global indication information and reference speech, wherein the global indication information is used to indicate the overall intonation style of the speech to be synthesized, and the reference speech is used to indicate the local intonation style of the speech to be synthesized;

[0054] A first information input module is configured to input text information, the global indication information and the reference speech into a speech synthesis model;

[0055] A first speech synthesis module is configured to execute the speech synthesis model to output the speech features corresponding to the text information;

[0056] The speech synthesis model is trained based on sample text information, sample global indication information and sample reference speech corresponding to the sample text information.

[0057] In an optional implementation, the speech synthesis model includes a text encoding network, a speech encoding network, a global style representation network, a local style representation network, an attention network and a decoding network, wherein the speech encoding network is connected to the local style representation network, the text encoding network is connected to the local style representation network and the attention network respectively, the global style representation network and the local style representation network are connected to the attention network respectively, and the attention network is connected to the decoding network;

[0058] The first speech synthesis module is configured to execute:

[0059] Determine the phoneme vector sequence corresponding to the text information through the text encoding network; determine the reference speech vector sequence corresponding to the reference speech through the speech encoding network;

[0060] Converting the global indication information into a global style vector through the global style representation network;

[0061] Determine, by the local style representation network, a local adjustment vector sequence based on the reference speech vector sequence and the phoneme vector sequence, wherein the local adjustment vector sequence is used to represent the influence of the intonation style of each speech frame of the reference speech on the speech feature corresponding to each phoneme of the text information;

[0062] In any process of determining the speech feature corresponding to a phoneme, an intermediate vector is determined through the attention network based on the phoneme vector sequence, the global style vector and the local adjustment vector sequence; and a speech feature corresponding to a phoneme is determined through the decoding network based on the intermediate vector.

[0063] In another optional implementation, the global indication information includes at least one of a mean value of duration indications of syllables of the speech feature, a mean value of fundamental frequency indications of the speech feature, and a variance of fundamental frequency indications of the speech feature.

[0064] In one aspect, a training device for a speech synthesis model is provided, the training device for the speech synthesis model comprising:

[0065] A second information acquisition module is configured to acquire sample global indication information during any iteration, wherein the sample global indication information is used to indicate the overall intonation style of the speech to be synthesized;

[0066] A second information input module is configured to input sample text information, sample reference speech and the sample global indication information into a speech synthesis model, wherein the sample reference speech is a speech representation of the sample text information, and is used to indicate a local intonation style of the speech to be synthesized;

[0067] A second speech synthesis module is configured to execute the speech synthesis model to output speech features corresponding to the sample text information;

[0068] The model parameter updating module is configured to update the model parameters of the speech synthesis model based on the speech features output by the speech synthesis model and the speech features of the sample reference speech until the training stop condition is met, and output the trained speech synthesis model.

[0069] In an optional implementation, the speech synthesis model includes a text encoding network, a speech encoding network, a global style representation network, a local style representation network, an attention network and a decoding network, wherein the speech encoding network is connected to the global style representation network and the local style representation network respectively, the text encoding network is connected to the local style representation network and the attention network respectively, the global style representation network and the local style representation network are connected to the attention network respectively, and the attention network is connected to the decoding network;

[0070] The second speech synthesis module comprises:

[0071] A text encoding unit, configured to determine a sample phoneme vector sequence corresponding to the sample text information through the text encoding network;

[0072] A speech coding unit, configured to determine a sample reference speech vector sequence corresponding to the sample reference speech through the speech coding network;

[0073] A global style representation unit, configured to determine a global style embedding vector based on the sample global indication information and the sample reference speech vector sequence through the global style representation network;

[0074] A local style representation unit is configured to determine a sample local adjustment vector sequence based on the sample phoneme vector sequence and the sample reference speech vector sequence through the local style representation network, wherein the sample local adjustment vector sequence is used to represent the influence of the intonation style of each speech frame of the sample reference speech on the speech feature corresponding to each phoneme of the sample text information;

[0075] The intermediate vector representation unit is configured to determine the sample intermediate vector based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence through the attention network in any process of determining the speech feature corresponding to a phoneme;

[0076] The decoding unit is configured to determine the speech feature corresponding to a phoneme based on the sample intermediate vector through the decoding network.

[0077] In another optional implementation, the speech encoding unit is configured to perform encoding through the speech encoding network based on the vector of the speech frame obtained by the previous encoding and the speech features of the speech frame to be encoded this time, in the process of obtaining the vector of a speech frame of the sample reference speech by any encoding, so as to obtain the vector of the speech frame to be encoded this time;

[0078] The global style representation unit includes:

[0079] A global style vector determination subunit is configured to convert the sample global indication information into a sample global style vector through the global style representation network;

[0080] The global style embedding vector determination subunit is configured to determine the global style embedding vector based on the sample global style vector and the vector of the last speech frame in the sample reference speech vector sequence, wherein the vector of the last speech frame integrates the speech features of multiple speech frames of the sample reference speech.

[0081] In another optional implementation, the global style embedding vector determination subunit is configured to perform resampling based on a Gaussian distribution with each value in the sample global style vector as a mean and each value in the vector of the last speech frame as a variance, so as to obtain each value in the global style embedding vector.

[0082] In another optional implementation, the local style representation unit is configured to execute:

[0083] Determine, by the local style representation network, the probability that each of the multiple speech frames of the sample reference speech corresponds to each of the multiple phonemes of the sample text information, based on the sample phoneme vector sequence and the sample reference speech vector sequence according to the attention mechanism;

[0084] Based on the probability that each speech frame corresponds to each phoneme and the sample reference speech vector sequence, the sample local adjustment vector sequence is determined, wherein the sequence length of the sample local adjustment vector sequence is equal to the sequence length of the sample phoneme vector sequence.

[0085] In another optional implementation, the intermediate vector representation unit is configured to execute:

[0086] In any process of determining a speech feature corresponding to a phoneme, determining, through the attention network, attention weights corresponding to a plurality of phonemes of the sample text information based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence;

[0087] Based on the attention weights corresponding to the multiple phonemes, weighted sum is performed on the vectors corresponding to the multiple phonemes to obtain the sample intermediate vector.

[0088] On the one hand, an electronic device is provided, comprising: one or more processors; a memory for storing instructions executable by the processors; wherein the processor is configured to execute the instructions to implement the speech synthesis method described in any of the above optional implementations.

[0089] On the one hand, a server is provided, comprising: one or more processors; a memory for storing instructions executable by the processors; wherein the processor is configured to execute the instructions to implement the speech synthesis method described in any of the above optional implementations or the speech synthesis model training method described in any of the above optional implementations.

[0090] On the one hand, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the speech synthesis method described in any of the above optional implementations.

[0091] On the one hand, a computer-readable storage medium is provided. When the instructions in the computer-readable storage medium are executed by the processor of the server, the server can execute the speech synthesis method described in any of the above optional implementations or the training method of the speech synthesis model described in any of the above optional implementations.

[0092] On the one hand, a computer program product is provided, comprising a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the speech synthesis method described in any of the above optional implementations is implemented.

[0093] On the one hand, a computer program product is provided, comprising a computer program / instruction, which, when executed by a processor, implements the method for training a speech synthesis model described in any of the above optional implementations.

[0094] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0095] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0096] Figure 1 is a schematic diagram of an implementation environment according to an exemplary embodiment;

[0097] Figure 2 is a flow chart of a speech synthesis method according to an exemplary embodiment;

[0098] Figure 3 is a flowchart of a method for training a speech synthesis model according to an exemplary embodiment;

[0099] Figure 4 is a schematic diagram showing the structure of a speech synthesis model according to an exemplary embodiment;

[0100] Figure 5 is a flowchart of a method for training a speech synthesis model according to an exemplary embodiment;

[0101] Figure 6 is a schematic diagram showing the structure of a speech synthesis model according to an exemplary embodiment;

[0102] Figure 7 is a flow chart of a speech synthesis method according to an exemplary embodiment;

[0103] Figure 8 is a block diagram of a speech synthesis device according to an exemplary embodiment;

[0104] Fig. 9 is a block diagram of a training device for a speech synthesis model according to an exemplary embodiment;

[0105] Fig.10 is a block diagram of an electronic device according to an exemplary embodiment;

[0106] Fig.11 It is a block diagram of a server according to an exemplary embodiment. DETAILED DESCRIPTION

[0107] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0108] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0109] The user information involved in the present disclosure may be information authorized by the user or fully authorized by all parties.

[0110] Figure 1 is a schematic diagram of an implementation environment according to an exemplary embodiment. Figure 1 , the implementation environment includes a server 110 and an electronic device 120.

[0111] The server 110 can be one server, multiple servers, a cloud server, a cloud computing platform or a virtualization center, etc., but is not limited thereto. The server 110 is at least used to train a speech synthesis model. The server 110 is connected to the electronic device 120 via a wireless network or a wired network. In an optional implementation, the server 110 sends the trained speech synthesis model to the electronic device 120, so that the electronic device 120 deploys the speech synthesis model locally, so that the electronic device 120 can convert text information into speech through the locally deployed speech synthesis model to achieve offline speech synthesis. In another optional implementation, the server 110 also has a speech synthesis function. The server 110 receives text information of the speech to be synthesized; converts the text information into speech through the trained speech synthesis model; and sends the speech to the electronic device 120 so that the electronic device 120 plays the speech.

[0112] The number of the above servers may be more or less, and the embodiments of the present disclosure do not limit this. Of course, the server 110 may also have at least one of the functions such as speech recognition, intelligent question and answer, and machine translation, so as to provide more comprehensive and diversified services.

[0113] The electronic device 120 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart TV, a smart robot or a children's story machine, etc., but is not limited thereto. Optionally, the electronic device 120 is provided with a client supporting a voice broadcast function, such as a reading client, a news client, a navigation client or a voice assistant client, etc. The voice broadcast function of the above client is implemented based on the support of a speech synthesis model.

[0114] The electronic device 120 may generally refer to one of a plurality of electronic devices, and this embodiment is only illustrated by the electronic device 120. Those skilled in the art may know that the number of the electronic devices may be more or less. For example, the number of the electronic devices may be only a few, or the number of the electronic devices may be dozens or hundreds, or a greater number. The embodiment of the present disclosure does not limit the number and type of the electronic devices.

[0115] Figure 2 is a flow chart of a speech synthesis method according to an exemplary embodiment. The speech synthesis method can be applied to a server or an electronic device. Figure 2In the embodiment of the present disclosure, a server using a speech synthesis model to perform speech synthesis is briefly described as an example. The embodiment includes the following steps.

[0116] In step S201, the server obtains global indication information and reference speech, wherein the global indication information is used to indicate the overall intonation style of the speech to be synthesized, and the reference speech is used to indicate the local intonation style of the speech to be synthesized.

[0117] It should be noted that the server converts the text information into speech in combination with the global indication information and the reference speech, thereby realizing speech synthesis. The text information is usually a sentence, including at least one character. Each character corresponds to at least one phoneme, and at least one phoneme corresponding to any character is used to indicate the pronunciation of the character.

[0118] Among them, the intonation style refers to the tone of speech expression, which is manifested as the change of pitch, lightness and heaviness of speech. The intonation style includes at least one aspect of speech expression style such as speech speed, pitch, volume, pause, stress and tone. The global indication information is used to indicate the intonation style of a sentence as a whole. For example, the overall intonation style includes at least one aspect of speech expression style such as the speech speed of the sentence, the pitch of the sentence and the pitch fluctuation of the sentence.

[0119] The reference speech can be divided into multiple speech frames, and the speech features of each speech frame can be used to more carefully express a tone of voice. The server can integrate the tone of each speech frame of the reference speech into the speech features corresponding to the phonemes of the text information through the speech synthesis model, so as to control the local tone of voice of the synthesized speech. Among them, the reference speech is used to represent a tone of voice. In the speech synthesis process, the reference speech does not need to be the speech representation of the text information. In addition, the reference speech can be divided into multiple speech frames according to the frame length, and the frame length can be flexibly configured. For example, the frame length can be configured to 10 milliseconds, 15 milliseconds or 30 milliseconds, etc., which is not limited in the embodiments of the present disclosure.

[0120] In step S202, the server inputs text information, global indication information and reference speech into a speech synthesis model.

[0121] The speech synthesis model is a trained model. The speech synthesis model is trained based on sample text information, sample global indication information, and sample reference speech corresponding to the sample text information, and has the function of inputting text information, global indication information, and reference speech, and outputting speech features corresponding to the text information.

[0122] In step S203, the server outputs the speech features corresponding to the text information through the speech synthesis model.

[0123] The speech feature is used to reflect the acoustic characteristics of the speech. Optionally, the speech feature is represented by an acoustic feature such as a Mel spectrum or a linear spectrum, or the speech feature can also be represented by other acoustic features, which is not limited in the embodiments of the present disclosure.

[0124] The server converts the text information into speech features that conform to the overall intonation style indicated by the global indication information and the local intonation style indicated by the reference speech through a speech synthesis model, combined with the global indication information and the reference speech. After the server obtains the speech features output by the speech synthesis model, it also converts the speech features into playable speech through a vocoder, and then realizes speech propagation through speech playback. Among them, the vocoder can be a Griffin-Lim (an algorithm based on spectrum reconstruction speech) vocoder or a WaveGlow (a network that relies on stream synthesis of high-quality speech) vocoder, etc., which is not limited in the embodiments of the present disclosure.

[0125] The technical solution provided by the embodiments of the present disclosure uses global indication information to indicate the overall intonation style of speech, and uses reference speech to indicate the local intonation style of speech. Through a speech synthesis model, the global indication information and the reference speech are integrated into the process of converting text information into speech features. On the one hand, the speech features finally obtained conform to the overall intonation style indicated by the global indication information. On the other hand, the local intonation style of the speech features is more finely controlled through the reference speech, thereby achieving flexible control of the intonation style, making the intonation style of the synthesized speech more diversified, thereby improving the usability of speech synthesis.

[0126] Figure 3 FIG. 1 is a flowchart of a method for training a speech synthesis model according to an exemplary embodiment. Figure 3 The training method of the speech synthesis model is applied to the server. The server trains the speech synthesis model through multiple iterations, wherein the training process of each iteration is the same. The embodiment of the present disclosure takes the training process of one iteration as an example to briefly describe the embodiment, which includes the following steps.

[0127] In step S301, the server obtains sample global indication information during any iteration process, where the sample global indication information is used to indicate the overall intonation style of the speech to be synthesized.

[0128] The sample global indication information is the global indication information used as the training sample in this iteration process.

[0129] In step S302, the server inputs sample text information, sample reference speech and sample global indication information into a speech synthesis model, wherein the sample reference speech is a speech representation of the sample text information and is used to indicate a local intonation style of the speech to be synthesized.

[0130] The sample text information is the text information used as the training sample in this iteration. The sample reference speech is the speech used as the training sample in this iteration, and is the speech representation of the sample text information. The sample reference speech is both a reference speech used to indicate the local intonation style of the speech to be synthesized and a standard for determining the accuracy of the synthesized speech and updating the model parameters of the speech synthesis model.

[0131] In step S303, the server outputs the speech features corresponding to the sample text information through the speech synthesis model.

[0132] The speech synthesis model is a model being trained. The server converts the sample text information into corresponding speech features by combining the sample global indication information and the sample reference speech through the speech synthesis model.

[0133] In step S304, the server updates the model parameters of the speech synthesis model based on the speech features output by the speech synthesis model and the speech features of the sample reference speech until the training stop condition is met, and outputs the trained speech synthesis model.

[0134] The server uses the speech representation of the sample text information as the sample reference speech to indicate the local intonation style of the speech to be synthesized corresponding to the sample text information. The speech synthesis model uses the intonation style of the sample reference speech as a reference to perform speech synthesis on the sample text information, and should output speech features that are as similar as possible to the speech features of the sample reference speech. The server compares the speech features output by the speech synthesis model with the speech features of the sample reference speech, and based on the comparison results, updates the model parameters of the speech synthesis model so that the updated speech synthesis model outputs speech features that are as similar as possible to the speech features of the sample reference speech.

[0135] Optionally, the condition for stopping training is that the number of iterations reaches the target number; or, the condition for stopping training is that in the process of n consecutive iterations, the similarity between the speech features output by the speech synthesis model and the speech features of the sample reference speech is greater than the similarity threshold. The embodiment of the present disclosure does not limit the condition for stopping training. Among them, the target number of times can be flexibly configured, for example, the target number of times is 50 times or 100 times. n is a positive integer, for example, n is 3, 5 or 10. The similarity threshold can be flexibly configured, for example, the similarity threshold is 80%, 90% or 95%.

[0136] The technical solution provided by the embodiment of the present disclosure uses global indication information to indicate the overall intonation style of the speech during the training process of the speech synthesis model, and uses the speech representation of the text information as the reference speech to indicate the local intonation style of the speech, so that the speech synthesis model refers to the intonation styles indicated by both the global indication information and the reference speech, converts the text information into corresponding speech features, and then updates the model parameters of the speech synthesis model based on the speech features output by the speech synthesis model and the speech features of the reference speech, so that the trained speech synthesis model can output speech features that meet the overall intonation style indicated by the global indication information and the local intonation style indicated by the reference speech, so that the trained speech synthesis model can achieve flexible control of the intonation style, make the intonation style of the synthesized speech more diversified, and improve the usability of speech synthesis.

[0137] It should be noted that the speech synthesis model in the embodiment of the present disclosure is an end-to-end learning model based on the encoder-decoder framework. Figure 4 The speech synthesis model includes a text encoding network, a speech encoding network, a global style representation network, a local style representation network, an attention network, and a decoding network. The speech encoding network is connected to the global style representation network and the local style representation network, respectively, the text encoding network is connected to the local style representation network and the attention network, respectively, the global style representation network and the local style representation network are connected to the attention network, and the attention network is connected to the decoding network. The text encoding network, the speech encoding network, the global style representation network, and the local style representation network together constitute the encoder part of the speech synthesis model, and the decoding network constitutes the decoder part of the speech synthesis model. The output of the encoder passes through the attention network as the input of the decoder.

[0138] Figure 5 FIG. 1 is a flow chart of a method for training a speech synthesis model according to an exemplary embodiment. Figure 4 and Figure 5 , based on the network structure inside the speech synthesis model, the training process of any iteration is described in detail, and the training method of the speech synthesis model includes the following steps.

[0139] In step S501, the server obtains sample global indication information during any iteration process, where the sample global indication information is used to indicate the overall intonation style of the speech to be synthesized.

[0140] Optionally, the sample global indication information includes at least one of a duration indication mean, a fundamental frequency indication mean, and a fundamental frequency indication variance. The duration indication mean is used to indicate the mean of the duration of multiple syllables in the speech features output by the speech synthesis model, the fundamental frequency indication mean is used to indicate the mean of multiple fundamental frequencies in the speech features output by the speech synthesis model, and the fundamental frequency indication variance is used to indicate the variance of multiple fundamental frequencies in the speech features output by the speech synthesis model.

[0141] Optionally, the server normalizes the duration indication mean, fundamental frequency indication mean and fundamental frequency indication variance to values ​​between -1 and 1. The closer the duration indication mean is to -1, the greater the mean duration of the indicated syllable is compared to the mean duration of the syllable at the beginning, and the slower the overall speaking speed is; the closer the duration indication mean is to 1, the smaller the mean duration of the syllable is compared to the mean duration of the syllable at the beginning, and the faster the overall speaking speed is; the duration indication mean is 0, which means that the mean duration of the syllable is unchanged compared to the mean duration of the syllable at the beginning. The closer the fundamental frequency indication mean is to -1, the smaller the fundamental frequency indicated mean is compared with the initial fundamental frequency mean, and the lower the overall tone is; the closer the fundamental frequency indication mean is to 1, the larger the fundamental frequency indicated mean is compared with the initial fundamental frequency mean, and the higher the overall tone is; the closer the fundamental frequency indication mean is to 0, the mean of the fundamental frequency indicated has not changed compared with the initial fundamental frequency mean. The closer the fundamental frequency indication variance is to -1, the smaller the fundamental frequency indicated variance is compared with the initial fundamental frequency variance, and the smoother the overall tone fluctuation is; the closer the fundamental frequency indication variance is to 1, the larger the fundamental frequency indicated variance is compared with the initial fundamental frequency variance, and the more drastic the overall tone fluctuation is; the closer the fundamental frequency indication variance is to 0, the variance of the fundamental frequency indicated has not changed compared with the initial fundamental frequency variance.

[0142] In an optional implementation, the server determines the sample global indication information based on the sample reference speech. The server determines the mean of the duration of multiple syllables in the sample reference speech as the mean duration indication; determines the mean of multiple fundamental frequencies in the sample reference speech as the mean fundamental frequency indication; determines the variance of multiple fundamental frequencies in the sample reference speech as the variance fundamental frequency indication.

[0143] In another optional implementation, the speech synthesis model corresponds to a duration mean range, which refers to a reasonable adjustment range of the duration of a syllable, and the server randomly obtains any value within the duration mean range as the duration indication mean. For example, the duration of a Chinese syllable is usually between 200 milliseconds and 600 milliseconds. If the duration of the syllable is too long or too short, it will affect the listening effect. Therefore, the duration mean range can be set to 200 milliseconds to 600 milliseconds.

[0144] The speech synthesis model corresponds to a fundamental frequency mean range, which refers to the reasonable adjustment range of the fundamental frequency mean. The server randomly obtains any value within the fundamental frequency mean range as the fundamental frequency indication mean. Among them, the fundamental frequency affects the pitch of the speech. Too high or too low a pitch will affect the listening effect. Therefore, the fundamental frequency value within the fundamental frequency mean range can be set within the human auditory comfort range.

[0145] The speech synthesis model corresponds to a fundamental frequency variance range, which refers to the reasonable adjustment range of the fundamental frequency variance. The server randomly obtains any value within the fundamental frequency variance range as the fundamental frequency indication variance. Among them, the fundamental frequency variance affects the fluctuation of the pitch of the speech. Too large or too small a pitch fluctuation will affect the listening effect. Therefore, the value within the fundamental frequency variance range can be set within the human auditory comfort range.

[0146] In step S502, the server inputs sample text information, sample reference speech and sample global indication information into a speech synthesis model, wherein the sample reference speech is a speech representation of the sample text information and is used to indicate a local intonation style of the speech to be synthesized.

[0147] The server inputs sample text information into the text encoding network of the speech synthesis model; inputs sample reference speech into the speech encoding network of the speech synthesis model; and inputs sample global indication information into the global style representation network of the speech synthesis model.

[0148] In step S503, the server determines a sample phoneme vector sequence corresponding to the sample text information through a text encoding network of a speech synthesis model.

[0149] Optionally, the text information includes a plurality of phonemes. If the speech synthesis model is used to perform speech synthesis on a text composed of phonetic characters, the text information includes a plurality of phonemes obtained by dividing the text composed of phonetic characters. If the speech synthesis model is used to perform speech synthesis on a text composed of ideographic characters, the text information includes a plurality of phonemes obtained by dividing the phonetic characters corresponding to the text composed of ideographic characters. Among them, the phonetic characters are obtained by converting the text composed of ideographic characters according to linguistic rules. Optionally, if the text composed of ideographic characters is Chinese, the phonetic characters also include at least one of tone marks, erhua sound marks and other language marks. Among them, the tone marks are used to indicate the rise and fall of the sound, and the tone marks mainly include yinping, yangping, shangsheng, qusheng and light tone. For example, if yinping is represented as 1, yangping is represented as 2, shangsheng is represented as 3, qusheng is represented as 4, and light tone is represented as 5, then the phonetic characters corresponding to the text "we" are represented as "wo3men5".

[0150] Alternatively, in order to facilitate model understanding and learning, the text information may also include initial vectors of multiple phonemes. The initial vector of a phoneme is a feature representation of a single phoneme. For example, a speech synthesis model corresponds to a phoneme table, which includes all the phonemes involved in speech synthesis. The initial vector of a phoneme can be represented based on the position of the phoneme in the phoneme table. Assuming that there are 118 phonemes in the phoneme table, the initial vector of the phoneme can be represented as a 118-dimensional vector. If a phoneme is in the 20th position in the phoneme table, the 20th position of the initial vector of the phoneme is 1, and the other positions are all 0.

[0151] The phoneme vector sequence is obtained by encoding the text information through a text encoding network. The server encodes each phoneme in the text information in turn through the text encoding network to obtain the vector of each phoneme, and the vectors of multiple phonemes form a phoneme vector sequence. In the process of encoding a phoneme vector at any time, the server encodes the vector of the phoneme obtained by the previous encoding and the vector of the phoneme to be encoded this time through the text encoding network to obtain the vector of the phoneme to be encoded this time. Through the above encoding method, the vector of each phoneme in the phoneme vector sequence integrates the semantic information of the phoneme and the multiple phonemes before the phoneme. Speech synthesis is performed based on the vector integrated with semantic information, which can improve the accuracy of speech synthesis.

[0152] Optionally, the text encoding network is a network structure with recursive function such as an RNN (Recurrent Neural Network) structure or an LSTM (Long Short-Term Memory) structure. The present disclosure does not limit the network structure of the text encoding network.

[0153] In step S504, the server determines a sample reference speech vector sequence corresponding to the sample reference speech through a speech coding network of a speech synthesis model.

[0154] Wherein, the reference speech includes multiple speech frames, and the reference speech vector sequence includes vectors of multiple speech frames. The server encodes the multiple speech frames of the reference speech in sequence through the speech coding network to obtain the vector of each speech frame, and the vectors of the above multiple speech frames constitute the reference speech vector sequence. In the process of encoding a vector of a speech frame of the reference speech at any time, the server encodes the vector of the speech frame obtained by the previous encoding and the speech features of the speech frame to be encoded this time through the speech coding network to obtain the vector of the speech frame to be encoded this time. Through the above encoding method, the vector of each speech frame in the reference speech vector sequence integrates the semantic information of the speech frame and the multiple speech frames before the speech frame, and speech synthesis is performed based on the vector integrated with semantic information, which can improve the accuracy of speech synthesis.

[0155] Optionally, the speech coding network is a network structure with recursive function such as an RNN (Recurrent Neural Network) structure or an LSTM (Long Short-Term Memory) structure. The present disclosure does not limit the network structure of the speech coding network.

[0156] It should be noted that in the embodiments of the present disclosure, the order of determining the phoneme vector sequence and determining the reference voice vector sequence is described by first determining the phoneme vector sequence and then determining the reference voice vector sequence. In some possible embodiments, the steps of determining the phoneme vector sequence and determining the reference voice vector sequence can also be performed in other time sequences. For example, the phoneme vector sequence and the reference voice vector sequence are determined at the same time; or, the reference voice vector sequence is determined first, and then the phoneme vector sequence is determined. The embodiments of the present disclosure are not limited to this.

[0157] In step S505, the server determines a global style embedding vector through a global style representation network of a speech synthesis model based on the sample global indication information and the sample reference speech vector sequence.

[0158] During the training process of the speech synthesis model, the sample reference speech vector sequence output by the speech coding network is used as the input of the global style representation network to determine the global style embedding vector. The server converts the sample global indication information into the sample global style vector through the global style representation network; based on the sample global style vector and the vector of the last speech frame in the sample reference speech vector sequence, the global style embedding vector is determined to control the overall intonation style of the speech feature to be synthesized through the global style embedding vector. Among them, the vector of the last speech frame integrates the speech features of multiple speech frames of the sample reference speech, which is a representation of the global intonation style of the sample reference speech.

[0159] The above technical solution obtains the vector of the last speech frame in the sample reference speech vector sequence, and determines the global style embedding vector based on the vector of the last speech frame and the sample global style vector corresponding to the sample global indication information, so that the global intonation style of the sample reference speech affects the value of the global style embedding vector, and the global intonation style of the sample reference speech is integrated into the global style embedding vector, thereby enhancing the diversity of the global style embedding vector used to indicate the overall intonation style, so that a stable speech synthesis model can be trained based on fewer training samples, thereby reducing the training cost of the model.

[0160] Among them, the step of determining the global style embedding vector based on the sample global style vector and the vector of the last speech frame in the sample reference speech vector sequence includes: the server resamples through the global style representation network based on a Gaussian distribution with each value in the sample global style vector as the mean and each value in the vector of the last speech frame as the variance to obtain each value in the global style embedding vector.

[0161] The above technical solution constructs a Gaussian distribution with each value in the sample global style vector as the mean and each value in the vector of the last speech frame as the variance, and resampling is performed based on the Gaussian distribution. There is a certain probability of sampling other values ​​​​in addition to the values ​​​​in the sample global style vector, thereby increasing the diversity of the values ​​​​of the global style embedding vector, and providing richer indications of the overall intonation style of the synthesized speech. Therefore, based on fewer training samples, a stable speech synthesis model can be trained, thereby reducing the training cost of the model.

[0162] In step S506, the server determines a sample local adjustment vector sequence based on the sample phoneme vector sequence and the sample reference speech vector sequence through a local style representation network of the speech synthesis model.

[0163] During the training process of the speech synthesis model, the sample phoneme vector sequence output by the text encoding network is used as the input of the local style representation network, and the sample reference speech vector sequence output by the speech encoding network is used as the input of the local style representation network to determine the sample local adjustment vector sequence.

[0164] The server uses a local style representation network and, according to an attention mechanism, determines the probability that each of the multiple speech frames of the sample reference speech corresponds to each of the multiple phonemes of the sample text information based on the sample phoneme vector sequence and the sample reference speech vector sequence; determines the sample local adjustment vector sequence based on the probability that each speech frame corresponds to each phoneme and the sample reference speech vector sequence, wherein the sequence length of the sample local adjustment vector sequence is equal to the sequence length of the sample phoneme vector sequence, and the sample local adjustment vector sequence is used to represent the influence of the intonation style of each speech frame of the sample reference speech on the speech features corresponding to each phoneme of the sample text information.

[0165] For example, the sequence length of the sample phoneme vector sequence is m 1 , the vector dimension is n; the sequence length of the sample reference speech vector sequence is m 2 , the vector dimension is n, the server determines the probability that each speech frame in the multiple speech frames of the sample reference speech corresponds to each phoneme in the multiple phonemes of the sample text information, and obtains m 1 ×m 2 probability, which can be expressed as m1 Line m 2 The server represents the sample reference speech vector sequence as m 2 The matrix of rows and columns is m 1 Line m 2 The matrix of columns and m 2 The matrix of rows and columns is multiplied to obtain the sample local adjustment vector sequence, which can be expressed as m 1 A matrix with n rows and n columns.

[0166] The above technical scheme determines the probability that each speech frame of the reference speech corresponds to each phoneme of the text information according to the attention mechanism, and uses the obtained probability to indicate the degree of influence of each speech frame of the reference speech on the intonation style corresponding to each phoneme of the text information. The greater the probability that any speech frame corresponds to any phoneme, the greater the influence of the intonation style of the speech frame on the phoneme. Based on the obtained probability and the reference speech vector sequence, a local adjustment vector sequence is determined, so that the local adjustment vector sequence can represent the influence of the intonation style of the reference speech on the speech features corresponding to each phoneme of the text information according to the corresponding degree of influence. Based on the local adjustment vector sequence, the local intonation style of the reference speech can be correspondingly integrated into the speech features corresponding to the text information, thereby realizing flexible control of the intonation style of the synthesized speech and improving the availability of the speech synthesis model.

[0167] In addition, the above technical solution, based on the attention mechanism, represents the influence of the intonation style of the reference speech on the speech features corresponding to each phoneme of the text information. There is no need to mark the one-to-one correspondence between the speech frames of the reference speech and the phonemes of the text information during the training process. On the basis of ensuring the availability of the model, it does not rely on manual data annotation, thus reducing the cost of manual annotation, reducing the difficulty of producing the corpus based on which the training is based, and improving the efficiency of corpus production.

[0168] It should be noted that in the embodiment of the present disclosure, the order of determining the global style embedding vector and determining the local adjustment vector sequence is described by first determining the global style embedding vector and then determining the local adjustment vector sequence. In some possible embodiments, the above steps of determining the global style embedding vector and determining the local adjustment vector sequence can also be performed in other time sequences. For example, the global style embedding vector and the local adjustment vector sequence are determined at the same time; or, the local adjustment vector sequence is determined first, and then the global style embedding vector is determined. The embodiment of the present disclosure does not limit this.

[0169] In step S507, in any process of determining the speech feature corresponding to a phoneme, the server determines the sample intermediate vector based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence through the attention network of the speech synthesis model.

[0170] Optionally, during the training process of the speech synthesis model, the sample phoneme vector sequence output by the text encoding network, the global style embedding vector output by the global style representation network, and the sample local adjustment vector sequence output by the local style representation network are used as inputs of the attention network; or, the sample phoneme vector sequence, the global style embedding vector, and the sample local adjustment vector sequence are concatenated, and the concatenated vector is used as input of the attention network to determine the sample intermediate vector. The sample phoneme vector sequence and the sample local adjustment vector sequence have the same sequence length, and optionally, the vector of each phoneme in the sample phoneme vector sequence is concatenated with the vector in the local adjustment vector sequence with the same sequence position as the phoneme, and then concatenated with the global style embedding vector to obtain the vector corresponding to the phoneme.

[0171] The above-mentioned step of determining the sample intermediate vector based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence includes: determining the attention weights corresponding to multiple phonemes of the sample text information based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence; based on the attention weights corresponding to the multiple phonemes, performing weighted summation on the vectors corresponding to the multiple phonemes to obtain the sample intermediate vector.

[0172] The above technical solution determines the attention weights corresponding to multiple phonemes of text information according to the attention mechanism, and then performs weighted summation on the vectors corresponding to the multiple phonemes based on the attention weights to obtain an intermediate vector, so that the intermediate vector weights the vectors corresponding to the multiple phonemes together according to the degree of attention to different phonemes. Compared with directly using the vector corresponding to the last phoneme as the intermediate vector, it reduces information loss and enhances the accuracy of vector expression. Furthermore, based on the more accurate intermediate vector, more accurate speech features can be obtained, thereby improving the accuracy of speech synthesis.

[0173] In step S508, in any process of determining the speech feature corresponding to a phoneme, the server determines the speech feature corresponding to a phoneme through the decoding network of the speech synthesis model based on the sample intermediate vector output by the attention network.

[0174] The server determines the speech feature corresponding to a phoneme through the decoding network based on the sample intermediate vector output by the attention network each time, until the speech features corresponding to multiple phonemes of the text information are obtained, and the speech features corresponding to multiple phonemes are composed of the speech features corresponding to the text information.

[0175] The above technical solution converts text information and reference speech into a phoneme vector sequence and a reference speech vector sequence through an encoding network, takes the reference speech vector sequence and the global indication information as the input of the global style representation network, determines the global style embedding vector, makes the global intonation style of the reference speech affect the value of the global style embedding vector, integrates the global intonation style of the reference speech into the global style embedding vector, enhances the diversity of the global style embedding vector used to indicate the overall intonation style, and thus can train a stable speech synthesis model based on fewer training samples, reduce the training cost of the model, and integrate the phoneme vector sequence and the reference speech into the global style embedding vector. The quantity sequence is used as the input of the local style representation network to determine the local adjustment vector sequence, which is used to represent the influence of the intonation style of each speech frame of the reference speech on the speech features corresponding to each phoneme of the text information. Then, through the attention network, based on the phoneme vector sequence, the global style embedding vector and the local adjustment vector sequence, the intermediate vector is determined. On the basis of realizing flexible control of the overall intonation style and local intonation style of the speech features, the information loss is further reduced, and the accuracy of the intermediate vector representation is improved. Then, based on the more accurate intermediate vector, a more accurate speech feature is obtained, thereby improving the accuracy of speech synthesis.

[0176] In step S509, the server updates the model parameters of the speech synthesis model based on the speech features output by the decoding network and the speech features of the sample reference speech until the training stop condition is met, and outputs the trained speech synthesis model.

[0177] The server compares the speech features output by the speech synthesis model with the speech features of the sample reference speech, and based on the comparison results, updates the model parameters of each network in the speech synthesis model. If the updated speech synthesis model meets the stop training conditions, the speech synthesis model training is completed and the trained speech synthesis model is output; if the updated speech synthesis model does not meet the stop training conditions, the next iteration process continues until the stop training conditions are met.

[0178] The technical solution provided by the embodiment of the present disclosure uses global indication information to indicate the overall intonation style of the speech during the training process of the speech synthesis model, and uses the speech representation of the text information as the reference speech to indicate the local intonation style of the speech, so that the speech synthesis model refers to the intonation styles indicated by both the global indication information and the reference speech, converts the text information into corresponding speech features, and then updates the model parameters of the speech synthesis model based on the speech features output by the speech synthesis model and the speech features of the reference speech, so that the trained speech synthesis model can output speech features that meet the overall intonation style indicated by the global indication information and the local intonation style indicated by the reference speech, so that the trained speech synthesis model can achieve flexible control of the intonation style, make the intonation style of the synthesized speech more diversified, and improve the usability of speech synthesis.

[0179] After the speech synthesis model is trained, the server can use the trained speech synthesis model to perform speech synthesis. Figure 6 The content structure of the speech synthesis model involved in the process of applying the speech synthesis model for speech synthesis is shown in Figure 6 The speech synthesis model includes a text encoding network, a speech encoding network, a global style representation network, a local style representation network, an attention network, and a decoding network. The speech encoding network is connected to the local style representation network, the text encoding network is connected to the local style representation network and the attention network, the global style representation network and the local style representation network are connected to the attention network, and the attention network is connected to the decoding network.

[0180] Figure 7 is a flow chart of a speech synthesis method according to an exemplary embodiment. Figure 6 and Figure 7 Based on the network structure inside the speech synthesis model, a detailed description is given by taking the server performing speech synthesis through the speech synthesis model as an example. The speech synthesis method includes the following steps.

[0181] In step S701, the server obtains global indication information and reference speech, wherein the global indication information is used to indicate the overall intonation style of the speech to be synthesized, and the reference speech is used to indicate the local intonation style of the speech to be synthesized.

[0182] Optionally, the global indication information includes at least one of the duration indication mean of the syllables of the speech feature corresponding to the text information, the fundamental frequency indication mean of the above-mentioned speech feature, and the fundamental frequency indication variance of the above-mentioned speech feature. The duration indication mean can be used to control the mean of the duration of the syllables of the speech feature, thereby realizing the control of the overall speech speed of the sentence; the fundamental frequency indication mean can be used to control the mean of the fundamental frequency of the speech feature, thereby realizing the control of the overall pitch of the sentence; the fundamental frequency indication variance can be used to control the variance of the fundamental frequency of the speech feature, thereby realizing the control of the degree of change of the pitch fluctuation of the sentence as a whole. By using the duration indication mean, the fundamental frequency indication mean, and the fundamental frequency indication variance, the overall intonation style of the sentence can be controlled from aspects such as speech speed, pitch, and pitch fluctuation, so that the intonation style of the synthesized speech can be more diversified, thereby improving the usability of speech synthesis.

[0183] In an optional implementation, the server supports the user to configure the global indication information and the reference voice according to the speech synthesis requirements. The user can configure the global indication information and the reference voice through the configuration terminal; the configuration terminal sends the global indication information and the reference voice configured by the user to the server; the server obtains the global indication information and the reference voice by receiving the global indication information and the reference voice sent by the configuration terminal.

[0184] In another optional implementation, the server stores the correspondence between the sentence type, the global indication information, and the reference speech, and the server obtains the global indication information and the reference speech corresponding to the sentence type based on the sentence type to which the text information belongs. For example, the sentence types include declarative sentences, exclamatory sentences, and interrogative sentences, and the server can determine the sentence type to which the text information belongs based on the punctuation marks included in the text information, and obtain the global indication information corresponding to the sentence type.

[0185] In another optional implementation, the server obtains global indication information and reference speech matching the user portrait based on the user portrait for which the speech synthesis is directed. For example, if the user portrait indicates that the user prefers to listen to information quickly, the speech speed can be increased by adjusting the global indication information; for another example, if the user portrait indicates that the user prefers to listen to key information quickly, a reference speech with a clear intonation style and emphasis on key points can be obtained.

[0186] In another optional implementation, the server supports the user to indicate the intonation style through voice instructions. The user issues a voice instruction to an electronic device, such as a smart speaker or a robot; the electronic device sends the voice instruction to the server; the server performs voice recognition on the voice instruction to determine the instruction text; based on the instruction text, the server obtains the global instruction information and the reference voice. For example, if the voice instruction is to increase the speaking speed, the server increases the speaking speed by adjusting the global instruction information; for another example, if the voice instruction is to read aloud slowly, the server can obtain the reference voice with the intonation style of reading aloud slowly.

[0187] In step S702, the server determines the phoneme vector sequence corresponding to the text information through a text encoding network.

[0188] The process of the server determining the phoneme vector sequence during the speech synthesis process is the same as the process of determining the phoneme vector sequence during the training process of the speech synthesis model, that is, step S702 is the same as step S503, and will not be repeated here.

[0189] In step S703, the server determines a reference speech vector sequence corresponding to the reference speech through a speech coding network.

[0190] The process of the server determining the reference speech vector sequence during the speech synthesis process is the same as the process of determining the reference speech vector sequence during the training process of the speech synthesis model, that is, step S703 is the same as step S504, and will not be repeated here.

[0191] In step S704, the server converts the global indication information into a global style vector through a global style representation network.

[0192] The server converts the global indication information into a vector form through a global style representation network, so that the server can integrate the overall intonation style indicated by the global indication information into the synthesized speech features based on the global style vector.

[0193] In step S705, the server determines a local adjustment vector sequence based on the reference speech vector sequence and the phoneme vector sequence through a local style representation network. The local adjustment vector sequence is used to represent the influence of the intonation style of each speech frame of the reference speech on the speech features corresponding to each phoneme of the text information.

[0194] The process of the server determining the local adjustment vector sequence during the speech synthesis process is the same as the process of determining the local adjustment vector sequence during the training process of the speech synthesis model, that is, step S705 is the same as step S506, which will not be repeated here.

[0195] In step S706, during any process of determining the speech feature corresponding to a phoneme, the server determines an intermediate vector based on the phoneme vector sequence, the global style vector, and the local adjustment vector sequence through the attention network.

[0196] The process of the server determining the intermediate vector during the speech synthesis process is the same as the process of determining the intermediate vector during the training process of the speech synthesis model, that is, step S706 is the same as step S507, and will not be repeated here.

[0197] In step S707, the server determines the speech feature corresponding to a phoneme based on the intermediate vector through the decoding network.

[0198] The server determines the speech feature corresponding to a phoneme through the decoding network based on the intermediate vector output by the attention network each time, until the speech features corresponding to multiple phonemes of the text information are obtained, and the speech features corresponding to multiple phonemes are used to form the speech features corresponding to the text information.

[0199] The above technical solution converts global indication information into a global style vector, uses the global style vector to indicate the overall intonation style, converts text information and reference speech into a phoneme vector sequence and a reference speech vector sequence through an encoding network, uses the phoneme vector sequence and the reference speech vector sequence as inputs to a local style representation network, determines a local adjustment vector sequence, uses the local adjustment vector sequence to represent the influence of the intonation style of each speech frame of the reference speech on the speech features corresponding to each phoneme of the text information, and then determines an intermediate vector based on the phoneme vector sequence, the global style vector and the local adjustment vector sequence through an attention network. On the basis of realizing flexible control over the overall intonation style and local intonation style of speech features, information loss is further reduced, and the accuracy of the intermediate vector representation is improved. Then, based on the intermediate vector with higher accuracy, speech features with higher accuracy are obtained, thereby improving the accuracy of speech synthesis.

[0200] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.

[0201] Figure 8 is a block diagram of a speech synthesis device according to an exemplary embodiment. Figure 8 The device includes a first information acquisition module 801, a first information input module 802 and a first speech synthesis module 803.

[0202] The first information acquisition module 801 is configured to acquire global indication information and reference speech, wherein the global indication information is used to indicate the overall intonation style of the speech to be synthesized, and the reference speech is used to indicate the local intonation style of the speech to be synthesized;

[0203] The first information input module 802 is configured to input text information, global indication information and reference speech into the speech synthesis model;

[0204] The first speech synthesis module 803 is configured to execute the speech synthesis model to output the speech features corresponding to the text information;

[0205] The speech synthesis model is trained based on sample text information, sample global indication information and sample reference speech corresponding to the sample text information.

[0206] The technical solution provided by the embodiments of the present disclosure uses global indication information to indicate the overall intonation style of speech, and uses reference speech to indicate the local intonation style of speech. Through a speech synthesis model, the global indication information and the reference speech are integrated into the process of converting text information into speech features. On the one hand, the speech features finally obtained conform to the overall intonation style indicated by the global indication information. On the other hand, the local intonation style of the speech features is more finely controlled through the reference speech, thereby achieving flexible control of the intonation style, making the intonation style of the synthesized speech more diversified, thereby improving the usability of speech synthesis.

[0207] In an optional implementation, the speech synthesis model includes a text encoding network, a speech encoding network, a global style representation network, a local style representation network, an attention network and a decoding network, wherein the speech encoding network is connected to the local style representation network, the text encoding network is connected to the local style representation network and the attention network respectively, the global style representation network and the local style representation network are connected to the attention network respectively, and the attention network is connected to the decoding network;

[0208] The first speech synthesis module 803 is configured to execute:

[0209] Determine the phoneme vector sequence corresponding to the text information through the text encoding network; determine the reference speech vector sequence corresponding to the reference speech through the speech encoding network;

[0210] The global indication information is converted into a global style vector through a global style representation network;

[0211] Determine a local adjustment vector sequence based on a reference speech vector sequence and a phoneme vector sequence through a local style representation network, wherein the local adjustment vector sequence is used to represent the influence of the intonation style of each speech frame of the reference speech on the speech feature corresponding to each phoneme of the text information;

[0212] In any process of determining the speech feature corresponding to a phoneme, an intermediate vector is determined through the attention network based on the phoneme vector sequence, the global style vector and the local adjustment vector sequence; and a speech feature corresponding to a phoneme is determined based on the intermediate vector through the decoding network.

[0213] In another optional implementation, the global indication information includes at least one of a mean value of a duration indication of a syllable of the speech feature, a mean value of a fundamental frequency indication of the speech feature, and a variance of a fundamental frequency indication of the speech feature.

[0214] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0215] Fig. 9 FIG. 1 is a block diagram of a training device for a speech synthesis model according to an exemplary embodiment. Fig. 9 The device includes a second information acquisition module 901, a second information input module 902, a second speech synthesis module 903 and a model parameter updating module 904.

[0216] The second information acquisition module 901 is configured to acquire sample global indication information during any iteration, where the sample global indication information is used to indicate the overall intonation style of the speech to be synthesized;

[0217] The second information input module 902 is configured to input sample text information, sample reference speech and sample global indication information into the speech synthesis model, wherein the sample reference speech is a speech representation of the sample text information, which is used to indicate a local intonation style of the speech to be synthesized;

[0218] The second speech synthesis module 903 is configured to execute the speech synthesis model to output the speech features corresponding to the sample text information;

[0219] The model parameter updating module 904 is configured to update the model parameters of the speech synthesis model based on the speech features output by the speech synthesis model and the speech features of the sample reference speech until the training stop condition is met, and output the trained speech synthesis model.

[0220] The technical solution provided by the embodiment of the present disclosure uses global indication information to indicate the overall intonation style of the speech during the training process of the speech synthesis model, and uses the speech representation of the text information as the reference speech to indicate the local intonation style of the speech, so that the speech synthesis model refers to the intonation styles indicated by both the global indication information and the reference speech, converts the text information into corresponding speech features, and then updates the model parameters of the speech synthesis model based on the speech features output by the speech synthesis model and the speech features of the reference speech, so that the trained speech synthesis model can output speech features that meet the overall intonation style indicated by the global indication information and the local intonation style indicated by the reference speech, so that the trained speech synthesis model can achieve flexible control of the intonation style, make the intonation style of the synthesized speech more diversified, and improve the usability of speech synthesis.

[0221] In an optional implementation, the speech synthesis model includes a text encoding network, a speech encoding network, a global style representation network, a local style representation network, an attention network and a decoding network, wherein the speech encoding network is connected to the global style representation network and the local style representation network respectively, the text encoding network is connected to the local style representation network and the attention network respectively, the global style representation network and the local style representation network are connected to the attention network respectively, and the attention network is connected to the decoding network;

[0222] The second speech synthesis module 903 includes:

[0223] A text encoding unit, configured to determine a sample phoneme vector sequence corresponding to the sample text information through a text encoding network;

[0224] A speech coding unit, configured to determine a sample reference speech vector sequence corresponding to the sample reference speech through a speech coding network;

[0225] A global style representation unit is configured to determine a global style embedding vector based on sample global indication information and a sample reference speech vector sequence through a global style representation network;

[0226] A local style representation unit is configured to determine a sample local adjustment vector sequence based on a sample phoneme vector sequence and a sample reference speech vector sequence through a local style representation network, wherein the sample local adjustment vector sequence is used to represent the influence of the intonation style of each speech frame of the sample reference speech on the speech feature corresponding to each phoneme of the sample text information;

[0227] The intermediate vector representation unit is configured to determine the sample intermediate vector based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence through the attention network in any process of determining the speech feature corresponding to a phoneme;

[0228] The decoding unit is configured to determine the speech feature corresponding to a phoneme based on the sample intermediate vector through a decoding network.

[0229] In another optional implementation, the speech encoding unit is configured to perform encoding based on the vector of the speech frame obtained by the previous encoding and the speech features of the speech frame to be encoded this time through the speech encoding network in the process of obtaining the vector of a speech frame of the sample reference speech at any time, so as to obtain the vector of the speech frame to be encoded this time;

[0230] Global style representation unit, including:

[0231] A global style vector determination subunit is configured to convert the sample global indication information into a sample global style vector through a global style representation network;

[0232] The global style embedding vector determination subunit is configured to determine the global style embedding vector based on the sample global style vector and the vector of the last speech frame in the sample reference speech vector sequence, wherein the vector of the last speech frame integrates the speech features of multiple speech frames of the sample reference speech.

[0233] In another optional implementation, the global style embedding vector determination subunit is configured to perform resampling based on a Gaussian distribution with each value in the sample global style vector as the mean and each value in the vector of the last speech frame as the variance, to obtain each value in the global style embedding vector.

[0234] In another optional implementation, the local style representation unit is configured to perform:

[0235] Determine, by means of a local style representation network, the probability that each of the multiple speech frames of the sample reference speech corresponds to each of the multiple phonemes of the sample text information, based on the sample phoneme vector sequence and the sample reference speech vector sequence according to the attention mechanism;

[0236] Based on the probability that each speech frame corresponds to each phoneme and the sample reference speech vector sequence, a sample local adjustment vector sequence is determined, wherein the sequence length of the sample local adjustment vector sequence is equal to the sequence length of the sample phoneme vector sequence.

[0237] In another optional implementation, the intermediate vector representation unit is configured to execute:

[0238] In any process of determining the speech feature corresponding to a phoneme, the attention weights corresponding to multiple phonemes of the sample text information are determined based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence through the attention network;

[0239] Based on the attention weights corresponding to multiple phonemes, the vectors corresponding to multiple phonemes are weighted summed to obtain the sample intermediate vector.

[0240] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0241] Fig.10 1 is a block diagram of an electronic device according to an exemplary embodiment. The electronic device 1000 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart TV, a smart robot, or a children's story machine. The electronic device 1000 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal, or other names.

[0242] Typically, the electronic device 1000 includes a processor 1001 and a memory 1002 .

[0243] The processor 1001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1001 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1001 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1001 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1001 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0244] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1002 is used to store at least one instruction, which is used to be executed by the processor 1001 to implement the speech synthesis method provided in the method embodiment of the present disclosure.

[0245] In some embodiments, the electronic device 1000 may further optionally include: a peripheral device interface 1003 and at least one peripheral device. The processor 1001, the memory 1002 and the peripheral device interface 1003 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1003 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1004, a display screen 1005, a camera assembly 1006, an audio circuit 1007, a positioning assembly 1008 and a power supply 1009.

[0246] The peripheral device interface 1003 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1001 and the memory 1002. In some embodiments, the processor 1001, the memory 1002, and the peripheral device interface 1003 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1001, the memory 1002, and the peripheral device interface 1003 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0247] The radio frequency circuit 1004 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1004 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1004 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1004 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 1004 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1004 may also include circuits related to NFC (Near Field Communication), which is not limited in the present disclosure.

[0248] The display screen 1005 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1005 is a touch display screen, the display screen 1005 also has the ability to collect touch signals on the surface or above the surface of the display screen 1005. The touch signal can be input to the processor 1001 as a control signal for processing. At this time, the display screen 1005 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 1005 can be one, arranged on the front panel of the electronic device 1000; in other embodiments, the display screen 1005 can be at least two, respectively arranged on different surfaces of the electronic device 1000 or in a folding design; in other embodiments, the display screen 1005 can be a flexible display screen, arranged on a curved surface or a folding surface of the electronic device 1000. Even, the display screen 1005 can also be arranged as a non-rectangular irregular figure, that is, a special-shaped screen. The display screen 1005 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0249] The camera assembly 1006 is used to capture images or videos. Optionally, the camera assembly 1006 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the electronic device 1000, and the rear camera is arranged on the back of the electronic device 1000. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1006 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0250] The audio circuit 1007 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1001 for processing, or input them into the radio frequency circuit 1004 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the electronic device 1000. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 1001 or the radio frequency circuit 1004 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 1007 may also include a headphone jack.

[0251] The positioning component 1008 is used to locate the current geographic location of the electronic device 1000 to implement navigation or LBS (Location Based Service). The positioning component 1008 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system or Russia's Galileo system.

[0252] The power supply 1009 is used to power various components in the electronic device 1000. The power supply 1009 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1009 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0253] In some embodiments, the electronic device 1000 further includes one or more sensors 1010 , including but not limited to: an acceleration sensor 1011 , a gyroscope sensor 1012 , a pressure sensor 1013 , a fingerprint sensor 1014 , an optical sensor 1015 , and a proximity sensor 1016 .

[0254] Those skilled in the art will understand that Fig.10 The structure shown in the figure does not constitute a limitation on the electronic device 1000, and the electronic device 1000 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.

[0255] Fig.11 It is a block diagram of a server according to an exemplary embodiment. The server 1100 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1101 and one or more memories 1102, wherein the memory 1102 is used to store executable instructions, and the processor 1101 is configured to execute the above executable instructions to implement the speech synthesis method or speech synthesis model training method provided by the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server may also include other components for implementing device functions, which will not be repeated here.

[0256] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1102 including instructions, and the instructions can be executed by the processor 1101 of the server 1100 to complete the above-mentioned speech synthesis method or speech synthesis model training method. Optionally, the computer-readable storage medium can be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0257] In an exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program / instruction. When the computer program / instruction is executed by a processor, the speech synthesis method in each of the above method embodiments is implemented.

[0258] In an exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program / instructions. When the computer program / instructions are executed by a processor, the training method of the speech synthesis model in the above-mentioned various method embodiments is implemented.

[0259] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0260] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A speech synthesis method, characterized in that: The speech synthesis method comprises: Acquire global indication information and reference speech, wherein the global indication information is used to indicate the overall intonation style of the speech to be synthesized, and the reference speech is used to indicate the local intonation style of the speech to be synthesized, and the global indication information includes at least one of a duration indication mean of a syllable of a speech feature corresponding to the text information, a fundamental frequency indication mean of the speech feature, and a fundamental frequency indication variance of the speech feature; Inputting the text information, the global indication information and the reference speech into a speech synthesis model; Outputting speech features corresponding to the text information through the speech synthesis model; The speech synthesis model is trained based on sample text information, sample global indication information and sample reference speech corresponding to the sample text information.

2. The speech synthesis method according to claim 1, characterized in that: The speech synthesis model includes a text encoding network, a speech encoding network, a global style representation network, a local style representation network, an attention network and a decoding network, wherein the speech encoding network is connected to the local style representation network, the text encoding network is connected to the local style representation network and the attention network respectively, the global style representation network and the local style representation network are connected to the attention network respectively, and the attention network is connected to the decoding network; The step of outputting the speech features corresponding to the text information through the speech synthesis model includes: Determine the phoneme vector sequence corresponding to the text information through the text encoding network; determine the reference speech vector sequence corresponding to the reference speech through the speech encoding network; Converting the global indication information into a global style vector through the global style representation network; Determine, by the local style representation network, a local adjustment vector sequence based on the reference speech vector sequence and the phoneme vector sequence, wherein the local adjustment vector sequence is used to represent the influence of the intonation style of each speech frame of the reference speech on the speech feature corresponding to each phoneme of the text information; In any process of determining the speech feature corresponding to a phoneme, an intermediate vector is determined through the attention network based on the phoneme vector sequence, the global style vector and the local adjustment vector sequence; and a speech feature corresponding to a phoneme is determined through the decoding network based on the intermediate vector.

3. A method for training a speech synthesis model, characterized in that: The training method of the speech synthesis model includes: In any iteration process, sample global indication information is obtained, the sample global indication information is used to indicate the overall intonation style of the speech to be synthesized, and the sample global indication information includes at least one of a duration indication mean, a fundamental frequency indication mean, and a fundamental frequency indication variance, the duration indication mean is used to indicate the mean of the duration of multiple syllables in the speech features output by the speech synthesis model, the fundamental frequency indication mean is used to indicate the mean of multiple fundamental frequencies in the speech features output by the speech synthesis model, and the fundamental frequency indication variance is used to indicate the variance of multiple fundamental frequencies in the speech features output by the speech synthesis model; Inputting sample text information, sample reference speech and the sample global indication information into the speech synthesis model, wherein the sample reference speech is a speech representation of the sample text information and is used to indicate a local intonation style of the speech to be synthesized; Outputting speech features corresponding to the sample text information through the speech synthesis model; Based on the speech features output by the speech synthesis model and the speech features of the sample reference speech, the model parameters of the speech synthesis model are updated until the training stop condition is met, and the trained speech synthesis model is output.

4. The method for training a speech synthesis model according to claim 3, characterized in that: The speech synthesis model includes a text encoding network, a speech encoding network, a global style representation network, a local style representation network, an attention network and a decoding network, wherein the speech encoding network is connected to the global style representation network and the local style representation network respectively, the text encoding network is connected to the local style representation network and the attention network respectively, the global style representation network and the local style representation network are connected to the attention network respectively, and the attention network is connected to the decoding network; The step of outputting speech features corresponding to the sample text information through the speech synthesis model includes: Determine a sample phoneme vector sequence corresponding to the sample text information through the text encoding network; determine a sample reference speech vector sequence corresponding to the sample reference speech through the speech encoding network; Determining a global style embedding vector based on the sample global indication information and the sample reference speech vector sequence through the global style representation network; Determine, by the local style representation network, a sample local adjustment vector sequence based on the sample phoneme vector sequence and the sample reference speech vector sequence, wherein the sample local adjustment vector sequence is used to represent the influence of the intonation style of each speech frame of the sample reference speech on the speech feature corresponding to each phoneme of the sample text information; In any process of determining the speech feature corresponding to a phoneme, the sample intermediate vector is determined through the attention network based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence; and the speech feature corresponding to a phoneme is determined through the decoding network based on the sample intermediate vector.

5. The method for training a speech synthesis model according to claim 4, characterized in that: The determining, by the speech coding network, a sample reference speech vector sequence corresponding to the sample reference speech comprises: In any process of encoding a vector of a speech frame of the sample reference speech, encoding is performed through the speech coding network based on the vector of the speech frame obtained by the previous encoding and the speech features of the speech frame to be encoded this time, so as to obtain the vector of the speech frame to be encoded this time; The determining of a global style embedding vector based on the sample global indication information and the sample reference speech vector sequence through the global style representation network includes: The global style representation network is used to convert the sample global indication information into a sample global style vector; The global style embedding vector is determined based on the sample global style vector and the vector of the last speech frame in the sample reference speech vector sequence, wherein the vector of the last speech frame integrates speech features of multiple speech frames of the sample reference speech.

6. The method for training a speech synthesis model according to claim 5, characterized in that: The determining the global style embedding vector based on the sample global style vector and the vector of the last speech frame in the sample reference speech vector sequence comprises: Resampling is performed based on a Gaussian distribution with each value in the sample global style vector as a mean and each value in the vector of the last speech frame as a variance to obtain each value in the global style embedding vector.

7. The method for training a speech synthesis model according to claim 4, characterized in that: The determining, through the local style representation network, a sample local adjustment vector sequence based on the sample phoneme vector sequence and the sample reference speech vector sequence comprises: Determine, by the local style representation network, the probability that each of the multiple speech frames of the sample reference speech corresponds to each of the multiple phonemes of the sample text information, based on the sample phoneme vector sequence and the sample reference speech vector sequence according to the attention mechanism; Based on the probability that each speech frame corresponds to each phoneme and the sample reference speech vector sequence, the sample local adjustment vector sequence is determined, wherein the sequence length of the sample local adjustment vector sequence is equal to the sequence length of the sample phoneme vector sequence.

8. The method for training a speech synthesis model according to claim 4, characterized in that: In the process of determining the speech feature corresponding to a phoneme at any time, determining the sample intermediate vector based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence through the attention network, including: In any process of determining a speech feature corresponding to a phoneme, determining, through the attention network, attention weights corresponding to a plurality of phonemes of the sample text information based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence; Based on the attention weights corresponding to the multiple phonemes, weighted sum is performed on the vectors corresponding to the multiple phonemes to obtain the sample intermediate vector.

9. A speech synthesis device, characterized in that: The speech synthesis device comprises: A first information acquisition module is configured to acquire global indication information and a reference voice, wherein the global indication information is used to indicate the overall intonation style of the voice to be synthesized, and the reference voice is used to indicate the local intonation style of the voice to be synthesized, and the global indication information includes at least one of a duration indication mean of a syllable of a voice feature corresponding to the text information, a fundamental frequency indication mean of the voice feature, and a fundamental frequency indication variance of the voice feature; A first information input module is configured to input the text information, the global indication information and the reference speech into a speech synthesis model; A first speech synthesis module is configured to execute the speech synthesis model to output the speech features corresponding to the text information; The speech synthesis model is trained based on sample text information, sample global indication information and sample reference speech corresponding to the sample text information.

10. The speech synthesis device according to claim 9, characterized in that: The speech synthesis model includes a text encoding network, a speech encoding network, a global style representation network, a local style representation network, an attention network and a decoding network, wherein the speech encoding network is connected to the local style representation network, the text encoding network is connected to the local style representation network and the attention network respectively, the global style representation network and the local style representation network are connected to the attention network respectively, and the attention network is connected to the decoding network; The first speech synthesis module is configured to perform: Determine the phoneme vector sequence corresponding to the text information through the text encoding network; determine the reference speech vector sequence corresponding to the reference speech through the speech encoding network; Converting the global indication information into a global style vector through the global style representation network; Determine, by the local style representation network, a local adjustment vector sequence based on the reference speech vector sequence and the phoneme vector sequence, wherein the local adjustment vector sequence is used to represent the influence of the intonation style of each speech frame of the reference speech on the speech feature corresponding to each phoneme of the text information; In any process of determining the speech feature corresponding to a phoneme, an intermediate vector is determined through the attention network based on the phoneme vector sequence, the global style vector and the local adjustment vector sequence; and a speech feature corresponding to a phoneme is determined through the decoding network based on the intermediate vector.

11. A training device for a speech synthesis model, characterized in that: The training device of the speech synthesis model comprises: A second information acquisition module is configured to acquire sample global indication information during any iteration, wherein the sample global indication information is used to indicate the overall intonation style of the speech to be synthesized, and the sample global indication information includes at least one of a duration indication mean, a fundamental frequency indication mean, and a fundamental frequency indication variance, wherein the duration indication mean is used to indicate the mean of the durations of multiple syllables in the speech features output by the speech synthesis model, the fundamental frequency indication mean is used to indicate the mean of multiple fundamental frequencies in the speech features output by the speech synthesis model, and the fundamental frequency indication variance is used to indicate the variance of multiple fundamental frequencies in the speech features output by the speech synthesis model; A second information input module is configured to input sample text information, sample reference speech and the sample global indication information into the speech synthesis model, wherein the sample reference speech is a speech representation of the sample text information, and is used to indicate a local intonation style of the speech to be synthesized; A second speech synthesis module is configured to execute the speech synthesis model to output speech features corresponding to the sample text information; The model parameter updating module is configured to update the model parameters of the speech synthesis model based on the speech features output by the speech synthesis model and the speech features of the sample reference speech until the training stop condition is met, and output the trained speech synthesis model.

12. The training device for a speech synthesis model according to claim 11, characterized in that: The speech synthesis model includes a text encoding network, a speech encoding network, a global style representation network, a local style representation network, an attention network and a decoding network, wherein the speech encoding network is connected to the global style representation network and the local style representation network respectively, the text encoding network is connected to the local style representation network and the attention network respectively, the global style representation network and the local style representation network are connected to the attention network respectively, and the attention network is connected to the decoding network; The second speech synthesis module comprises: A text encoding unit, configured to determine a sample phoneme vector sequence corresponding to the sample text information through the text encoding network; A speech coding unit, configured to determine a sample reference speech vector sequence corresponding to the sample reference speech through the speech coding network; A global style representation unit, configured to determine a global style embedding vector based on the sample global indication information and the sample reference speech vector sequence through the global style representation network; A local style representation unit is configured to determine a sample local adjustment vector sequence based on the sample phoneme vector sequence and the sample reference speech vector sequence through the local style representation network, wherein the sample local adjustment vector sequence is used to represent the influence of the intonation style of each speech frame of the sample reference speech on the speech feature corresponding to each phoneme of the sample text information; The intermediate vector representation unit is configured to determine the sample intermediate vector based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence through the attention network in any process of determining the speech feature corresponding to a phoneme; The decoding unit is configured to determine the speech feature corresponding to a phoneme based on the sample intermediate vector through the decoding network.

13. The training device for a speech synthesis model according to claim 12, characterized in that: The speech encoding unit is configured to perform encoding through the speech encoding network based on the vector of the speech frame obtained in the previous encoding and the speech features of the speech frame to be encoded this time, in the process of obtaining the vector of a speech frame of the sample reference speech at any encoding time, to obtain the vector of the speech frame to be encoded this time; The global style representation unit includes: A global style vector determination subunit is configured to convert the sample global indication information into a sample global style vector through the global style representation network; The global style embedding vector determination subunit is configured to determine the global style embedding vector based on the sample global style vector and the vector of the last speech frame in the sample reference speech vector sequence, wherein the vector of the last speech frame integrates the speech features of multiple speech frames of the sample reference speech.

14. The training device for a speech synthesis model according to claim 13, characterized in that: The global style embedding vector determination subunit is configured to perform resampling based on a Gaussian distribution with each value in the sample global style vector as a mean and each value in the vector of the last speech frame as a variance, to obtain each value in the global style embedding vector.

15. The training device for a speech synthesis model according to claim 12, characterized in that: The local style representation unit is configured to perform: Determine, by the local style representation network, the probability that each of the multiple speech frames of the sample reference speech corresponds to each of the multiple phonemes of the sample text information, based on the sample phoneme vector sequence and the sample reference speech vector sequence according to the attention mechanism; Based on the probability that each speech frame corresponds to each phoneme and the sample reference speech vector sequence, the sample local adjustment vector sequence is determined, wherein the sequence length of the sample local adjustment vector sequence is equal to the sequence length of the sample phoneme vector sequence.

16. The training device for a speech synthesis model according to claim 12, characterized in that: The intermediate vector representation unit is configured to perform: In any process of determining a speech feature corresponding to a phoneme, determining, through the attention network, attention weights corresponding to a plurality of phonemes of the sample text information based on the sample phoneme vector sequence, the global style embedding vector and the sample local adjustment vector sequence; Based on the attention weights corresponding to the multiple phonemes, weighted sum is performed on the vectors corresponding to the multiple phonemes to obtain the sample intermediate vector.

17. An electronic device, characterized in that: The electronic device comprises: one or more processors; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the speech synthesis method as described in any one of claims 1 to 2.

18. A server, characterized in that: The server comprises: one or more processors; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the speech synthesis method as described in any one of claims 1 to 2 or the training method of the speech synthesis model as described in any one of claims 3 to 8.

19. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the speech synthesis method as claimed in any one of claims 1 to 2.

20. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by the processor of the server, the server is enabled to execute the speech synthesis method as described in any one of claims 1 to 2 or the training method of the speech synthesis model as described in any one of claims 3 to 8.

21. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the speech synthesis method according to any one of claims 1 to 2 is implemented.

22. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the training method of the speech synthesis model described in any one of claims 3 to 8 is implemented.