Personalized speech synthesis method, electronic device, server and storage medium
By using a two-level duration prediction model and audio model in electronic devices, combined with the user's audio features and text features, the problem of difficult to capture rhythm and timbre features in speech synthesis is solved, achieving more personalized speech synthesis and improving user experience. experience.
Patent Information
- Application Number
- CN202410510488.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-04-26
AI Technical Summary
It is difficult for existing electronic devices to effectively capture the user's rhythm and timbre characteristics during the speech synthesis process, resulting in synthesized speech that is not personalized enough and the user experience is poor.
Using a two-level duration prediction model combined with an audio model, speech synthesis is performed based on the user's audio features and text features, and the speech duration is predicted and adjusted to make the synthesized speech closer to the user's rhythm and timbre.
The personalized effect of speech synthesis is improved, making the output speech closer to the user's actual rhythm and timbre, and improving the user experience.
Smart Images

Figure CN118098199B
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a personalized speech synthesis method, electronic equipment, server and storage medium. 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 scenarios, 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 electronic device outputs the voice with the user's own timbre. For this function, how to make the synthesized voice closer to the user's actual rhythm and other features is a problem that needs to be solved. Summary of the invention
[0004] The present application provides a personalized speech synthesis method, electronic device, server and storage medium, which can make the rhythm and other characteristics of the synthesized personalized speech closer to the actual characteristics of the user, and the speech synthesis effect is better.
[0005] In a first aspect, the present application provides a personalized speech synthesis method, the method comprising: when a speech synthesis function is turned on in an electronic device, obtaining text information that needs to be speech synthesized in the electronic device, the text information including text information input by a user and text information generated by the electronic device; obtaining audio features and text features corresponding to the user, the audio features being features generated based on the voice information entered by the user when registering for the speech synthesis function, and the text features being features generated based on the registered text information read aloud by the user when registering for the speech synthesis function; determining a stretching duration for speech synthesis of the text information based on the audio features, the text features and the encoding results corresponding to the text information; based on the stretching duration, performing speech synthesis on the text information and the audio 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] It should be noted that the personalized speech synthesis method in the present application can be executed by an electronic device or by a server (such as a cloud server). In the first aspect, execution by an electronic device is taken as an example for explanation.
[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 (i.e., registration text), 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 process the text information and the audio features corresponding to the user based on the trained audio model to obtain a personalized voice with the user's timbre. The audio model here is a text-independent model obtained by training according to the first text information and the first voice information in the training data. Then, when processing the text information and the audio features corresponding to the user, the audio model can use the audio features corresponding to the user as a prompt to synthesize a voice with the user's timbre for output. In order to make the rhythm and other features of the output voice information closer to the actual features of the user, it is necessary to effectively predict the duration corresponding to the voice information. Therefore, in the present application, the current text information is predicted to be stretched based on the audio features and text features when the user registers for the speech synthesis function, and the text information and audio features are speech synthesized based on the stretched duration to improve the effect of speech synthesis.
[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 determination of the stretched duration when performing speech synthesis on the text information based on the encoding results corresponding to the audio features, text features and text information includes: inputting the audio features and text features into a first duration prediction model, and outputting a first predicted duration; inputting the encoding results corresponding to the first predicted duration and the text information into a second duration prediction model, and outputting the stretched duration.
[0011] Among them, in order to improve the prediction accuracy of stretched duration to improve the effect of speech synthesis, the present application adopts a two-level duration prediction model. The first duration prediction model outputs a first predicted duration based on the audio features and text features corresponding to the user, and then inputs the encoding result corresponding to the first predicted duration and the text information to be speech synthesized into the second duration prediction model. The first predicted duration is used as prompt information to output the second predicted duration, which is the above-mentioned stretched duration.
[0012] In combination with the first aspect, in some implementations of the first aspect, the training methods of the first duration prediction model and the second duration prediction model include:
[0013] Acquire a first semantic feature corresponding to the first text information and a first acoustic feature corresponding to the first voice information;
[0014] Aligning the first semantic feature with the first acoustic feature to determine a first stretching duration feature corresponding to the first semantic feature;
[0015] Generate a random number k, divide the first semantic feature into a first sub-feature and a second sub-feature according to the random number k, divide the first stretch duration feature into a third sub-feature and a fourth sub-feature, and divide the first acoustic feature into a fifth sub-feature and a sixth sub-feature;
[0016] Inputting the first sub-feature and the fifth sub-feature into the first duration prediction model, and adjusting the parameter value of the first duration prediction model according to the loss between the output result and the third sub-feature, so that the first duration prediction model converges;
[0017] The second sub-feature and the third sub-feature are input into the second duration prediction model, and according to the loss between the output result and the fourth sub-feature, the parameter value of the second duration prediction model is adjusted until the second duration prediction model converges.
[0018] It can be understood that if the above two-level duration prediction model is to be used, the first duration prediction model and the second duration prediction model need to be trained, and the training data used in the training process can be consistent with the training data used by the above audio model. First, the electronic device can perform front-end processing, dimension mapping processing (embedding), encoding processing (encoder) and duration stretching processing (LR) on the first text information in the training data to obtain a first semantic feature (semantic), and then perform audio encoding processing, multi-channel mapping processing (embedding) and multi-channel accumulation processing on the first voice information in the training data to obtain a first acoustic feature (acoustic). At the same time, when the first semantic feature is aligned with the first acoustic feature, the first stretched duration feature (duration) corresponding to the first semantic feature can be obtained. Then, the electronic device can generate a random number k, divide the first semantic feature into a first sub-feature prompt_se and a second sub-feature target_se, divide the first stretched duration feature into a third sub-feature prompt_dur and a fourth sub-feature target_dur, and divide the first acoustic feature into a fifth sub-feature prompt_ac and a sixth sub-feature target_ac. Next, prompt_se and prompt_ac can be input into the first duration prediction model to predict the first duration pmt_dur_predict when the user voice outputs the phoneme corresponding to prompt_se, and the first loss between pmt_dur_predict and prompt_dur is calculated, and the model parameters of the first duration prediction model are adjusted based on the first loss until the training converges; then prompt_dur and target_se are input into the second duration prediction model, and prompt_dur is used as the prompt information to predict the second duration tg_dur_predict when the user voice outputs the phoneme corresponding to target_se, and the second loss between tg_dur_predict and target_dur is calculated, and the model parameters of the second duration prediction model are adjusted based on the second loss until the training converges.
[0019] Since prompt_dur and target_se are input during the training of the second duration prediction model, the amount of information is greatly reduced compared to prompt_ac. Therefore, the interference of irrelevant information can be reduced, the convergence effect of the duration prediction model can be improved, and the accuracy of the predicted speech duration can be improved, thereby improving the effect of speech synthesis.
[0020] In combination with the first aspect, in some implementations of the first aspect, the value range of the random number k is [ , ], L is the data length of the first semantic feature.
[0021] In combination with the first aspect, in some implementations of the first aspect, dividing the first semantic feature into the first sub-feature and the second sub-feature according to the random number k includes: taking a feature of length k starting from the first position of the first semantic feature as the first sub-feature, and combining the remaining features as the second sub-feature;
[0022] Dividing the first stretching duration feature into a third sub-feature and a fourth sub-feature includes: taking a feature of length k from the first position of the first stretching duration feature as the third sub-feature, and combining the remaining features as the fourth sub-feature;
[0023] The first acoustic feature is divided into a fifth sub-feature and a sixth sub-feature, including: taking a feature of length k from the first position of the first acoustic feature as the fifth sub-feature, and combining the remaining features as the sixth sub-feature.
[0024] When using the random number k to divide each feature, considering that there may be a period of blank speech at the beginning of the user's speech, if the semantic features and acoustic features are divided into two parts, there may be some null values in the features of the front part. If the features of the front part are recorded as prompts for subsequent use as prompt information, the null values will affect the prediction accuracy. Therefore, in this application, the electronic device can intercept the middle part of the semantic features, stretching duration, and acoustic features according to the random number k, and then combine the remaining parts to obtain the prompt and target of each feature.
[0025] In combination with the first aspect, in some implementations of the first aspect, the above-mentioned speech synthesis of text information and audio features based on stretched duration is performed through an audio model to output personalized speech, including: extracting features of text information through an audio model to obtain semantic features with the length of stretched duration corresponding to the text information; performing speech synthesis of semantic features and audio features through an audio model to output personalized speech.
[0026] Among them, when the electronic device uses an audio model to perform speech synthesis on text information and audio features corresponding to the user, it can first perform feature extraction on the text information based on the stretching duration to obtain semantic features with the length of the stretching duration, and then perform speech synthesis based on the semantic features and the audio features corresponding to the user.
[0027] In some implementations, the electronic device may first perform front-end processing such as text regularization, rhythm prediction, and phonetic notation on the text information to obtain the phoneme information corresponding to the text information, and then perform dimension mapping, encoding, and time stretching on the phoneme information through an audio model to obtain semantic features with a stretched duration.
[0028] 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.
[0029] 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.
[0030] In combination with the first aspect, in some implementation methods of the first aspect, the above-mentioned acquisition of audio features and text features corresponding to the user includes: acquiring the voice information entered by the user when registering for the speech synthesis function, and the registered text information read aloud 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; performing front-end processing on the registered text information to obtain text features.
[0031] 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 (ie, the registered text) 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 the present application, when the user enters the voice information, the number of short sentences N≤2 corresponding to the reading.
[0032] 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, and perform front-end processing on the registered text information to obtain text features. 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.
[0033] 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.
[0034] In a second aspect, the present application provides a method for training a duration prediction model, the method comprising:
[0035] Acquire first text information and first voice information in training data;
[0036] Extracting a first semantic feature corresponding to the first text information and a first acoustic feature corresponding to the first voice information;
[0037] Aligning the first semantic feature with the first acoustic feature to determine a first stretching duration feature corresponding to the first semantic feature;
[0038] Generate a random number k, divide the first semantic feature into a first sub-feature and a second sub-feature according to the random number k, divide the first stretch duration feature into a third sub-feature and a fourth sub-feature, and divide the first acoustic feature into a fifth sub-feature and a sixth sub-feature;
[0039] Inputting the first sub-feature and the fifth sub-feature into the first duration prediction model, and adjusting the parameter value of the first duration prediction model according to the loss between the output result and the third sub-feature, so that the first duration prediction model converges;
[0040] The second sub-feature and the third sub-feature are input into the second duration prediction model, and according to the loss between the output result and the fourth sub-feature, the parameter value of the second duration prediction model is adjusted until the second duration prediction model converges.
[0041] Among them, the training process of the duration prediction model can refer to the description of the first aspect above. Since the third sub-feature prompt_dur and the second sub-feature target_se are input during the training of the second duration prediction model, the amount of information is greatly reduced compared to prompt_ac. Therefore, it can reduce the interference of irrelevant information, improve the convergence effect of the duration prediction model, and then improve the accuracy of the predicted speech duration, thereby improving the effect of speech synthesis.
[0042] 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, or has the function of implementing the electronic device behavior in the second aspect. The function can be implemented by hardware, or it can be implemented 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.
[0043] 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 method in the technical solution of the first aspect, or executes the method in the technical solution of the second aspect.
[0044] 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 method in the technical solution of the first aspect, or executes the method in the technical solution of the second aspect.
[0045] In one implementation, the server may be a cloud server. After obtaining the personalized voice, the cloud server may return the personalized voice to the electronic device, and the electronic device may output the personalized voice or send it to other electronic devices.
[0046] 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 technical solution of the second aspect.
[0047] Optionally, the chip also includes a memory, and the memory is connected to the processor via a circuit or wire.
[0048] Further optionally, the chip also includes a communication interface.
[0049] 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 technical solution of the second aspect.
[0050] In an eighth aspect, the present application provides a computer program product, which includes: a computer program code, which, when executed 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 a method in the technical solution of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 This is an application scenario diagram of a voice assistant function provided in an embodiment of the present application;
[0052] Figure 2 This is an application scenario diagram of an AI call function provided in an embodiment of the present application;
[0053] Figure 3is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0054] Figure 4 This is a schematic diagram of an interface for setting a voice assistant function provided in an embodiment of the present application;
[0055] Figure 5 This is a schematic diagram of an interface for a custom tone setting process provided in an embodiment of the present application;
[0056] Figure 6 is a schematic diagram of another interface of a custom tone setting process provided in an embodiment of the present application;
[0057] Figure 7 is another interface schematic diagram of a custom tone setting process provided in an embodiment of the present application;
[0058] Figure 8 is a schematic diagram of an audio model training process provided in an embodiment of the present application;
[0059] Fig. 9 is a schematic diagram of a duration prediction model training process provided in an embodiment of the present application;
[0060] Fig.10 This is a process diagram of a personalized speech synthesis method provided in an embodiment of the present application;
[0061] Fig.11 is a process diagram of another personalized speech synthesis method provided in an embodiment of the present application;
[0062] Fig.12 This is a schematic diagram of a process for predicting stretching duration provided in an embodiment of the present application;
[0063] Fig.13 is a software structure block diagram of an electronic device provided in an embodiment of the present application;
[0064] Fig.14 It is a flowchart of a personalized speech synthesis method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] 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.
[0066] 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.
[0067] With the continuous development of electronic devices, the rich functions of electronic devices have provided great convenience for users' lives. For example, when the electronic device turns on the voice assistant function (such as the A assistant function), 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, the user inputs "How is the weather today", and 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 by voice. For example, the user inputs "Open A application" by voice, and the electronic device can reply with voice "OK" and enter the interface of A application. For another example, when the electronic device turns on the AI call function, 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 voice to the other electronic device.
[0068] 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.
[0069] In the scenario of the AI call function, for example, Figure 2As 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.
[0070] 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.
[0071] 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 using the user's own voice to reply to the other party, which makes the user experience better.
[0072] In the related art, electronic devices usually need to construct an audio model, through which the audio features of the user when customizing the timbre and the text information to be outputted are processed, and the voice information with the user's timbre corresponding to the text information is outputted. However, in this process, since the voice information corresponding to each text has a voice duration, if an effective prediction of the voice duration is not made, the rhythm and other characteristics of the output voice information may be different from the actual characteristics of the user, that is, the synthesis effect of personalized voice is not good.
[0073] In view of this, the embodiment of the present application provides a personalized speech synthesis method. When predicting the speech duration of text information, a two-level duration prediction model is used to improve the accuracy of the predicted speech duration, so that the rhythm and other characteristics of the personalized speech synthesized by the audio model are closer to the actual characteristics of the user, and the speech synthesis effect is better. It should be noted that the personalized speech synthesis method provided by 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.
[0074] For example, Figure 31 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.
[0075] 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.
[0076] 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.
[0077] 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.
[0078] 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.
[0079] 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.
[0080] 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.
[0081] 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.
[0082] 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).
[0083] 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.
[0084] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0085] 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.
[0086] 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.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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 assistant 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.
[0092] 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, the user can choose assistant (male voice), assistant (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.
[0093] 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.
[0094] 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.
[0095] 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.
[0096] 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.
[0097] 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.
[0098] 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.
[0099] 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, dimension 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.
[0100] 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.
[0101] 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.
[0102] After the above processing, the cloud server can obtain the semantic features corresponding to the text information.
[0103] 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.
[0104] 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.
[0105] 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.
[0106] 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.
[0107] 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).
[0108] In the training process of the above-mentioned audio model, when the cloud server performs time stretching on the text information, the stretching time is determined because the voice information corresponding to the text information is available at this time. However, when the audio model is subsequently used to generate personalized voice for the text information obtained by the electronic device, the obtained text information does not have corresponding voice information to determine the stretching time, so it is necessary to predict the stretching time corresponding to the text information. Therefore, in the training process of the audio model, the embodiment of the present application can also train a time prediction model for subsequent prediction of the stretching time of the text information.
[0109] In some embodiments, the cloud server can obtain the encoder results corresponding to the text information in the above training data and input the prompt_ac divided by acoustic features into the network model for training, and obtain the duration prediction model through cross attention training. However, because prompt_ac carries a lot of acoustic feature information, such as the user's semantic information, timbre information, sound speed information and even environmental noise information, if prompt_ac is used as input data for training, the duration prediction model may be interfered by more information during the learning and training process, and the predicted stretch duration will be averaged, resulting in poor convergence of the duration prediction model and poor effect of the subsequently generated personalized speech.
[0110] In other embodiments, in order to improve the training accuracy of the duration prediction model, this embodiment performs information dimensionality reduction on the input data during training, and adopts a two-level duration prediction model to train a duration prediction model with better convergence effect.
[0111] Specifically, in the training process of the above audio model, when the semantic features or encoder results corresponding to the text information are obtained, they can be aligned with the acoustic features, that is, the stretching duration corresponding to the semantic features can also be obtained, so the cloud server can obtain the semantic features, stretching duration, and acoustic features corresponding to the voice information. Then, Fig. 9 As shown, the cloud server can divide the semantic features, stretching duration and acoustic features. At this time, a random number k can be generated to divide the semantic features, stretching duration and acoustic features into multiple parts according to the random number k, wherein k is less than the length of the semantic feature (or acoustic feature). When dividing, considering that there may be a period of blank speech when the user starts speaking, if the semantic features and acoustic features are divided into two parts, the front part may have some null values in the features of the front part, then when the features of the front part are recorded as prompt for subsequent use as prompt information, the null value will affect the prediction accuracy. Therefore, in this embodiment, the cloud server can intercept the middle part of the semantic features, stretching duration and acoustic features according to the random number k, and then combine the remaining parts to obtain the prompt and target of each feature.
[0112] For example, Fig. 9As shown, for semantic features (semantic), a feature of length k is taken from the first position as prompt_se, and then some features before and after the prompt_se are combined as target_se. For the stretched duration (duration) feature, a feature of length k is taken from the first position as prompt_dur, and then some features before and after the prompt_dur are combined as target_dur. For acoustic features (acoustic), a feature of length k is taken from the first position as prompt_ac, and then some features before and after the prompt_ac are combined as target_ac. It can be understood that the first position can also be a preset intermediate position, or a position determined according to another random number t, and the embodiment of the present application does not limit this. It can also be understood that the split prompt_se, prompt_dur and prompt_ac are features corresponding to the same position in the text information, stretched duration, and voice information.
[0113] Optionally, the value range of the random number k can be: ×len(semantic)≤k≤ ×len(semantic), len(semantic) is the length of the semantic feature (or the length of the acoustic feature). The first position can be a position between one third and one half of the semantic feature (or acoustic feature, stretched duration feature).
[0114] After obtaining prompt_se and target_se, prompt_dur and target_dur, prompt_ac and target_ac, they can be used as input data to train the two-level duration prediction model. In the embodiment of the present application, the two-level duration prediction model can be recorded as the first duration prediction model and the second duration prediction model respectively. First, the first duration prediction model is trained. The cloud server can input prompt_se and prompt_ac into the first duration prediction model, and predict the first duration pmt_dur_predict when the user's voice outputs the phoneme corresponding to prompt_se through the audio feature prompt_ac in the voice information. Because the actual stretching duration prompt_dur corresponding to prompt_se is known, the first loss (prompt_duration_loss) between pmt_dur_predict and prompt_dur can be calculated, and the model parameters of the first duration prediction model can be adjusted based on the first loss until the training converges. Then, the second duration prediction model is trained. The cloud server can input prompt_dur and target_se into the second duration prediction model, and use prompt_dur as the prompt information to predict the second duration tg_dur_predict when the user's voice outputs the phoneme corresponding to target_se. Since the actual stretched duration target_dur corresponding to target_se is known, the second loss (duration_loss) between tg_dur_predict and target_dur can be calculated, and the model parameters of the second duration prediction model can be adjusted based on the second loss until the training converges.
[0115] As a result, the cloud server trained the first duration prediction model and the second duration prediction model. During the training of the second duration prediction model, since the inputs are prompt_dur and target_se, the amount of information is greatly reduced compared to prompt_ac. Therefore, the interference of irrelevant information can be reduced, and the convergence effect of the duration prediction model can be improved, thereby improving the accuracy of the predicted speech duration.
[0116] In addition, since in this embodiment the cloud server obtains the corresponding prompt and target by intercepting the middle part of the semantic features, stretching duration and acoustic features according to the random number k, when constructing the target prompt and target target in the training process of the above-mentioned audio model, they can also be constructed according to the prompt_se and target_se, prompt_ac and target_ac obtained in this embodiment, and then the target prompt and target target are input into the decoder for decoding to participate in the training process of the audio model, thereby improving the training accuracy of the audio model.
[0117] After the above process, the cloud server constructs the audio model and secondary duration prediction 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 a description of the execution of the cloud server as an example.
[0118] like Fig.10As shown, after the user registers for a custom timbre, the electronic device can send the voice information recorded during registration to the cloud server. The cloud server can extract audio features from the voice information to obtain the audio features corresponding to the user. Optionally, the cloud server 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 cloud server receives the text information sent by the electronic device (which can be the text information input by the user or the text information queried by the electronic device background), the cloud server can first perform front-end processing such as text regularization processing, rhythm prediction processing, and phonetic processing on the text information, and then input the text information processed by the front end and the audio features corresponding to the user into the audio model for reasoning, output personalized voice and return it to the electronic device. 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 audio 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 cloud server 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.
[0119] for Fig.10 The embodiment shown, combined with Fig.11Describe the execution process of the cloud server: After receiving the voice information recorded when the user registers the customized timbre, the cloud server 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. In the case where the cloud server receives text information, the text information can be processed by the front end to obtain the phoneme information (phoneme) corresponding to the text information. 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 (phoneme information) to obtain the semantic features (semantic) corresponding to the text information. Next, the cloud server can combine the audio features (acoustic) and semantic features (semantic) through the audio model, use the audio features (acoustic) as a prompt, input them into the decoder for processing, and output personalized voice. It can be understood that the cloud server can return the obtained personalized voice to the electronic device, which is output to the user through the voice assistant function or transmitted to the peer electronic device through the AI call function.
[0120] When the cloud server performs time stretching on the text information, since there is no voice information corresponding to the text information to determine the stretching time, the cloud server will predict the stretching time based on the secondary time prediction model constructed above. Fig.12 As shown, in the process of obtaining the acoustic features (acoustic) corresponding to the user-defined timbre registration by the cloud server, the registered text input by voice during registration can also be processed, for example, the registered text is processed by front-end processing including text regularization processing, prosody prediction processing and phonetic processing, and the phoneme information (phoneme) corresponding to the registered text is obtained, and the phoneme information can be used as the text features corresponding to the registered text. Then, the acoustic features (acoustic) and the phoneme information (phoneme) corresponding to the registered text are input into the first duration prediction model, and the first predicted duration is output. Then, the result after the above-mentioned cloud server encodes the received text information (encoder) is used as semantic, and the first predicted duration and the semantic are input into the second duration prediction model, and the first predicted duration is used as prompt information, and the second predicted duration is output. The second predicted duration is the stretched duration when the text information is stretched.
[0121] 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 independent of 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, when converting text information into personalized voice, the duration prediction stage is no longer disturbed by more information in the acoustic features, but the first-level predicted duration is used as prompt information for duration prediction, and the predicted voice duration is more accurate, so that the rhythm and other features of the personalized voice synthesized by the audio model are closer to the actual features of the user, and the voice synthesis effect is better.
[0122] In other embodiments, the above-mentioned process of generating personalized voice by audio model reasoning can be executed on an electronic device, wherein the technical principles of the process executed by the electronic device are similar to the technical principles when executed on a cloud server, and the specific process will not be repeated here.
[0123] 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.
[0124] 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).
[0125] 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.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] 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.
[0130] 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.).
[0131] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0132] 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.
[0133] 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.
[0134] 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.
[0135] 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:
[0136] 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.
[0137] 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.
[0138] S102: Acquire audio features and text features corresponding to the user.
[0139] The audio feature is a feature generated based on the voice information entered by the user when registering the speech synthesis function, and the text feature is a feature generated based on the registered text information read aloud by the user when registering the speech synthesis function.
[0140] S103, determining the stretching time for speech synthesis of the text information based on the audio features, the text features and the encoding results corresponding to the text information.
[0141] The process of predicting the stretching duration in S103 can be referred to above. Fig.12 The description will not be repeated here.
[0142] S104, based on the stretching duration, perform speech synthesis on the text information and the audio features corresponding to the user through an audio model to output personalized speech.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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.
[0147] 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.
[0148] 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.
[0149] 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.
[0150] 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.
[0151] 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.
[0152] 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.
[0153] 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.
[0154] 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.
[0155] 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.
[0156] 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.
[0157] 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.
[0158] 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.
[0159] 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.
[0160] 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, It is characterized in that The method comprises: 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, the text information includes text information input by a user and text information generated by the electronic device; Acquire an audio feature and a text feature corresponding to the user, wherein the audio feature is a feature generated according to the voice information entered by the user when registering for the speech synthesis function, and the text feature is a feature generated according to the registered text information read aloud by the user when registering for the speech synthesis function; Determining a stretching time when performing speech synthesis on the text information based on the audio feature, the text feature, and the encoding result corresponding to the text information; Based on the stretching duration, performing speech synthesis on the text information and the audio features through an audio model to output personalized speech, wherein the audio model is a text-independent model obtained by training according to the first text information and the first voice information in the training data; The step of determining the stretching time for speech synthesis of the text information based on the audio feature, the text feature, and the encoding result corresponding to the text information includes: Inputting the audio feature and the text feature into a first duration prediction model, and outputting a first predicted duration; The encoding result corresponding to the first predicted duration and the text information is input into a second duration prediction model, and the stretched duration is output.
2. The method according to claim 1, It is characterized in that The training method of the first duration prediction model and the second duration prediction model includes: Acquire a first semantic feature corresponding to the first text information and a first acoustic feature corresponding to the first voice information; Aligning the first semantic feature with the first acoustic feature to determine a first stretching duration feature corresponding to the first semantic feature; Generate a random number k, and divide the first semantic feature into a first sub-feature and a second sub-feature according to the random number k, divide the first stretched duration feature into a third sub-feature and a fourth sub-feature, and divide the first acoustic feature into a fifth sub-feature and a sixth sub-feature; Inputting the first sub-feature and the fifth sub-feature into the first duration prediction model, and adjusting a parameter value of the first duration prediction model according to a loss between an output result and the third sub-feature, so that the first duration prediction model converges; The second sub-feature and the third sub-feature are input into the second duration prediction model, and according to the loss between the output result and the fourth sub-feature, the parameter value of the second duration prediction model is adjusted until the second duration prediction model converges.
3. The method according to claim 2, It is characterized in that The value range of the random number k is [ , ], L is the data length of the first semantic feature.
4. The method according to claim 2 or 3, It is characterized in that The dividing the first semantic feature into a first sub-feature and a second sub-feature according to the random number k includes: Starting from the first position of the first semantic feature, a feature of length k is taken as the first sub-feature, and the remaining feature combination is taken as the second sub-feature; The dividing the first stretching duration feature into a third sub-feature and a fourth sub-feature comprises: Starting from the first position of the first stretching duration feature, a feature of length k is taken as the third sub-feature, and the remaining feature combination is taken as the fourth sub-feature; The dividing the first acoustic feature into a fifth sub-feature and a sixth sub-feature comprises: Starting from the first position of the first acoustic feature, a feature with a length of k is taken as the fifth sub-feature, and the remaining features are combined as the sixth sub-feature.
5. The method according to claim 1, It is characterized in that The step of performing speech synthesis on the text information and the audio features through an audio model based on the stretching duration and outputting a personalized speech includes: Extracting features of the text information through the audio model to obtain semantic features corresponding to the text information and having the length of the stretching duration; The audio model is used to perform speech synthesis on the semantic features and the audio features, and the personalized speech is output.
6. The method according to claim 5, It is characterized in that The performing speech synthesis on the semantic features and the audio features by using the audio model to output the personalized speech includes: The audio feature is used as a timbre cue, and the semantic feature and the audio feature are fused and decoded through the audio model to obtain and output the personalized voice.
7. The method according to claim 5 or 6, It is characterized in that The extracting features of the text information by using the audio model to obtain semantic features corresponding to the text information and having the length of the stretching duration 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 audio model is used to perform dimension mapping, encoding and time-stretching processing on the phoneme information to obtain a semantic feature having the length of the stretched time.
8. The method according to claim 1, It is characterized in that The obtaining of the audio features and text features corresponding to the user includes: Acquire the voice information entered by the user when registering for the speech synthesis function, and the registration text information read aloud 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 recorded voice information to obtain audio features corresponding to the user; The registered text information is processed at the front end to obtain the text features.
9. The method according to claim 8, It is characterized in that The number of phrases corresponding to the input voice information is N≤2.
10. The method according to claim 8 or 9, It is 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.
11. The method according to claim 1, It is 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.
12. A training method for a duration prediction model, It is characterized in that The method comprises: 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; Aligning the first semantic feature with the first acoustic feature to determine a first stretching duration feature corresponding to the first semantic feature; Generate a random number k, and divide the first semantic feature into a first sub-feature and a second sub-feature according to the random number k, divide the first stretched duration feature into a third sub-feature and a fourth sub-feature, and divide the first acoustic feature into a fifth sub-feature and a sixth sub-feature; Inputting the first sub-feature and the fifth sub-feature into a first duration prediction model, and adjusting a parameter value of the first duration prediction model according to a loss between an output result and the third sub-feature, so that the first duration prediction model converges; The second sub-feature and the third sub-feature are input into a second duration prediction model, and a parameter value of the second duration prediction model is adjusted according to a loss between an output result and the fourth sub-feature, so that the second duration prediction model converges.
13. An electronic device, It is 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 12.
14. A server, It is 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 1 to 12.
15. The server according to claim 14, It is characterized in that When the one or more programs are executed by the processor, the server further executes: Send personalized voice to electronic devices.
16. A computer-readable storage medium, It is 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 12.
