Personalized speech synthesis method, audio model training method and electronic device
By fusing audio features and semantic features on the electronic device side, and adjusting audio model parameters on the server side, the problem of personalized speech synthesis accuracy loss caused by audio model migration is solved, improving the personalized speech reasoning accuracy of electronic devices, and improving user experience. experience.
Patent Information
- Application Number
- CN202410510421.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-04-26
AI Technical Summary
When the audio model is migrated to electronic devices, the accuracy of personalized speech synthesis is lost, and the accuracy of personalized speech reasoning of electronic devices cannot be effectively improved.
By executing the personalized speech synthesis method on the electronic device side, the user's audio features and semantic features are extracted, fused using the cross-attention mechanism, combined with the audio model in the training data for processing, and personalized speech is output, and at the same time on the server side Audio model training, adjusting parameters to improve inference accuracy.
It effectively improves the accuracy of personalized speech reasoning of electronic devices, makes up for the problem of accuracy loss during model migration, and improves user experience.
Smart Images

Figure CN118314877B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a personalized speech synthesis method, an audio model training method and an electronic device. Background Art
[0002] With the continuous development of electronic devices, the rich functions of electronic devices have provided great convenience for users' lives. For example, when the voice assistant function of an electronic device is turned on, the user can have a voice conversation with the electronic device. If the user inputs a voice, the electronic device can make a voice reply based on the voice. For another example, when the artificial intelligence (AI) call function is turned on for an electronic device, if the electronic device receives an incoming call, the user can enter text in the call interface, so that the electronic device can synthesize the text into voice and send it to the other party's electronic device.
[0003] In the above scenario, whether the electronic device is making a voice reply or synthesizing text into speech, the text to speech (TTS) process is involved. In order to improve the user experience, the electronic device also provides a personalized speech synthesis function, which allows users to record their own voice so that the subsequent voice output by the electronic device is the user's own timbre. Usually, the personalized speech synthesis process is carried out with the help of the audio model on the cloud server side. If the audio model is migrated to the electronic device side, how to ensure the reasoning accuracy based on the limited computing power of the electronic device is a problem that needs to be solved. Summary of the invention
[0004] The present application provides a personalized speech synthesis method, an audio model training method, an electronic device, a server and a storage medium, which can compensate for the problem of model accuracy loss caused by compression or miniaturization during model migration, thereby improving the personalized speech reasoning accuracy of the electronic device.
[0005] In a first aspect, the present application provides a personalized speech synthesis method, which is executed by an electronic device, comprising: when the speech synthesis function of the electronic device is turned on, obtaining text information that needs to be speech synthesized in the electronic device, and extracting semantic features corresponding to the text information, the text information includes text information input by the user and text information generated by the electronic device; obtaining audio features corresponding to the user, the audio features are features generated based on the voice information entered by the user when registering the speech synthesis function; using the audio features as the first target features, and using the fusion result of the audio features and the semantic features as the second target features, processing the first target features and the second target features through an audio model, and outputting personalized speech, wherein the audio model is a text-independent model obtained by training based on the first text information and the first speech information in the training data.
[0006] Among them, when the user uses the speech synthesis function of the electronic device, the user can make the electronic device output the voice with the timbre that the user wants to use (i.e., personalized voice). For example, in the scenario of the voice assistant function, after the user inputs a sentence by voice, the electronic device can reply with personalized voice. For another example, in the scenario of the AI call function, the user inputs text information, and the electronic device can convert the text information into personalized voice (such as the user's own voice) and reply to the other user.
[0007] Since the present application solves the problem of accuracy loss caused by migrating the audio model from the cloud server side to the electronic device side, the above-mentioned personalized speech synthesis method is executed by the electronic device, and the training process of the audio model is executed by a subsequent server (such as a cloud server).
[0008] In the present application, when the user registers for the speech synthesis function (i.e., custom voice registration), the user can read a prompt phrase or sentence, and the electronic device can extract the audio features corresponding to the user based on the voice information entered by the user. Then, after the subsequent electronic device receives the text information, it can also extract the semantic features corresponding to the text information. Before the audio model and the semantic features are processed by the audio model, the audio features can be used as the first target features, and the fusion results of the audio features and the semantic features can be used as the second target features, that is, the information of the audio features is injected into the semantic features to increase the amount of information of the semantic features, thereby improving the reasoning accuracy of the audio model, that is, improving the personalized voice reasoning accuracy of the electronic device. The audio model here is a text-independent model obtained by training based on the first text information and the first voice information in the training data.
[0009] For the text information that needs to be voice synthesized in the above-mentioned electronic devices, in the scenario of the voice assistant function, the text information can be the information that the electronic device queries and replies to the voice input by the user. In the scenario of the AI call function, the text information can be the information input by the user to reply to the other user.
[0010] In combination with the first aspect, in some implementations of the first aspect, the above-mentioned fusion result of the audio feature and the semantic feature is used as the second target feature, including: fusing the audio feature and the semantic feature based on a cross-attention mechanism to obtain the second target feature.
[0011] Among them, when the electronic device fuses the audio features and the semantic features, it can fuse them based on the cross-attention mechanism (cross_attention), so that cross_attention (K / V=semantic features, Q=audio features) can be used to improve the information content of the semantic features.
[0012] In combination with the first aspect, in some implementations of the first aspect, the audio model includes a first module, a second module and a third module, and the first target feature and the second target feature are processed by the audio model to output personalized voice, including: inputting the first target feature and the second target feature into the first module and outputting the first result; inputting the first target feature and the first result into the second module and outputting the second result; inputting the second result into the third module and outputting the third result, and returning the third result to the first module, and iterating until the personalized voice is output.
[0013] To further improve the inference accuracy of the audio model, the present application can also inject the first target feature (i.e., audio feature) into each iteration to better learn the information in the audio feature. Therefore, a second module can be added to the audio model (or the encoder of the audio model) to receive the output result of the first module and the first target feature during each iterative calculation process, fully consider the information of the first target feature, and improve the inference accuracy.
[0014] In combination with the first aspect, in some implementations of the first aspect, the above-mentioned inputting the first target feature and the first result into the second module and outputting the second result includes: performing a dimension conversion on the first target feature to obtain a one-dimensional vector corresponding to the first target feature; inputting the one-dimensional vector and the first result into the second module, and outputting the second result.
[0015] Because the first target feature contains a multi-dimensional vector feature in the time domain, the electronic device can compress the first target feature to obtain a corresponding one-dimensional vector, which can represent a one-dimensional vector of the user's timbre style, so that subsequent inference results are closer to the user's timbre.
[0016] In combination with the first aspect, in some implementations of the first aspect, the above-mentioned extraction of semantic features corresponding to text information includes: the electronic device can first perform front-end processing such as text regularization processing, rhythm prediction processing, phonetic processing, etc. on the text information to obtain the phoneme information corresponding to the text information, and then perform dimensional mapping processing, encoding processing and time stretching processing on the phoneme information to obtain the semantic features corresponding to the text information.
[0017] Among them, dimensional mapping processing refers to the process of mapping high-dimensional data (such as text, pictures, audio) to low-dimensional space; encoding processing refers to the process of integrating the features of the input text information and converting it into high-dimensional abstract feature blocks; duration stretching processing refers to stretching the reading time of text information, that is, predicting the duration of reading each word (or phoneme) and adding the duration information to the text information.
[0018] When the audio model is used to synthesize the semantic features and the audio features corresponding to the user, the audio features corresponding to the user can be used as a timbre prompt, and the semantic features and audio features can be fused and decoded to convert the text information into a personalized voice with the same timbre as the user. Therefore, no matter what kind of text information is, as long as the audio features of the user when registering are extracted, the text information can be converted into a personalized voice, which improves the processing efficiency of speech synthesis.
[0019] In combination with the first aspect, in some implementations of the first aspect, before the phoneme information is time-stretched, the method further includes: predicting the stretching duration corresponding to the phoneme information based on a preset duration prediction model, the duration prediction model being a model trained according to the encoding result corresponding to the first text information in the training data and the acoustic features corresponding to the first speech information.
[0020] Among them, when the electronic device performs time stretching processing on text information (or phoneme information), because there is no voice information corresponding to the text information to determine the stretching time, the stretching time can be predicted based on the time prediction model. The time prediction model here can be a network model trained in parallel during the audio model training process. Therefore, in the process of inferring and generating personalized voice, the electronic device can use the time prediction model, input the audio features (acoustic) corresponding to the user and the encoding results corresponding to the text information, and obtain the stretching time, so as to subsequently perform time stretching processing on the text information (or phoneme information).
[0021] In combination with the first aspect, in some implementation methods of the first aspect, the above-mentioned obtaining of the audio features corresponding to the user includes: obtaining the voice information entered by the user when registering for the speech synthesis function; performing audio encoding processing, multi-channel mapping processing and multi-channel accumulation processing on the entered voice information to obtain the audio features corresponding to the user.
[0022] Among them, when the user registers for the speech synthesis function, the electronic device provides a corresponding registration interface. For example, in the scenario of the voice assistant function, in the smart voice setting interface, the user can set the broadcast tone, such as customizing the tone setting. In the custom tone setting interface, a prompt for reading aloud phrases is displayed, and the user can read aloud the corresponding phrases so that the electronic device can record the user's voice. Optionally, if the user fails to record successfully, the recording can be performed again. Optionally, in this application, when the user enters the voice information, the number of short sentences N≤2 corresponding to the reading.
[0023] After the recording is completed, the electronic device can perform audio encoding processing, multi-channel mapping processing, and multi-channel accumulation processing on the voice information recorded by the user to obtain the audio features corresponding to the user. Optionally, the electronic device can also associate the audio features corresponding to the user with the user's identification and store them in a feature library, so that when the subsequent electronic device performs speech synthesis, it can directly search for the audio features corresponding to the user from the feature library.
[0024] In the above implementation, when the user registers a custom voice, he only needs to read a few phrases to complete it, without having to read multiple sentences. The operation is relatively simple, which improves the user experience.
[0025] In a second aspect, the present application provides a method for training an audio model, which is executed by a server and includes:
[0026] Acquire first text information and first voice information in training data;
[0027] Extracting a first semantic feature corresponding to the first text information and a first acoustic feature corresponding to the first voice information, wherein the data length of the first semantic feature is equal to the data length of the first acoustic feature;
[0028] Generate a random number m, divide the first semantic feature into a first sub-feature and a second sub-feature according to the random number m, and divide the first acoustic feature into a third sub-feature and a fourth sub-feature;
[0029] using the third sub-feature as a third target feature, and generating a fourth target feature according to the second sub-feature, the third sub-feature and the fourth sub-feature;
[0030] Inputting the third target feature and the fourth target feature into the audio model to obtain an output result;
[0031] According to the loss between the output result and the first acoustic feature, the parameter value of the audio model is adjusted until the audio model converges.
[0032] It can be understood that before the audio model is used as described above, the audio model needs to be trained to obtain a converged network model. During the training process, it is necessary to extract features from the first text information to obtain a first semantic feature (semantic), and to extract features from the first voice information to obtain a first acoustic feature (acoustic). Then, based on the randomly generated random number m, the semantic features and the acoustic features are divided into two parts, for example, the semantic features are divided into two parts, prompt_se (i.e., the first sub-feature) and target_se (i.e., the second sub-feature), and the acoustic features are divided into two parts, prompt_ac (i.e., the third sub-feature) and target_ac (i.e., the fourth sub-feature). Next, the divided prompt_se and target_se, prompt_ac and target_ac are fused through the audio model to obtain the target prompt (i.e., the third target feature) and the target target (i.e., the fourth target feature). Finally, the server can input the third target feature and the fourth target feature into the decoder for decoding to obtain an output result, and compare the characteristics of the output result with the acoustic characteristics of the above-mentioned input speech information, calculate the loss function, and adjust the parameter value of the audio model according to the loss function to finally obtain a converged audio model.
[0033] In some implementations, when the server fuses the divided prompt_se and target_se, prompt_ac and target_ac, it can use prompt_ac as the target prompt, and then fuse prompt_ac, target_se and target_ac to obtain the target target. For example, target_se and prompt_ac are fused based on the cross attention mechanism, so that cross_attention (K / V=target_se, Q=prompt_ac) is obtained to obtain the fusion result; then the fusion result and target_ac are weightedly added to obtain the target target. As a result, the server can inject the information of prompt_ac into the target target to increase the amount of information of the semantic features, thereby improving the reasoning accuracy.
[0034] Optionally, the value range of the random number m can be [ × L, ×L], where L is the data length of the first semantic feature (or the first acoustic feature).
[0035] In combination with the second aspect, in some implementations of the second aspect, the audio model includes a first module, a second module, and a third module. The third target feature and the fourth target feature are input into the audio model to obtain an output result, including: inputting the third target feature and the fourth target feature into the first module to output a fourth result; inputting the third target feature and the fourth result into the second module to output a fifth result; inputting the fifth result into the third module to output a sixth result, and returning the sixth result to the first module, and iterating until the output result is obtained.
[0036] To further improve the inference accuracy of the audio model, during the training process, the present application can also inject the third target feature into each iteration to better learn the information in the audio feature. Therefore, a second module can be added to the audio model (or the encoder of the audio model) to receive the output result of the first module and the third target feature during each iterative calculation process, fully consider the information of the third target feature, and improve the inference accuracy.
[0037] In combination with the second aspect, in some implementations of the second aspect, the first acoustic feature includes feature vectors of multiple channels, and the feature vector of each channel is a vector that has been subjected to mask processing.
[0038] Among them, the role of the server in masking the feature vector of the channel is to mask some frames in the feature vector for subsequent decoder reasoning to train the accuracy of reasoning. The mask ratio here is usually determined by a random number. In the process of actually applying the audio model to personalized speech synthesis, the audio model is to infer the text information to obtain the corresponding voice information. The voice information is unknown during the reasoning process, which is equivalent to the multi-channel features of its corresponding acoustic vector being unknown, which is equivalent to all being masks. Therefore, in order to make the reasoning ability of the decoder in the audio model trained by the server closer to the reasoning ability required in actual applications, it is necessary to use a mask ratio close to that in actual applications to mask the feature vector during the audio model training process.
[0039] Since the audio model will perform multiple rounds of iterative calculations on the feature vector of each channel, the present application can generate random numbers as mask ratios according to different ratio intervals during different rounds of reasoning. In some implementations, the process of masking the feature vector of each channel includes: as the number of reasoning rounds increases, the adopted ratio interval also shows an increasing gradient change, that is, in the i-th round of calculation, a random number is generated from the ratio interval of [Ai, 100%] as the mask ratio, and the first feature vector is masked according to the mask ratio, wherein the left interval Ai+1 of the ratio interval corresponding to the i+1 round of calculation is greater than the left interval Ai of the ratio interval corresponding to the i-th round of calculation, and the first feature vector is any vector among the feature vectors of multiple channels, i≥1.
[0040] That is to say, as the number of inference rounds increases, the value in the range of the mask ratio becomes larger and larger, which makes the mask ratio larger and larger. In this way, it will be closer to the mask ratio in actual applications (that is, 100%). As a result, the reasoning ability of the decoder in the trained audio model is closer to the reasoning ability required in actual applications, thereby improving the reasoning accuracy.
[0041] In a third aspect, the present application provides a device, which is included in an electronic device, and the device has the function of implementing the electronic device behavior in the above-mentioned first aspect and the possible implementation of the above-mentioned first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-mentioned functions. For example, a receiving module or unit, a processing module or unit, etc.
[0042] In a fourth aspect, the present application provides an electronic device, comprising: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other so that the electronic device executes any one of the methods in the technical solution of the first aspect.
[0043] In a fifth aspect, the present application provides a server, comprising one or more processors; one or more memories; the memories storing one or more programs, and when the one or more programs are executed by the processors, the server executes any one of the methods in the technical solution of the second aspect.
[0044] In one implementation, the server may be a cloud server.
[0045] In a sixth aspect, the present application provides a chip, including a processor. The processor is used to read and execute a computer program stored in a memory to execute the method in the first aspect and any possible implementation thereof, or execute the method in the second aspect and any possible implementation thereof.
[0046] Optionally, the chip also includes a memory, and the memory is connected to the processor via a circuit or wire.
[0047] Further optionally, the chip also includes a communication interface.
[0048] In the seventh aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor executes any one of the methods in the technical solution of the first aspect, or executes the method in the second aspect and any possible implementation thereof.
[0049] In an eighth aspect, the present application provides a computer program product, which includes: a computer program code, which, when the computer program code runs on an electronic device, enables the electronic device to execute any one of the methods in the technical solution of the first aspect, or execute the method in the second aspect and any possible implementation thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is an application scenario diagram of a voice assistant function provided in an embodiment of the present application;
[0051] Figure 2 This is an application scenario diagram of an AI call function provided in an embodiment of the present application;
[0052] Figure 3 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0053] Figure 4 This is a schematic diagram of an interface for setting a voice assistant function provided in an embodiment of the present application;
[0054] Figure 5 This is a schematic diagram of an interface for a custom tone setting process provided in an embodiment of the present application;
[0055] Figure 6 is a schematic diagram of another interface of a custom tone setting process provided in an embodiment of the present application;
[0056] Figure 7 is another interface schematic diagram of a custom tone setting process provided in an embodiment of the present application;
[0057] Figure 8 is a schematic diagram of an audio model training process provided in an embodiment of the present application;
[0058] Fig. 9 This is a schematic diagram of a process of constructing a target prompt and a target provided in an embodiment of the present application;
[0059] Fig.10 is a schematic diagram of a processing process of a decoder provided in an embodiment of the present application;
[0060] Fig.11 This is a process diagram of a personalized speech synthesis method provided in an embodiment of the present application;
[0061] Fig.12 is a process diagram of another personalized speech synthesis method provided in an embodiment of the present application;
[0062] Fig.13 is a software structure block diagram of an electronic device provided in an embodiment of the present application;
[0063] Fig.14 It is a flowchart of a personalized speech synthesis method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0065] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.
[0066] With the continuous development of electronic devices, the rich functions of electronic devices have provided great convenience for users' lives. For example, when the voice assistant function (such as the YOYO assistant function) of an electronic device is turned on, the user can have a voice conversation with the electronic device. If the user inputs a voice, the electronic device can make a voice reply based on the voice. For example, if the user inputs "What's the weather like today", the electronic device can reply with voice "Today's minimum temperature is 15 degrees Celsius and the maximum temperature is 25 degrees Celsius"; or, the user can also control the electronic device with voice, for example, if the user inputs "Open WeChat ® ”, the electronic device can reply “OK” by voice and enter WeChat ® As another example, when the AI call function is turned on in the electronic device, if the electronic device receives an incoming call, the user can enter text in the call interface, so that the electronic device can send the text-synthesized speech to the other party's electronic device.
[0067] In the scenario of the voice assistant function, for example, when the user triggers the voice assistant to be awakened, the electronic device A may display the following Figure 1 In the voice input interface shown in Figure (a), the user can input "how is the weather today" by voice, and the text corresponding to the voice can be displayed on the electronic device A. After the electronic device A recognizes the voice, it can query today's weather information through the network in the background, and convert the text corresponding to the weather information into voice output, such as the voice output "today's minimum temperature is 15 degrees Celsius and the maximum temperature is 25 degrees Celsius". Or, Figure 1 As shown in Figure (b), after electronic device A recognizes the voice, a voice dialog box can be displayed, in which the text "How is the weather today" input by the user's voice and the text corresponding to the weather information queried by electronic device A "Today's minimum temperature is 15 degrees Celsius and the maximum temperature is 25 degrees Celsius" are displayed. At the same time, electronic device A can also output this weather information by voice.
[0068] In the scenario of the AI call function, for example, Figure 2 As shown, when electronic device A receives an incoming call from electronic device B, electronic device A displays an incoming call interface, which may include information such as user name, caller number, number location, and operator, and may also include an answer control 21, a reject control 22, and a first control 23. Optionally, the first control 23 may be a display form for user interaction on electronic devices such as a touch pop-up window, a card, a control, or a floating ball. Optionally, the first control 23 may include a text prompt option area for turning on the "call subtitles" function. If the user answers the call on electronic device A and clicks on the first control 23, electronic device A may update the first control 23 to display as a first window 200, that is, the user can directly turn on the call subtitles while answering the call. At this time, electronic device A may convert the voice message 1 transmitted by electronic device B into a corresponding text message 1, and display the text message 1 in the first window 200, for example Figure 2 The text message 1 shown in the figure is "Hello, I am Xiao Li, a financial advisor". If the user enters the message "What can I do for you?" on the electronic device A and clicks the send control 24, the electronic device A can also display the text message 2 "What can I do for you?" entered by the user in the first window 200, and convert the text message "What can I do for you?" into a voice message 2 "What can I do for you?" and transmit it to the electronic device B.
[0069] From the description of the above scenario, it can be seen that no matter whether electronic device A is making a voice reply of a voice assistant or a voice call of an AI call, the process of speech synthesis TTS will be involved. Speech synthesis is designed to enable electronic devices to generate human speech with different tones. The difference is that in the voice assistant function, the electronic device converts the queried text information or the fixed reply text information into speech for output, and in the AI call function, the electronic device converts the text information input by the user into speech and sends it to the other electronic device, but in essence, both need to convert text information into speech information.
[0070] In recent years, in order to improve the user experience, electronic devices also provide personalized speech synthesis functions, which allow users to record their own voices so that subsequent electronic devices can output voices with the user's own timbre. For example, in the scenario of the voice assistant function, users can customize the timbre and record voices by reading template text to generate their own personalized timbre. Then, when subsequent users use the voice assistant function to communicate with electronic devices, the voice output by the electronic device is a customized personalized voice. In the AI call scenario, users can also customize the timbre and generate their own personalized timbre. Then, when subsequent users enter the text message to be replied on electronic device A, the electronic device can convert the text message into a voice message corresponding to the personalized voice. In this way, it is equivalent to replying with the user's own voice, and the user experience is better.
[0071] In the related art, it is usually necessary to construct an audio model, through which the audio features of the user when customizing the timbre and the text information to be outputted by voice are processed, and the voice information with the user's timbre corresponding to the text information is outputted. The more common audio model training process is carried out on the cloud server side with strong computing power. After the training is completed, the cloud server can receive the voice information input by the user when customizing the timbre and the text information to be outputted by voice sent by the electronic device, and then the cloud server extracts the user's audio features, infers the text information to be outputted by voice, generates personalized voice and returns it to the electronic device for output. If the audio model is to be migrated to the electronic device side, so that the electronic device performs the synthesis process of personalized voice, then considering the gap between the computing power of the electronic device and the computing power of the cloud server, the audio model may be compressed or miniaturized, which will also bring about the problem of model accuracy loss, resulting in a decrease in the accuracy of personalized voice reasoning of the electronic device.
[0072] In view of this, the embodiment of the present application provides a personalized speech synthesis method. When training an audio model, the relevant operation process of the decoder in the audio model is optimized to enhance the performance of the decoder so that it can make up for the problem of model accuracy loss caused by compression or miniaturization during model migration, thereby improving the personalized speech reasoning accuracy of the electronic device. It should be noted that the personalized speech synthesis method provided in the present application can be applied to mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), smart homes and other electronic devices that can perform personalized voice settings. The embodiment of the present application does not impose any restrictions on the specific types of electronic devices.
[0073] For example, Figure 3 1 is a schematic diagram of the structure of an example of an electronic device 100 provided in an embodiment of the present application. Taking the electronic device 100 as a mobile phone as an example, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0074] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0075] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0076] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0077] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0078] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Figure 3 The structures of antenna 1 and antenna 2 in the electronic device 100 are only examples. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0079] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0080] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0081] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).
[0082] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0083] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0084] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0085] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0086] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0087] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0088] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0089] It is also understandable that the above Figure 3 The electronic device shown is only an exemplary description when it is a mobile phone. If the electronic device is a tablet computer, PC, PDA, wearable device or other types of devices, the structure of the electronic device may include more Figure 3 The structure shown in the figure is less than Figure 3More structures are shown in the figure, which are not limited here.
[0090] As can be seen from the above description, if a user wants to use the personalized speech synthesis function, he needs to customize the timbre (that is, register the speech synthesis function). The present application embodiment provides a setting process of the personalized speech synthesis function, which is described below by taking the setting in the scenario of the voice assistant function as an example. Figure 4 As shown, the user clicks the setting icon on the desktop interface of the electronic device to enable the electronic device to enter the setting interface. In the setting interface, there are setting options for different functions, such as WLAN options, Bluetooth options, display and brightness options, smart assistant options, etc. When the user clicks the smart assistant option control 41, the electronic device can jump to the smart assistant setting interface. In the smart assistant setting interface, there are different smart functions, such as YOYO suggestions, negative one screen, smart text, smart search, smart voice, etc. When the user clicks the smart voice option control 42, the electronic device can jump to the smart voice setting interface. In the smart voice setting interface, there are different wake-up methods for the voice assistant, such as voice wake-up, power button wake-up, breath wake-up, headphone line control wake-up and Bluetooth device wake-up. The user can choose the corresponding wake-up method to wake up the voice assistant according to the needs. It can be understood that after the user selects the wake-up method in the smart voice setting interface, the voice assistant function is turned on, and then the personalized voice synthesis method of the present application can be used to synthesize personalized voice to output voice information and communicate with the user.
[0091] At the same time, in the smart voice setting interface, the broadcast tone can also be set. When the user clicks the broadcast tone option control 43, the electronic device can jump to Figure 5The interface shown. On this interface, the electronic device provides different types of timbres for the user to choose, for example, YOYO (male voice), YOYO (female voice), etc. In addition, the electronic device also provides the function of customizing the timbre. When the user clicks the custom timbre control 51, the electronic device can jump to the custom timbre setting interface. In the custom timbre setting interface, the recorded timbres, such as timbre 1 and timbre 2, and the new timbre control 52 are displayed. When the user clicks the new timbre control 52, the electronic device can jump to the new timbre interface. In the new timbre interface, the guiding term for creating a personal voice is presented. If the user wants to record his own personalized voice at this time, he can click the next control 53 to trigger the voice recording. When the user clicks the next control 53, the electronic device can present a prompt to read a phrase. The user can read the corresponding phrase (also called the registered text) after clicking the start control 54, and the electronic device can record the user's voice. Optionally, when the user customizes the timbre registration, the embodiment of the present application only needs to read N phrases (N≤2) to achieve it.
[0092] In some cases, if the user interferes or reads aloud abnormally during the recording process, resulting in failure of recording, the electronic device may display the following information: Figure 6 The prompt interface shown displays a prompt message of “recording failed, please re-record”, so the user can click the start control 54 again and then read the corresponding phrase.
[0093] In other cases, if the user has successfully recorded, the electronic device may display the following information: Figure 7 The interface shown in FIG. 1 shows a "play recording" control 71. The user clicks the "play recording" control 71 to listen to the content just recorded. If the user is not satisfied with the recorded content, the user can click the previous control 72 to re-enter the electronic device. Figure 5The interface shown is used for recording. If the user is satisfied with the recorded content, the user can click the next control 73, and the electronic device enters the synthesized timbre interface, on which the electronic device can present a default synthesized phrase and a corresponding synthesized timbre. For example, the default synthesized phrase is "An alarm has been set for you at 8 o'clock tomorrow morning", and the corresponding synthesized timbre can be listened to through the "Audio" control 74. It can be understood that the synthesized timbre is the synthesized timbre obtained by the electronic device analyzing the sound of the above-mentioned user during recording, extracting the user's timbre characteristics, and then using the timbre characteristics to infer the synthesized phrase, that is, it can be understood as simulating the user's voice to read aloud the synthesized phrase. At this time, if the user is satisfied with the effect of the synthesized timbre, the user can click the completion control 75, that is, the custom timbre process is completed, so that subsequent users can experience the personalized voice synthesis function accordingly when using the voice assistant function, and the electronic device can convert the text message in reply to the user into a personalized voice for output.
[0094] It can be seen from the above scenario description that in the embodiment of the present application, when the user registers a customized tone, he only needs to read a few phrases to complete it, without having to read multiple sentences. The operation is relatively simple, which improves the user experience.
[0095] It is understandable that in the scenario of AI call function, users can also customize the timbre in a similar way as described above, so that the electronic device can convert the text information input by the user into a personalized voice and send it to the other party's electronic device, that is, simulate the user's timbre to send the call content to the other party's electronic device. It is also understandable that in addition to the above-mentioned voice assistant function scenario and AI call function scenario, in other scenarios, such as short video dubbing scenario, the personalized voice synthesis function can also be used. After the user customizes the timbre, the electronic device can output the lines in the short video in the user's own voice to achieve the effect of personal dubbing.
[0096] In the above scenario, if the user clicks the completion control 75 to complete the custom timbre process, the electronic device can extract audio features from the sound recorded by the user to obtain the audio features corresponding to the user. If the user subsequently inputs text information or the electronic device itself obtains text information, the electronic device can generate personalized speech based on the constructed audio model and the audio features corresponding to the user. Below we will introduce in detail the process of performing a personalized speech synthesis method based on a text-independent audio model in an embodiment of the present application.
[0097] First, the audio model of the embodiment of the present application needs to be trained to obtain a converged network model. In some embodiments, the training process of the audio model can be performed by a cloud server, and the audio model can also include an encoder and a decoder. Before training, the cloud server can obtain multiple sets of training data, wherein each set of training data can include a text message and a voice message, and the voice messages in different sets of training data can be recorded by different users. Exemplarily, the text message in a certain set of training data is "Today's maximum temperature is 25 degrees Celsius", and the voice message is the voice of a user reading "Today's maximum temperature is 25 degrees Celsius". For each set of training data, the cloud server can perform the following processing: Taking training data A as an example, the cloud server extracts features from the text information and voice information in the training data A respectively, obtains semantic features (semantic) and acoustic features (acoustic), and then constructs a text-independent prompt based on the semantic features and acoustic features, and then decodes the constructed prompt to obtain an output result. In other embodiments, if the electronic device has the ability to train the model, the training process of the audio model can also be performed by the electronic device.
[0098] like Figure 8 As shown, the cloud server extracts features from text information, and the process of obtaining semantic features may include front-end processing, mapping processing (embedding), encoding processing (encoder) and time stretching processing (LR). The front-end processing here may include text regularization processing, rhythm prediction processing and phonetic processing. In some embodiments, the process of extracting features from text information to obtain semantic features may be performed by a semantic encoder.
[0099] Among them, because some words are abbreviated or abbreviated in daily life, the cloud server needs to standardize these words, such as converting telephone, time, money, unit, symbol, mailbox, date, etc. into standardized words, that is, performing text regularization processing. For example, Sep.11th needs to be expanded to be written as September Eleventh in full spelling. Optionally, the cloud server can use regular expressions to perform text regularization processing on text information. Then, because some words need to pause or reread between words when reading aloud, if the pause is inaccurate, the reading will be incoherent and unnatural, and even affect the expression of the corresponding voice information. Therefore, the cloud server also needs to perform rhythm prediction processing on the text information. For example, after the rhythm prediction of the text "Today's minimum temperature is 15 degrees Celsius", the pause mode can be obtained as "Today#Minimum temperature#15#Celsius". Optionally, the cloud server can use a deep network to perform rhythm prediction here, and the deep network used is obtained by training with rhythmic text data. Next, because some characters are polyphonic and have different pronunciations in different words, the cloud server needs to perform phonetic processing on the text information to accurately determine the pronunciation of each character in the text information. Optionally, the cloud server can also use a deep network to convert the text information into pinyin to solve the problem of polyphonic characters. The deep network used is trained using polyphonic character data. Optionally, after the phonetic processing, the cloud server can obtain the phoneme information corresponding to the text information.
[0100] After the text information is processed by the front end, the cloud server can perform dimension mapping processing (embedding), encoding processing (encoder) and time stretching processing on the text information. Among them, embedding refers to the process of mapping high-dimensional data (such as text, pictures, audio) to low-dimensional space; encoder refers to the process of integrating the features of the input text information and converting the feature blocks of high-dimensional abstraction; time stretching processing refers to stretching the reading time of the text information, that is, predicting the time when each word (or phoneme) is read, and adding the time information to the text information to obtain the total time frame information corresponding to the text information. For example, if the user reads a word for n seconds, then the total time frame information corresponding to the sentence containing 10 words is 10×n seconds. Optionally, when the cloud server performs time stretching processing on the text information, the corresponding stretching time can be determined based on the voice information in the training data A, because the text information and voice information in the training data A are corresponding, then after alignment processing, the voice time corresponding to the voice information can be used as the time to stretch the text information.
[0101] After the above processing, the cloud server can obtain the semantic features corresponding to the text information.
[0102] At the same time, the cloud server will also extract features from the voice information to obtain acoustic features. In other words, the cloud server can extract semantic features and acoustic features in parallel. Figure 8 , the cloud server extracts features from voice information, and the process of obtaining acoustic features may include audio encoding processing, multi-channel mapping processing (embedding) and multi-channel accumulation processing.
[0103] Among them, the cloud server can use an audio encoder to perform audio encoding processing on the voice information, and the obtained acoustic vector is the acoustic vector corresponding to the voice information. The acoustic vector here can be a multi-channel multi-frame feature vector, for example, it can be a feature vector of 8 channels. Of course, it can also be a feature vector of other numbers of channels. The embodiment of the present application does not limit this. Then, the cloud server can mask the feature vector of each channel in the acoustic vector and then embed it, that is, obtain a multi-channel embedding, for example, obtain an 8-channel embedding. Optionally, the embedding method of each channel feature vector can be acoustic_semb_i=embedding(mask(acoustic_i)), where the role of masking is to mask some frames in the multi-frame feature vector for subsequent decoder inference to train the accuracy of inference. Next, the cloud server can perform weighted accumulation of the multi-channel embeddings to obtain a feature vector of a channel, that is, to obtain the acoustic feature (acoustic). Optionally, the cloud server can be based on acoustic=∑ N i=1 (w_i×acoustic_semb_i) calculates the acoustic features, where w_i is the weight coefficient corresponding to the channel and N is the number of channels, for example, N=8.
[0104] After the above processing, the cloud server can obtain the acoustic features corresponding to the voice information. It can be understood that since the cloud server can determine the length of the voice corresponding to the voice information when stretching the text information, the length of the semantic features finally obtained is equal to the length of the acoustic features.
[0105] After obtaining the semantic features and acoustic features, the cloud server can start to construct a prompt that is independent of the text (the core part of the audio model, which requires learning the audio features in the prompt). Figure 8, the process may include: firstly generating a random number m, and dividing the semantic feature and the acoustic feature into two parts according to the random number m, wherein m is less than the length of the semantic feature (or the acoustic feature), preferably, ×len(semantic)≤m≤ ×len(semantic), len(semantic) is the length of the semantic feature. Then the cloud server divides the semantic feature into two parts, prompt_se and target_se, and divides the acoustic feature into two parts, prompt_ac and target_ac, according to the random number m. Next, the cloud server fuses the divided prompt_se and target_se, prompt_ac and target_ac through the audio model to obtain the target prompt and target target. Optionally, the target prompt=prompt_ac, the target target=a×target_se+b×target_ac, where a and b are weight coefficients. It can be seen that the target prompt here is independent of the semantic feature, that is, it is independent of the text. Then the target prompt can be used as the prompt information of the subsequent decoder, so that the decoder adds timbre to the text information according to the audio features carried in the target prompt, that is, the timbre of the output voice is as close as possible to the timbre corresponding to the above-mentioned input voice information, and the target target can be used as the learning content of the audio model.
[0106] After obtaining the target prompt and target, the cloud server can input the target prompt and target into the decoder for decoding to obtain a speech output result, and then compare the features of the output result with the acoustic features of the above-mentioned input speech information, calculate the loss function, and adjust the parameter values of the audio model according to the loss function to finally obtain a converged audio model. Optionally, the input method of the decoder can include decoder_in=cat(target prompt, target target).
[0107] For the above training phase, on the one hand, in the process of obtaining the acoustic features corresponding to the voice information, the obtained acoustic vector is a multi-channel feature vector. Taking the 8-channel feature vector as an example, the decoder in the audio model will perform multiple rounds of reasoning on each channel feature. Because the computing power of the cloud server is relatively strong, the multi-round reasoning process does not have a great impact on the computing time. However, if the audio model is subsequently migrated to the electronic device side, the computing power of the electronic device is lower than that of the cloud server. The multi-round reasoning process will affect the computing time of the electronic device, resulting in poor real-time performance of personalized speech synthesis. Therefore, in order to adapt to the computing power of the electronic device, the cloud server can reduce the number of rounds of reasoning for each channel feature during the training phase. The possible result of the cloud server reducing the number of rounds of reasoning is: because the cloud server masks the feature vector of each channel before providing it for subsequent decoder reasoning, the cloud server will generate a random number (for example, a ratio between 0 and 100%) as the mask ratio when masking, and then mask the feature vector according to the mask ratio (for example, mask 50% of the features in the feature vector); when performing multiple rounds of reasoning based on the feature vector of a certain channel, the same random number will be used for masking. However, when the audio model is actually applied to personalized speech synthesis, the audio model is to infer the text information to obtain the corresponding speech information. The speech information is unknown during the inference process, which is equivalent to the multi-channel features of its corresponding acoustic vector being unknown, which is equivalent to all being masked (it can be understood that the mask ratio is 100%). If the above cloud server reduces the number of inference rounds, and the random number during masking is significantly different from the ratio of 100%, the inference ability of the decoder in the audio model trained by the cloud server will be significantly different from the inference ability required in actual applications, that is, the inference accuracy is not high.
[0108] Therefore, the embodiment of the present application can optimize the masking strategy in the audio model training stage, and the adopted masking strategy is: in the reasoning process of different rounds, random numbers are generated as masking ratios according to different ratio intervals, and the ratio interval can be changed in an increasing gradient. For example, in some embodiments, in the first round of reasoning, random numbers are generated in the interval [0, 100%] as the masking ratio, in the second and third rounds of reasoning, random numbers are generated in the interval [40%, 100%] as the masking ratio, in the fourth and fifth rounds of reasoning, random numbers are generated in the interval [50%, 100%] as the masking ratio, in the sixth and seventh rounds of reasoning, random numbers are generated in the interval [60%, 100%] as the masking ratio, in the eighth and ninth rounds of reasoning, random numbers are generated in the interval [70%, 100%] as the masking ratio, and in the reasoning after the tenth round, random numbers are generated in the interval [80%, 100%] as the masking ratio. Alternatively, in some other embodiments, in the first round of reasoning, a random number is generated in the interval [0, 100%] as the mask ratio, in the second and third rounds of reasoning, a random number is generated in the interval [40%, 100%] as the mask ratio, in the fourth to seventh rounds of reasoning, a random number is generated in the interval [60%, 100%] as the mask ratio, and in the eighth and subsequent rounds of reasoning, a random number is generated in the interval [80%, 100%] as the mask ratio. In other words, as the number of reasoning rounds increases, the value in the value range of the mask ratio becomes larger and larger, which makes the mask ratio larger and larger, which will be closer to the mask ratio number (i.e., 100%) in actual applications, thereby making the reasoning ability of the decoder in the trained audio model closer to the reasoning ability required in actual applications, thereby improving the reasoning accuracy.
[0109] It should be noted that, in the process of generating random numbers as mask ratios according to different ratio intervals, the set ratio intervals are not limited to the intervals in the above-mentioned embodiments, and the correspondence between the set number of rounds and the ratio intervals is not limited to the examples in the above-mentioned embodiments. As long as the ratio intervals change in a gradient and make the mask ratio increase, the embodiments of the present application do not impose specific restrictions on this.
[0110] On the other hand, after obtaining the semantic features and acoustic features, the cloud server needs to construct prompt. According to the method in the above embodiment, "the semantic features are divided into two parts, prompt_se and target_se, and the acoustic features are divided into two parts, prompt_ac and target_ac, and then the divided prompt_se and target_se, prompt_ac and target_ac are fused to obtain the target prompt and target target", the target target is fused from target_se and target_ac. In the actual application of personalized speech synthesis, the audio model is to infer the text information to obtain the corresponding speech information. The speech information is unknown during the inference process, that is, there is no target_ac information; and because the target prompt (that is, prompt_ac) is the core prompt information of the subsequent inference process, the cloud server can consider the prompt_ac information when constructing the target target, and fuse prompt_ac, target_se and target_ac to obtain the target target, so as to increase the information content of the semantic features and thus improve the inference accuracy.
[0111] For example, Fig. 9 As shown, the cloud server can first fuse target_se and prompt_ac based on the cross attention mechanism (cross_attention), so that cross_attention (K / V=target_se, Q=prompt_ac), where cross_attention is an attention mechanism that mixes two different embedding sequences. The two sequences can be in different mode forms, one sequence as the input Q, and the other sequence provides the input K / V. Then, the cloud server performs a weighted addition of the result of cross_attention and target_ac to obtain the target target. In this embodiment, the target prompt can still be prompt_ac. After obtaining the target prompt and target target, they can be input into the decoder for decoding, and the training process continues.
[0112] On the other hand, when the cloud server inputs the target prompt and target into the decoder for decoding, the decoder adopts a transformer architecture or a conformer architecture. Taking the transformer architecture as an example, it can usually include a multi-headed self-attention module and a feed forward module. The multi-headed self-attention module is used to receive the input target prompt and target, and pass the output result to the feed forward module, and then pass the output result of the feed forward module to the multi-headed self-attention module, thereby outputting the final result after multiple iterations. In an embodiment of the present application, in order to improve the reasoning accuracy of the decoder, the cloud server can inject the information of the target prompt into each iteration to better learn the information of the target prompt. For example, Fig.10 As shown in the figure, the cloud server can add a self-attention module between the multi-headed self-attention module and the feed forward module. The multi-headed self-attention module is used to receive the input target prompt and target, and the self-attention module is used to receive the output result and target prompt of the multi-headed self-attention module. After calculation and processing, the output result is passed to the feed forward module for iteration.
[0113] Here we can set the target prompt=h, target target=y, assuming h=[h1, h2, h3…hH], y=[y1, y2, y3…yH], H represents the number of frames in the time domain, and then compress h into one-dimensional vectors g(w) and b(w), where, , Here, compressing h is equivalent to compressing the multi-dimensional vector in the time domain into a one-dimensional vector that can represent the user's timbre style, so that the subsequent inference results are closer to the user's timbre. The cloud server inputs h and y into the multi-headed self-attention module, and the output result is recorded as y'. Then y', g(w) and b(w) are input into the self-attention module. The output result Y_out is obtained by calculation, and then Y_out is passed to the feed forward module. In the subsequent iterations, the output result y' of the multi-headed self-attention module will change, but y', g(w) and b(w) will be input into the self-attention module for calculation, that is, g(w) and b(w) (i.e., the information of the target prompt) will be injected into the reasoning process in each iteration to better learn the information of the target prompt and improve the reasoning accuracy.
[0114] Therefore, based on the above three aspects, the input data and operation process of the decoder are optimized accordingly to enhance the decoder performance, so as to make up for the problem of model accuracy loss caused by the migration of the audio model to the electronic device side, thereby improving the personalized speech inference accuracy of the electronic device.
[0115] After the above process, the cloud server constructs the audio model required by the embodiment of the present application. If the user registers a custom timbre on the electronic device, the audio model can obtain the audio features of the custom timbre. For example, in the scenario of the voice assistant function, the audio model can combine the audio features and the queried text information to infer and generate personalized voice. In the scenario of the AI call function, the audio model can combine the audio features and the text information input by the user to infer and generate personalized voice. In some embodiments, the process of generating personalized voice by audio model inference can still be executed on the cloud server, so this requires the electronic device to send the voice information and subsequent text information when the user customizes the timbre to the cloud server. In other embodiments, the process of generating personalized voice by audio model inference can also be executed on the electronic device, so this requires the cloud server to transplant the trained converged audio model to the electronic device. The following is described as an example of execution by an electronic device.
[0116] like Fig.11As shown, after the user registers for a custom timbre, the electronic device can record the voice information recorded during registration, and extract the audio features of the voice information to obtain the audio features corresponding to the user. Optionally, the electronic device can correspond the user's identification and audio features and store them in a feature library, where the user's identification can be the user name used by the user when registering on the electronic device, the device identification of the electronic device used, and other information, and the embodiment of the present application does not limit this. Then, if the electronic device receives text information (which can be text information input by the user or text information queried by the electronic device background), the text information can be first processed by front-end processing such as text regularization, rhythm prediction, and phonetic processing, and then the text information processed by the front-end and the audio features corresponding to the user are input into the audio model for reasoning, and personalized voice is output. Optionally, the audio model can include parts such as an encoder, an acoustic model, and a decoder, the encoder is used to extract features from the text information, the acoustic model is used to convert the text information into audio acoustic features (i.e., the process of constructing prompt) in combination with the audio features, and the decoder is used to convert the audio acoustic features into audio for output. It can be understood that, unlike the above-mentioned audio model training process, the text information and voice information in the training data are grouped in correspondence during the training process, while in the process of inference to generate personalized voice, the text information received by the electronic device changes in real time, and the audio features used are extracted when the user customizes the tone registration. The purpose is to output the real-time changing text information as personalized voice with the user's tone based on the user's audio features.
[0117] for Fig.11 The embodiment shown, combined with Fig.12Describe the execution process of the electronic device: After receiving the voice information recorded when the user registers the customized timbre, the electronic device can perform audio encoding processing, multi-channel mapping processing (embedding) and multi-channel accumulation processing on the voice information to obtain the acoustic features (acoustic) corresponding to the voice information as the audio features corresponding to the user, and store the audio features and the user's identification in the feature library in correspondence. When the electronic device receives text information, it can perform front-end processing on the text information to obtain the phoneme information (phoneme) corresponding to the text information. After the front-end processing of the text information, the electronic device can perform dimensional mapping processing (embedding), encoding processing (encoder) and time stretching processing on the text information (phoneme information) to obtain the semantic features (semantic) corresponding to the text information. Next, the electronic device can combine the audio features (acoustic) and semantic features (semantic) through the audio model, use the audio features (acoustic) as prompts, input them into the decoder for processing, and output personalized voice. Here, when the electronic device combines the audio feature (acoustic) and the semantic feature (semantic), the audio feature (acoustic) can be used as the target prompt, and the cross_attention result of the semantic feature (semantic) and the audio feature (acoustic) can be used as the target target, so that cross_attention (K / V=semantic, Q=acoustic), and then the target prompt and the target target are input into the decoder for processing, and the personalized voice is output. At the same time, when the decoder is decoding, the information of the target prompt is also injected into each iteration. The processing process can be referred to the description of the above training stage. The implementation principle is similar and will not be repeated.
[0118] In addition, when the electronic device performs time-stretching processing on the text information, since there is no voice information corresponding to the text information to determine the stretching time, the electronic device can predict the stretching time based on the time prediction model. The time prediction model here can be a network model trained in parallel during the training of the above audio model, that is, in the above Figure 8 In the process shown, the cloud server can obtain a duration prediction model based on the encoder result of the text information and prompt_ac through the cross attention mechanism. Therefore, in the process of inferring and generating personalized voice, the electronic device can use the duration prediction model, input the audio features (acoustic) and the encoder result, obtain the stretched duration, and then perform time stretching processing on the text information (or phoneme information).
[0119] It can be seen from the processing process of the above audio model that the embodiment of the present application constructs an audio model that is unrelated to text during training. Prompt is used as prompt information, and any subsequent text information input can infer the voice information corresponding to the timbre carried in prompt. Therefore, when used in actual scenarios, users only need to record shorter sentences when registering, extract the user's audio features as prompt input audio model to output personalized voice, and no post-fine-tuning process is required, making data processing more efficient. At the same time, the audio model migrated to the electronic device side optimizes the input data and operation process of the decoder accordingly, enhances the performance of the decoder, and makes it possible to make up for the problem of model accuracy loss caused by compression or miniaturization during the migration of the audio model to the electronic device side, thereby improving the personalized voice reasoning accuracy of the electronic device.
[0120] It is understood that the software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. If the electronic device uses audio model reasoning to generate personalized voice, it should be executed in combination with the software system architecture of the electronic device. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device.
[0121] Fig.13 It is a software structure block diagram of the electronic device of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can include a series of application packages, such as the Android application package (Android application package, APK).
[0122] like Fig.13 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, music, video, short message, etc. It may also include an APK integrated with an audio model, which can realize the functions of user-defined timbre registration and inference generation of personalized voice based on the user's audio features and input text information.
[0123] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0124] like Fig.13 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0125] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0126] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0127] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0128] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0129] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0130] The system library can include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0131] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0132] When the electronic device executes the above-mentioned personalized speech synthesis method, Fig.14 is a flowchart of a personalized speech synthesis method provided in an embodiment of the present application, such as Fig.14 As shown, the method may include:
[0133] S101, when a speech synthesis function is enabled in an electronic device, obtaining text information that needs to be speech synthesized in the electronic device.
[0134] Among them, the text information includes text information input by the user and text information generated by the electronic device. The text information input by the user can be the information input by the user to reply to the other user in the scenario of the AI call function, and the text information generated by the electronic device can be the information to be replied to the user retrieved by the electronic device in the scenario of the voice assistant function.
[0135] S102, input the text information and the audio features corresponding to the user into the audio model for speech synthesis, and output personalized speech.
[0136] The audio features corresponding to the user are features generated based on the voice information entered by the user when registering the speech synthesis function, and the audio model is a text-independent model obtained by training based on the first text information and the first voice information in the training data. The processing process of the audio model can be found in the description of the above embodiment, and will not be repeated here.
[0137] The above describes in detail an example of a personalized speech synthesis method provided by an embodiment of the present application. It is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of the present application.
[0138] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0139] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0140] The electronic device provided in this embodiment is used to execute the above-mentioned personalized speech synthesis method, and thus can achieve the same effect as the above-mentioned implementation method.
[0141] In the case of an integrated unit, the electronic device may further include a processing module, a storage module and a communication module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device to execute stored program codes and data, etc. The communication module may be used to support the electronic device to communicate with other devices.
[0142] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.
[0143] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 3 Device of the structure shown.
[0144] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the personalized speech synthesis method of any of the above embodiments.
[0145] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the personalized speech synthesis method in the above-mentioned embodiment.
[0146] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the personalized speech synthesis method in the above-mentioned method embodiments.
[0147] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0148] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0149] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0150] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0151] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0152] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0153] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A personalized speech synthesis method, characterized in that: The method is performed by an electronic device and includes: When a speech synthesis function is enabled on the electronic device, obtaining text information that needs to be speech synthesized in the electronic device, and extracting semantic features corresponding to the text information, wherein the text information includes text information input by a user and text information generated by the electronic device; Acquire an audio feature corresponding to the user, where the audio feature is a feature generated according to voice information entered by the user when registering for a speech synthesis function; The audio feature is used as a first target feature, and a fusion result of the audio feature and the semantic feature is used as a second target feature, and the first target feature and the second target feature are processed by an audio model to output a personalized voice, wherein the audio model is a text-independent model obtained by training according to first text information and first voice information in training data; The training process of the audio model includes: extracting a first semantic feature corresponding to the first text information and a first acoustic feature corresponding to the first voice information, wherein the data length of the first semantic feature is equal to the data length of the first acoustic feature; Dividing the first semantic feature into a first sub-feature and a second sub-feature according to the generated random number m, and dividing the first acoustic feature into a third sub-feature and a fourth sub-feature; using the third sub-feature as a third target feature, and generating a fourth target feature according to the second sub-feature, the third sub-feature and the fourth sub-feature; The third target feature and the fourth target feature are input into the audio model to obtain an output result, and according to the loss between the output result and the first acoustic feature, the parameter value of the audio model is adjusted until the audio model converges.
2. The method according to claim 1, characterized in that The step of taking the fusion result of the audio feature and the semantic feature as the second target feature includes: The audio feature and the semantic feature are fused based on a cross-attention mechanism to obtain the second target feature.
3. The method according to claim 1 or 2, characterized in that: The audio model includes a first module, a second module and a third module, and the processing of the first target feature and the second target feature by the audio model to output personalized speech includes: Inputting the first target feature and the second target feature into the first module, and outputting a first result; Inputting the first target feature and the first result into the second module, and outputting a second result; The second result is input into the third module, the third result is output, and the third result is returned to the first module, and the process is repeated until the personalized voice is output.
4. The method according to claim 3, characterized in that The step of inputting the first target feature and the first result into the second module and outputting a second result comprises: Performing dimension conversion on the first target feature to obtain a one-dimensional vector corresponding to the first target feature; The one-dimensional vector and the first result are input into the second module, and the second result is output.
5. The method according to claim 1, characterized in that The extracting the semantic features corresponding to the text information includes: Performing front-end processing on the text information to obtain phoneme information corresponding to the text information, wherein the front-end processing includes at least one of text regularization processing, prosody prediction processing, and phonetic notation processing; The phoneme information is subjected to dimension mapping, encoding and time-stretching processing to obtain semantic features corresponding to the text information.
6. The method according to claim 5, characterized in that Before performing time-stretching processing on the phoneme information, the method further includes: The stretched duration corresponding to the phoneme information is predicted based on a preset duration prediction model, wherein the duration prediction model is a model trained according to the encoding result corresponding to the first text information and the acoustic features corresponding to the first speech information in the training data.
7. The method according to claim 1, characterized in that The obtaining of the audio feature corresponding to the user includes: Acquire the voice information entered by the user when registering for the speech synthesis function; The recorded voice information is subjected to audio encoding processing, multi-channel mapping processing and multi-channel accumulation processing to obtain audio features corresponding to the user.
8. The method according to claim 7, characterized in that The number of phrases corresponding to the input voice information is N≤2.
9. The method according to claim 7 or 8, characterized in that: After obtaining the audio feature corresponding to the user, the method further includes: The audio features corresponding to the user are associated with the user's identification and stored in a feature library.
10. The method according to claim 1, characterized in that When the electronic device is in a scenario where a voice assistant is used, the text information is text information generated by the electronic device; when the electronic device is in a scenario where artificial intelligence (AI) is used for a call, the text information is text information input by the user.
11. A method for training an audio model, characterized in that: The method is executed by a server and includes: Acquire first text information and first voice information in training data; Extracting a first semantic feature corresponding to the first text information and a first acoustic feature corresponding to the first voice information, wherein a data length of the first semantic feature is equal to a data length of the first acoustic feature; Generate a random number m, divide the first semantic feature into a first sub-feature and a second sub-feature according to the random number m, and divide the first acoustic feature into a third sub-feature and a fourth sub-feature; using the third sub-feature as a third target feature, and generating a fourth target feature according to the second sub-feature, the third sub-feature and the fourth sub-feature; Inputting the third target feature and the fourth target feature into an audio model to obtain an output result; According to the loss between the output result and the first acoustic feature, the parameter value of the audio model is adjusted until the audio model converges.
12. The method according to claim 11, characterized in that The generating a fourth target feature according to the second sub-feature, the third sub-feature and the fourth sub-feature comprises: The second sub-feature and the third sub-feature are fused based on a cross attention mechanism to obtain a fusion result; The fusion result and the fourth sub-feature are weightedly added to obtain the fourth target feature.
13. The method according to claim 11 or 12, characterized in that: The audio model includes a first module, a second module and a third module, and the third target feature and the fourth target feature are input into the audio model to obtain an output result, including: Inputting the third target feature and the fourth target feature into the first module, and outputting a fourth result; Inputting the third target feature and the fourth result into the second module, and outputting a fifth result; The fifth result is input into the third module, a sixth result is output, and the sixth result is returned to the first module, and the process is repeated until the output result is obtained.
14. The method according to claim 11, characterized in that The first acoustic feature includes multi-channel feature vectors, and the feature vector of each channel is a vector that has been processed by masking.
15. The method according to claim 14, characterized in that The first acoustic feature participates in multiple rounds of iterative calculations of the audio model, and the process of performing mask processing on the feature vector of each channel includes: During the i-th round of calculation, a random number is generated from the proportion interval of [Ai, 100%] as a mask ratio, and the first eigenvector is masked according to the mask ratio, wherein the left interval Ai+1 of the proportion interval corresponding to the i+1-th round of calculation is greater than the left interval Ai of the proportion interval corresponding to the i-th round of calculation, and the first eigenvector is any one of the eigenvectors of the multi-channel, i≥1.
16. The method according to claim 11, characterized in that The value range of the random number m is [ × L, ×L], where L is the data length of the first semantic feature.
17. An electronic device, characterized in that: include: one or more processors; one or more memories; The memory stores one or more programs, and when the one or more programs are executed by the processor, the electronic device executes the method according to any one of claims 1 to 10.
18. A server, characterized in that: include: one or more processors; one or more memories; The memory stores one or more programs, and when the one or more programs are executed by the processor, the server executes the method according to any one of claims 11 to 16.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 16.
