Voice broadcasting method and device, electronic equipment and storage medium
By obtaining and analyzing text, context and emotional information in the broadcasting scene, and generating voice based on the target timbre characteristics, the problem of stereotyped and monotonous broadcasting audio in the prior art is solved, and a more realistic and natural voice broadcasting effect is achieved.
Patent Information
- Application Number
- CN202310943915.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-02-14
AI Technical Summary
When existing electronic devices broadcast voice, the broadcast audio generated by them is relatively rigid and monotonous, resulting in poor broadcasting effect.
By obtaining the text, context information and emotional information of the current broadcast scene, and generating corresponding voice to be broadcast based on these information and target timbre characteristics.
It realizes the corresponding broadcast voice generation based on the tone characteristics of the actual broadcast scene, the context and emotions of the broadcast text, making the broadcast voice more realistic and natural, and improving the user's listening experience and broadcast effect.
Smart Images

Figure CN119446111A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic equipment, and more specifically, to a voice broadcasting method, device, electronic equipment and storage medium. Background Art
[0002] With the rapid advancement of science and technology and living standards, electronic devices (such as smart phones, tablet computers, etc.) have become one of the commonly used electronic products in people's lives. When using electronic devices, people often check the text content displayed on the screen to obtain the information they need. In addition, in order to meet the user's requirement to obtain information from electronic devices through hearing, electronic devices can also broadcast text content through audio playback. However, the broadcast audio generated in the related art is relatively stereotyped and monotonous, resulting in poor broadcasting effect. Summary of the invention
[0003] The present application proposes a voice broadcast method, device, electronic device and storage medium, which can improve the broadcast effect of voice broadcast.
[0004] In a first aspect, an embodiment of the present application provides a voice broadcast method, the method comprising: obtaining a text to be broadcast corresponding to a current broadcast scene; obtaining context information and emotional information corresponding to the text to be broadcast; generating a voice to be broadcast corresponding to the text to be broadcast based on the context information, the emotional information and the target timbre features corresponding to the current broadcast scene; and playing the voice to be broadcast.
[0005] In the second aspect, an embodiment of the present application provides a voice broadcast device, which includes: a text acquisition module, a text analysis module, a speech generation module and a speech output module, wherein the text acquisition module is used to acquire the text to be broadcast corresponding to the current broadcast scene; the text analysis module is used to acquire the context information and emotional information corresponding to the text to be broadcast; the speech generation module is used to generate a speech to be broadcast corresponding to the text to be broadcast based on the context information, the emotional information and the target timbre characteristics corresponding to the current broadcast scene; and the speech output module is used to play the speech to be broadcast.
[0006] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the voice broadcast method provided in the first aspect above.
[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the voice broadcast method provided in the first aspect above.
[0008] The solution provided by the present application obtains the text to be broadcast corresponding to the current broadcast scene; obtains the context information and emotional information corresponding to the text to be broadcast; generates the voice to be broadcast corresponding to the text to be broadcast based on the context information, emotional information and the target timbre characteristics corresponding to the current broadcast scene; and plays the voice to be broadcast. In this way, it is possible to generate the corresponding broadcast voice according to the timbre characteristics corresponding to the actual broadcast scene, the context and emotion of the broadcast text, so that the broadcast voice can be made more real and natural, thereby enhancing the user's listening experience during voice broadcast and improving the broadcast effect of voice broadcast. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A flow chart of a voice broadcast method according to an embodiment of the present application is shown.
[0011] Figure 2 A flow chart of a voice broadcast method according to another embodiment of the present application is shown.
[0012] Figure 3 A flow chart of a voice broadcast method according to another embodiment of the present application is shown.
[0013] Figure 4 A block diagram of a voice broadcasting device according to an embodiment of the present application is shown.
[0014] Figure 5 It is a block diagram of an electronic device for executing the voice broadcast method according to an embodiment of the present application.
[0015] Figure 6 It is a storage unit of an embodiment of the present application for storing or carrying a program code for implementing a voice broadcast method according to an embodiment of the present application. DETAILED DESCRIPTION
[0016] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0017] With the rapid advancement of technology and living standards, electronic devices are becoming increasingly popular. Electronic devices can display text content on screens so that users can obtain the information they need. Moreover, with the development of electronic devices, electronic devices can broadcast text content, making it more convenient for users to obtain information.
[0018] In the related art, when an electronic device broadcasts text content, it usually converts the text into audio and plays the converted audio to achieve voice broadcast of the text content. However, in the related art, the text content is usually converted according to the voice of a specific person, so the broadcast audio generated in the related art is relatively rigid and monotonous, resulting in poor broadcast effect. For example, when the voice assistant in the electronic device broadcasts the relevant text content, it is usually converted according to the fixed voice of the voice assistant. Therefore, users usually feel boring after listening to the voice of the voice assistant for a long time, resulting in a poor user experience.
[0019] In view of the above problems, the inventors have proposed the voice broadcast method, device, electronic device and storage medium provided in the embodiments of the present application, which can realize the generation of corresponding broadcast voice according to the timbre characteristics corresponding to the actual broadcast scene, the context and emotion of the broadcast text, so as to make the broadcast voice more real and natural, thereby enhancing the user's hearing experience during voice broadcast and improving the broadcast effect of voice broadcast. Among them, the specific voice broadcast method is described in detail in the subsequent embodiments.
[0020] The voice broadcast method provided in the embodiment of the present application is described in detail below in conjunction with the accompanying drawings.
[0021] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of a voice broadcast method provided by an embodiment of the present application. In a specific embodiment, the voice broadcast method is applied to Figure 4 The voice broadcast device 400 and the electronic device 100 ( Figure 5 ). The following will take an electronic device as an example to illustrate the specific process of this embodiment. Of course, it can be understood that the electronic device used in this embodiment can be a smart phone, a tablet computer, a smart watch, an e-book, a smart home appliance, etc., which is not limited here. Figure 1 The process shown is described in detail, and the voice broadcast method may specifically include the following steps:
[0022] Step S110: Obtain the text to be broadcast corresponding to the current broadcast scene.
[0023] In the embodiment of the present application, the broadcasting scene can be a scene of voice broadcasting of text, for example, the scene of voice broadcasting of text can be a broadcasting scene of chat information, a broadcasting scene of articles, a broadcasting scene of novels, a broadcasting scene of text messages, a broadcasting scene of news information, a broadcasting scene of push content, a broadcasting scene of reminders, a broadcasting scene of game dialogue information in a game, etc. Of course, the specific scene of voice broadcasting of text may not be limited in the embodiment of the present application. The text to be broadcasted can be the text that needs to be broadcasted by voice in the current broadcasting scene. For example, in the broadcasting scene of chat information, the text to be broadcasted can be the chat information sent by the sender. For another example, in the broadcasting scene of novels, the text to be broadcasted can be the content of the novel.
[0024] In some implementations, in the current broadcast scene, the electronic device may, upon determining that the current voice broadcast is triggered, obtain the text to be broadcast corresponding to the current broadcast scene, so as to perform voice broadcast on the text to be broadcast.
[0025] In a possible implementation, in the current broadcast scenario, when the voice broadcast mode is in the on state, it can be determined in real time whether new text content that needs to be broadcast is generated; if new text content that needs to be broadcast is generated, it can be determined that the voice broadcast is triggered, and the generated new text content that needs to be broadcast is determined as the text to be broadcasted; if no new text content that needs to be broadcast is generated, it can be determined that no voice broadcast is generated. Among them, the electronic device can control the voice broadcast mode to be in the on state or control the voice broadcast mode to be in the off state according to the operation input by the user. For example, in the scenario of broadcasting chat information, the voice broadcast mode is in the on state, then when a new chat message sent by the sender is received, it can be determined that the voice broadcast is triggered, and the newly sent chat message received can be used as the text to be broadcast; for another example, in the scenario of broadcasting push information, the voice broadcast mode is in the on state, then when new push content is received, it can be determined that the voice broadcast is triggered, and the new push content received can be used as the text to be broadcast; for another example, in the scenario of broadcasting game dialogue information in the game, the voice broadcast mode is in the on state, then when dialogue information of any game character is generated, it can be determined that the voice broadcast is triggered, and the dialogue information can be used as the text to be broadcast.
[0026] In a possible implementation, the electronic device may also detect the operation input by the user, and when a trigger operation for triggering the voice broadcast is detected, determine that the voice broadcast is triggered and obtain the text to be broadcasted. For example, in the broadcasting scenario of broadcasting chat information, a chat message sent by the other party is received. If a voice broadcast operation for the newly received chat message is detected, it can be determined that the voice broadcast is triggered, and the newly received chat message is used as the text to be broadcasted; for example, in the broadcasting scenario of broadcasting novels, the electronic device displays a viewing interface of the novel on the screen. If a voice broadcast operation for the novel content in the viewing interface is detected, it can be determined that the voice broadcast is triggered, and the newly received chat message is used as the text to be broadcasted.
[0027] Of course, in the embodiment of the present application, the specific triggering method for triggering the voice broadcast of the text content may not be limited, and the specific triggering method may be determined according to the actual broadcasting scenario.
[0028] Step S120: Acquire context information and emotion information corresponding to the text to be broadcast.
[0029] In an embodiment of the present application, after acquiring the text to be broadcast, the electronic device can determine the contextual information and emotional information corresponding to the text to be broadcast, so as to provide a reference when generating the voice to be broadcast corresponding to the text to be broadcast, so as to make the generated voice to be broadcast more realistic and natural.
[0030] In some embodiments, the electronic device can identify basic elements of the text to be broadcast and determine the target basic elements from the identified basic elements; determine the context information of the text to be broadcast based on the context sentences in the text to be broadcast; determine the semantics of the target basic elements in the context information based on the context information of the text to be broadcast; perform sentiment analysis on the text to be broadcast based on the semantics corresponding to the characteristic basic elements in the text to be broadcast, and determine the sentiment information of the text to be broadcast.
[0031] Among them, the basic elements in the text to be broadcast are the basic symbols that constitute the text to be broadcast. The basic elements can be the characters, words or pinyin that constitute the text to be broadcast; the target basic elements in the text to be broadcast refer to the basic elements in the text to be broadcast that have an impact on the semantics of the text to be broadcast.
[0032] In one possible implementation, the electronic device may obtain a context sentence of the text to be broadcast; identify basic elements in the context sentence of the text to be broadcast; determine context features corresponding to the basic elements in the context sentence of the text to be broadcast; and determine context information of the text to be broadcast based on the context features corresponding to the basic elements in the context sentence of the text to be broadcast.
[0033] In a possible implementation, the electronic device can match the semantics of the target basic elements in the text to be broadcast based on a predetermined correspondence between the semantics of the target basic elements and the emotional information, determine the emotional information corresponding to the semantics of the target basic elements in the text to be broadcast, and use it as the emotional information of the text to be broadcast.
[0034] It can be understood that in the above implementation mode, the emotional information is not identified directly based on the basic elements in the text to be broadcast, but is identified based on the semantics corresponding to the target basic elements in the text to be broadcast; the semantics corresponding to the target basic elements in the text to be broadcast are determined in combination with the context of the text to be broadcast, and the real semantics of the target basic elements in the text to be broadcast that are different in structure from the sensitive words but the same or similar in pronunciation, or similar in structure but different in pronunciation, can be identified in the text to be broadcast based on the context, thereby performing emotional recognition on the text to be broadcast based on the real semantics corresponding to the target basic elements in the text to be broadcast, thereby improving the accuracy of emotional information recognition.
[0035] In a possible implementation, before determining the context information and emotional information corresponding to the text to be broadcast, the text to be broadcast may also be preprocessed. The preprocessing may include repairing spelling errors, removing special characters, etc., to improve the accuracy of the determined context information and emotional information.
[0036] Step S130: Based on the context information, the emotion information and the target timbre features corresponding to the current broadcast scene, generate the speech to be broadcast corresponding to the text to be broadcast.
[0037] In an embodiment of the present application, after the context information and emotional information corresponding to the text to be broadcast are obtained, the speech to be broadcast corresponding to the text to be broadcast can be generated based on the obtained context information, emotional information and the target timbre features corresponding to the current broadcast scene. Among them, the target timbre features corresponding to the current broadcast scene can be the timbre features used to generate the speech to be broadcast in the current broadcast scene. The target timbre features can be pre-stored in the electronic device or can be recognized based on the target audio. The specific target timbre features can be unlimited, and the target timbre features need to be suitable for the broadcast of the above text to be broadcast in the current broadcast scene.
[0038] In some embodiments, when generating the information to be broadcast corresponding to the text to be broadcast based on the context information, emotional information and target timbre features corresponding to the current broadcast scene corresponding to the text to be broadcast, the context information, emotional information and target timbre features corresponding to the current broadcast scene can be input into a pre-trained speech synthesis model to obtain a synthesized speech matching the context information, emotional information and target timbre features as the speech to be broadcast corresponding to the text to be broadcast. Wherein, the speech synthesis model can be a neural network model, and optionally, the neural network model can be a convolutional neural network (CNN) or a recurrent neural network (RNN), for example, a WaveNet model, a Tacotron model, etc. for implementing text-to-speech (TTS). It can be understood that the above model can learn the characteristics of different timbre features, context information and emotional information, and generate corresponding sounds based on given timbre features, context information and emotional information, and directly map the information in the input text to the characteristics of the synthesized speech to minimize information loss.
[0039] In some embodiments, a pre-trained audio synthesis model capable of generating a sound of corresponding timbre according to a given timbre feature can also be used to generate an audio to be processed based on the above target timbre feature and the text to be broadcasted; then, according to the above context information and emotional information, the pitch, speed, volume, etc. of the audio to be processed are adjusted so that the adjusted audio matches the above context information and emotional information, and the adjusted audio is used as the speech to be broadcast corresponding to the text to be broadcasted. For example, positive emotional information such as happiness, excitement, and excitement can use a higher volume and tone, while negative emotional information such as frustration and sadness can use a lower volume and speed.
[0040] Step S140: Play the voice to be broadcast.
[0041] In an embodiment of the present application, after obtaining the voice to be broadcast corresponding to the text to be broadcast, the voice to be broadcast can be played, thereby realizing voice broadcast for the text to be broadcast, and since the voice to be broadcast played is generated based on the contextual information, emotional information of the text to be broadcast and the target timbre characteristics corresponding to the current broadcast scene, it can meet the personalized needs of users and make the played broadcast voice more real and natural, thereby improving the user's listening experience.
[0042] The voice broadcast method provided in the embodiment of the present application obtains the text to be broadcast corresponding to the current broadcast scene; obtains the context information and emotional information corresponding to the text to be broadcast; generates the voice to be broadcast corresponding to the text to be broadcast based on the context information, emotional information and the target timbre characteristics corresponding to the current broadcast scene; and plays the voice to be broadcast. In this way, it is possible to generate the corresponding broadcast voice according to the timbre characteristics corresponding to the actual broadcast scene, the context and emotion of the broadcast text, so that the broadcast voice can be made more real and natural, thereby enhancing the user's hearing experience during voice broadcast and improving the broadcast effect of voice broadcast.
[0043] See also Figure 2 , Figure 2 A flow chart of a voice broadcast method provided by another embodiment of the present application is shown. The voice broadcast method is applied to the above electronic device. Figure 2 The process shown is described in detail, and the voice broadcast method may specifically include the following steps:
[0044] Step S210: Obtain the text to be broadcast corresponding to the current broadcast scene.
[0045] In the embodiment of the present application, step S210 can refer to the contents of the aforementioned embodiment and will not be described again here.
[0046] Step S220: Acquire context information and emotion information corresponding to the text to be broadcast.
[0047] In the embodiment of the present application, step S220 can refer to the contents of the aforementioned embodiment and will not be described again here.
[0048] Step S230: If the current broadcasting scene is a broadcasting scene for broadcasting chat information, the timbre characteristics of the sender of the chat information are obtained as the target timbre characteristics corresponding to the current broadcasting scene.
[0049] In an embodiment of the present application, after the electronic device obtains the context information and emotional information corresponding to the text to be broadcast, when generating the corresponding voice to be broadcast for the text to be broadcast, it can determine the target timbre features corresponding to the current broadcast scene for the current broadcast scene, so as to generate the voice to be broadcast corresponding to the text to be broadcast according to the acquired context information, emotional information and target timbre features. Among them, when the electronic device determines the target timbre features corresponding to the current broadcast scene for the current broadcast scene, it can determine whether the current broadcast scene is a broadcast scene for broadcasting chat information; if it is a scene for broadcasting chat information, in order to improve the authenticity of the voice broadcast, the timbre features of the sender of the chat information can be used as the target timbre features corresponding to the current broadcast scene, so that the subsequently generated voice to be broadcast matches the timbre of the sender, so that the user can feel the feeling of the sender speaking.
[0050] In some embodiments, when the current broadcast scene is a broadcast scene of broadcasting chat information, when obtaining the timbre features of the sender of the chat information, since the sender of the chat information usually has sent chat voice in the historical chat, the electronic device can obtain the historical voice sent by the sender, and extract the timbre features of the historical voice sent by the sender, thereby obtaining the timbre features of the sender, and using them as the target timbre features corresponding to the current playback scene. Among them, the Mel frequency cepstral coefficients (MFCC), linear prediction cepstral coefficients (LPCC), fundamental frequency (F0) and other features of the historical voice can be extracted as timbre features, which can describe the timbre, pitch and spectrum characteristics of a sound.
[0051] In a possible implementation, a pre-trained VALLE (Voice Attribute Learning with Latent Embedding) model can be used to analyze historical speech to extract the timbre characteristics of the sender of the chat message. The VALLE model calculates the correlation between the feature vector in the audio signal and the timbre to achieve accurate learning of the timbre characteristics.
[0052] In some embodiments, considering that the sender of the chat information in the chat scenario may also have made voice calls in historical chats, the electronic device can store call recordings of the sender in historical voice calls; when it is necessary to obtain the timbre characteristics of the sender, the call recording can be read, and the timbre characteristics of the sender can be extracted based on the call recording, and the obtained audio characteristics of the sender can be used as the target timbre characteristics corresponding to the current broadcast scenario.
[0053] Step S240: If the current broadcast scene is not a broadcast scene for broadcasting chat information, a target timbre feature corresponding to the current broadcast scene is obtained from the stored timbre features.
[0054] In the embodiment of the present application, after the electronic device determines whether the current broadcast scene is a broadcast scene for broadcasting chat information, if the current broadcast scene is not a broadcast scene for broadcasting chat information, it is not necessary to extract the timbre features of a certain user in real time in the current broadcast scene to simulate the broadcast of the user who generates the above text to be broadcast. In the broadcast scene that is not a broadcast scene for broadcasting chat information, the target timbre features corresponding to the current broadcast scene can be obtained from the stored timbre features. The stored timbre features can be timbre features pre-extracted for audios of different timbres.
[0055] In some implementations, the electronic device may pre-store the correspondence between different broadcasting scenes and timbre features in the broadcasting scenes that are not for broadcasting chat information. After the electronic device determines that the current broadcasting scene is not a broadcasting scene for chat information, it may determine the target timbre features corresponding to the current broadcasting scene based on the above correspondence. The above correspondence may be a system default of the electronic device, or may be determined based on the user's setting operation.
[0056] In a possible implementation, in the above correspondence, the timbre features corresponding to each playback scene may include one timbre feature or may include multiple timbre features. In the case where it is determined that the timbre features corresponding to the current playback scene include multiple timbre features, the timbre features corresponding to the current time period may be determined as the target timbre features according to the time period at the current moment (as the current time period). For example, in the same broadcast scene, different time periods correspond to different timbre features, and voice broadcasting may be performed according to the timbre features corresponding to the current time period, thereby achieving richer voice broadcasting; the timbre features corresponding to the current position may also be determined as the target timbre features according to the current position. For example, in the same broadcast scene, different positions correspond to different timbre features, so that when the electronic device is in different positions, the voice broadcast of the same broadcast scene can be broadcast by different timbres, thereby enriching the voice broadcasting effect.
[0057] In some embodiments, if the electronic device determines that the current broadcast scene is not a broadcast scene for broadcasting chat information, the target broadcast role corresponding to the text to be broadcast can be determined based on the text to be broadcast; then the target timbre feature corresponding to the target broadcast role is obtained from the stored timbre features as the target timbre feature corresponding to the current broadcast scene. Among them, the electronic device may pre-store timbre features corresponding to different broadcast roles, and by determining the broadcast role corresponding to the text to be broadcast, the timbre feature corresponding to the broadcast role can be determined from the timbre features stored in the electronic device. It can be understood that when different information is broadcast, it may be the broadcast text corresponding to different broadcast roles, so the corresponding broadcast role can be determined by the text to be broadcast, and the timbre feature used for voice broadcast can be determined based on the broadcast role. For example, in the broadcasting scenario of a novel, when the text to be broadcast is the speech content of a certain character in the novel, then the broadcasting character corresponding to the text to be broadcast is the novel character; for another example, in the broadcasting scenario of family messages in a smart home, when the text to be broadcast is the content of commands to children, then the broadcasting character corresponding to the text to be broadcast is the father or mother; for another example, in the broadcasting scenario of game dialogue information in a game, when the text to be broadcast is the speech content of a certain game character, then the broadcasting character corresponding to the text to be broadcast is the game character.
[0058] In a possible implementation, the electronic device can set corresponding timbre features for different broadcasting roles according to user operations. For example, for different novel roles in a broadcasting scene of a novel content, the user can select corresponding audio for the different novel roles, and extract timbre features according to the audio selected by the user as the timbre features corresponding to the novel roles.
[0059] In a possible implementation, the electronic device may also pre-collect speech audio corresponding to different broadcasting roles, and extract the timbre features corresponding to the broadcasting roles based on the collected speech audio. For example, for different game roles in a broadcasting scene of a game role, the electronic device may collect speech audio of the game role in the game, and extract the timbre features corresponding to the game role based on the speech audio of the game role.
[0060] In a possible implementation, when the electronic device obtains the timbre feature corresponding to the target broadcasting role from the stored timbre features, it can determine the role attribute information of the target broadcasting role, and then obtain the target timbre feature matching the role attribute information from the stored timbre features as the target timbre feature corresponding to the current broadcasting scene. Among them, the role attribute information may include the gender, age, personality and other attribute information of the role. It can be understood that people's timbre is usually related to their gender, age, personality and other attribute information. Therefore, the electronic device can store the corresponding timbre features for the role attribute information of the broadcasting roles in all broadcasting scenes. When the electronic device determines the target timbre feature corresponding to the current broadcasting scene, it can match the corresponding timbre feature from the stored timbre features through the determined role attribute information of the broadcasting role, and use it as the target timbre feature corresponding to the previous broadcasting scene.
[0061] In a possible implementation, the electronic device may also store timbre features for broadcasting roles that may appear in different playback scenarios, and predetermine the correspondence between different broadcasting roles and timbre features. When the electronic device determines the timbre features corresponding to the target broadcasting role, it may obtain the timbre features corresponding to the target broadcasting role from the stored timbre features based on the correspondence, as the target timbre features corresponding to the current broadcasting scenario.
[0062] It should be noted that in the embodiment of the present application, the execution order between step S220 and step S230 and step S240 may not be limited. The electronic device may execute step S230 and step S240 after executing step S220, or may execute step S230 and step S240 before executing step S220, or may execute step S220, step S230 and step S240 at the same time.
[0063] Step S250: Based on the context information, the emotion information and the target timbre feature, generate the speech to be broadcast corresponding to the text to be broadcast.
[0064] In the embodiment of the present application, step S250 can refer to the contents of the aforementioned embodiment and will not be described again here.
[0065] Step S260: Play the voice to be broadcast.
[0066] In the embodiment of the present application, step S260 can refer to the contents of the aforementioned embodiment and will not be described again here.
[0067] The following is an explanation of the voice broadcast method provided in the embodiment of the present application by taking examples.
[0068] Exemplarily, in the broadcasting scenario of chat information, user A corresponding to the electronic device is chatting with user B. When the electronic device receives the text chat information sent by user B's device, it can extract the timbre characteristics of user B based on the chat audio previously sent by user B; when receiving the voice broadcast operation of user A for the received text chat information, the electronic device can identify the contextual information and emotional information corresponding to the text chat information, and generate a voice to be broadcast corresponding to the text chat information based on the timbre characteristics of user B and the contextual information and emotional information corresponding to the text chat information, and play the voice to be broadcast, thereby simulating the timbre of user B to play the text chat information sent by user B, and the voice to be broadcast corresponds to the contextual information and emotional information of the text chat information, so that the voice broadcast is more real and natural.
[0069] For example, in the broadcasting scene of the novel content, the corresponding novel character can be identified according to the novel content, and the corresponding timbre characteristics can be determined according to the novel character, and the corresponding context information and emotional information can be determined according to the novel content. According to the timbre characteristics of the novel character, the context information and emotional information corresponding to the novel content, the voice to be broadcasted corresponding to the novel content is generated, and the voice to be broadcasted is played, so as to realize the timbre of the corresponding character to read the novel content aloud. This allows users to better immerse themselves in the story context while listening to the novel, and improves the reading experience.
[0070] Exemplarily, when the electronic device is a smart home device, when the smart home device broadcasts family messages or reminders, it can determine the timbre characteristics corresponding to the current broadcast scene based on the timbre characteristics of the family members who are preset for broadcasting family messages or reminders, and determine the corresponding contextual information and emotional information based on the content to be broadcast. Then, based on the timbre characteristics of the family members and the contextual information and emotional information corresponding to the content to be broadcast, a voice to be broadcast corresponding to the content to be broadcast is generated, and the voice to be broadcast is played, thereby simulating the timbre of family members to broadcast family messages or reminders, enhancing the family atmosphere, and allowing users to feel the warmth of home.
[0071] Exemplarily, in the broadcasting scenario of game dialogue information in the game, the corresponding timbre characteristics can be determined according to the game characters, and the corresponding contextual information and emotional information can be determined according to the game dialogue information of the game characters. According to the timbre characteristics of the game characters, the contextual information and emotional information corresponding to the game dialogue information, the voice to be broadcast corresponding to the game dialogue information is generated, and the voice to be broadcast is played, so that when communicating with different characters during the game, voice broadcasting can be performed with the timbre corresponding to each game character, giving players a more realistic and immersive gaming experience.
[0072] The voice broadcast method provided in the embodiment of the present application can generate corresponding broadcast voice according to the timbre characteristics corresponding to the actual broadcast scene, the context and emotion of the broadcast text, so that the broadcast voice can be made more realistic and natural, thereby enhancing the user's listening experience during voice broadcast and improving the broadcast effect of the voice broadcast; and, when determining the timbre characteristics for generating the broadcast voice, based on the actual broadcast scene, in the case of a broadcast scene for broadcasting chat information, the broadcast voice is generated according to the timbre characteristics of the sender; in the case of a broadcast scene not for broadcasting chat information, the broadcast voice is generated according to the corresponding timbre characteristics determined from the stored timbre characteristics, thereby achieving a richer, more realistic and personalized voice broadcast experience.
[0073] See also Figure 3 , Figure 3 A flow chart of a voice broadcast method provided by another embodiment of the present application is shown. The voice broadcast method is applied to the above electronic device. Figure 3 The process shown is described in detail, and the voice broadcast method may specifically include the following steps:
[0074] Step S310: Obtain the text to be broadcast corresponding to the current broadcast scene.
[0075] Step S320: Acquire context information and emotion information corresponding to the text to be broadcast.
[0076] In the embodiment of the present application, step S310 and step S320 can refer to the contents of the aforementioned embodiment and will not be described again here.
[0077] Step S330: Based on the context information, the emotion information and the target timbre features corresponding to the current broadcast scene, generate the speech to be broadcast corresponding to the text to be broadcast.
[0078] In some embodiments, when the electronic device generates the speech to be broadcast corresponding to the text to be broadcast based on the above context information, emotional information and the target timbre characteristics corresponding to the current broadcast scene, it can also generate the speech to be broadcast in the target language corresponding to the text to be broadcast according to the target language selected by the user (such as English, Chinese, Japanese, local dialect, etc.), and based on the above context information, emotional information and the target timbre characteristics corresponding to the current broadcast scene, thereby meeting the language needs of different users.
[0079] Step S340: Generate background audio corresponding to the text to be broadcast.
[0080] In an embodiment of the present application, when the electronic device performs voice broadcast, in addition to generating the voice to be broadcast corresponding to the text to be broadcast, it can also generate background audio corresponding to the text to be broadcast, so that when the voice to be broadcast is broadcast, the background audio can be played at the same time, thereby further improving the broadcast effect.
[0081] In some implementations, the electronic device may generate corresponding background audio according to the scene in the text to be broadcasted and the emotional information corresponding to the text to be broadcasted. The scene in the text to be broadcasted may be an adventure story, an emergency reminder, a calm content push, etc. For example, in a broadcasting scene of a novel content, the text to be broadcasted is the content of an adventure story, and the emotional information corresponding to the text to be broadcasted is happy emotional information, a background audio that matches the rhythm of the adventure story and the emotional information of "happy" may be generated.
[0082] In one possible implementation, different correspondences between scenes in the text to be broadcast and emotional information and background audio may be pre-set in the electronic device. Based on the correspondence, background audio matching the scenes in the text to be broadcast and the emotional information corresponding to the text to be broadcast may be obtained, and the obtained background audio may be used as the background audio corresponding to the text to be broadcast.
[0083] In a possible implementation, the electronic device may also input the determined scene and emotional information in the text to be broadcast into a pre-trained background sound generation model to obtain the audio output by the background sound generation model, and use the audio output by the background sound generation model as the background audio corresponding to the text to be broadcast.
[0084] It should be noted that the execution order between step S340 and step S320 and step S330 may not be limited. The electronic device may execute step S340 after executing step S320 and step S330, or may execute step S320 and step S330 after executing step S340, or may execute step S340, step S320 and step S330 at the same time.
[0085] Step S350: Play the background audio while playing the voice to be broadcast.
[0086] In an embodiment of the present application, when the electronic device performs voice broadcasting of the text to be broadcasted, it can broadcast the background audio while playing the voice to be broadcasted based on the generated voice to be broadcasted and background audio, thereby improving the broadcasting effect.
[0087] In some embodiments, when playing the above background audio, the electronic device can also detect user operations and adjust the playback parameters of the background audio and other parameters according to the user operations. Of course, the electronic device can also switch the background audio to other background audio according to the user's selection operation of the background audio, thereby meeting the user's different playback requirements for the background audio.
[0088] In some embodiments, after generating the above voice to be broadcast, the electronic device may also perform post-processing on the voice to be broadcast before playing, and the post-processing may include but is not limited to removing noise, improving clarity, etc., so as to achieve higher quality voice broadcast. Optionally, in the process of playing the voice to be broadcast, the volume, speech speed, etc. may also be adjusted according to the playback adjustment operation input by the user to meet the user's personal preferences and scene requirements.
[0089] The voice broadcast method provided in the embodiment of the present application can generate a corresponding broadcast voice according to the timbre characteristics corresponding to the actual broadcast scene, the context and emotion of the broadcast text, so that the broadcast voice can be made more realistic and natural, thereby enhancing the user's listening experience during voice broadcast and improving the broadcast effect of the voice broadcast; in addition, during voice broadcast, background audio corresponding to the text to be broadcast is also generated. The electronic device can play the background audio corresponding to the text to be broadcast while playing the voice to be broadcast, so that the atmosphere can be set off during voice broadcast, increasing the user's immersive feeling, thereby further improving the broadcast effect.
[0090] See also Figure 4, which shows a structural block diagram of a voice broadcast device 400 provided in an embodiment of the present application. The voice broadcast device 400 uses the above-mentioned electronic device, and the voice broadcast device 400 includes: a text acquisition module 410, a text analysis module 420, a speech generation module 430 and a speech output module 440. Among them, the text acquisition module 410 is used to obtain the text to be broadcast corresponding to the current broadcast scene; the text analysis module 420 is used to obtain the context information and emotional information corresponding to the text to be broadcast; the speech generation module 430 is used to generate the speech to be broadcast corresponding to the text to be broadcast based on the context information, the emotional information and the target timbre characteristics corresponding to the current broadcast scene; the speech output module 440 is used to play the speech to be broadcast.
[0091] In some embodiments, the speech generation module 430 can be specifically used to obtain the timbre characteristics of the sender of the chat information as the target timbre characteristics corresponding to the current broadcast scene if the current broadcast scene is a broadcast scene for broadcasting chat information; if the current broadcast scene is not a broadcast scene for broadcasting chat information, then obtain the target timbre characteristics corresponding to the current broadcast scene from the stored timbre characteristics; based on the context information, the emotional information and the target timbre characteristics, generate the speech to be broadcast corresponding to the text to be broadcast.
[0092] In a possible implementation, the speech generation module 430 can also be used to extract the timbre features of the historical speech sent by the sender if the current broadcast scene is a broadcast scene for broadcasting chat information, and obtain the timbre features of the sender as the target timbre features corresponding to the current broadcast scene.
[0093] In a possible implementation, the speech generation module 430 can also be used to determine the target broadcast character corresponding to the text to be broadcast if the current broadcast scene is not a broadcast scene for broadcasting chat information; and obtain the timbre features corresponding to the target broadcast character from the stored timbre features as the target timbre features corresponding to the current broadcast scene.
[0094] Optionally, the speech generation module 430 can also be used to determine the role attribute information of the target broadcast character if the current broadcast scene is not a broadcast scene for broadcasting chat information; and obtain the timbre feature that matches the role attribute information from the stored timbre features as the target timbre feature corresponding to the current broadcast scene.
[0095] Optionally, the speech generation module 430 can also be used to obtain the timbre feature corresponding to the target announcement role from the stored timbre features based on the predetermined correspondence between different announcement roles and timbre features as the target timbre feature corresponding to the current announcement scene.
[0096] In some embodiments, the sound generation module 430 can be specifically used to input the context information, the emotional information, and the target timbre features corresponding to the current broadcast scene into a pre-trained speech synthesis model to obtain a synthesized speech that matches the context information, the emotional information, and the target timbre features as the speech to be broadcast corresponding to the text to be broadcast.
[0097] In some embodiments, the voice broadcast device 400 may also include a background sound generation module, which is used to generate background audio corresponding to the text to be broadcast before playing the voice to be broadcast; the voice output module 440 can be specifically used to play the background audio while playing the voice to be broadcast.
[0098] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0099] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0100] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0101] In summary, the solution provided by the present application is to obtain the text to be broadcast corresponding to the current broadcast scene; obtain the context information and emotional information corresponding to the text to be broadcast; generate the voice to be broadcast corresponding to the text to be broadcast based on the context information, emotional information and the target timbre characteristics corresponding to the current broadcast scene; and play the voice to be broadcast. In this way, it is possible to generate the corresponding broadcast voice according to the timbre characteristics corresponding to the actual broadcast scene, the context and emotion of the broadcast text, so that the broadcast voice can be made more real and natural, thereby enhancing the user's listening experience during voice broadcast and improving the broadcast effect of voice broadcast.
[0102] Please refer to Figure 5, which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 may be an electronic device capable of running applications, such as a smart phone, a tablet computer, a smart watch, an e-book, a smart home appliance, etc. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more applications are configured to execute the method described in the aforementioned method embodiment.
[0103] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0104] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.
[0105] Please refer to Figure 6 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 800 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0106] The computer readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed, for example, in an appropriate form.
[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A voice broadcast method, characterized in that: The method comprises: Get the text to be broadcast corresponding to the current broadcast scene; Acquiring context information and emotion information corresponding to the text to be broadcast; Based on the context information, the emotion information and the target timbre characteristics corresponding to the current broadcast scene, generating a speech to be broadcast corresponding to the text to be broadcast; Play the voice to be broadcasted.
2. The method according to claim 1, characterized in that The generating the speech to be broadcast corresponding to the text to be broadcast based on the context information, the emotion information and the target timbre feature corresponding to the current broadcast scene includes: If the current broadcasting scene is a broadcasting scene for broadcasting chat information, acquiring the timbre feature of the sender of the chat information as the target timbre feature corresponding to the current broadcasting scene; If the current broadcast scene is not a broadcast scene for broadcasting chat information, obtaining a target timbre feature corresponding to the current broadcast scene from the stored timbre features; Based on the context information, the emotion information and the target timbre feature, a speech to be broadcast corresponding to the text to be broadcast is generated.
3. The method according to claim 2, characterized in that If the current broadcast scene is a broadcast scene for broadcasting chat information, obtaining the timbre feature of the sender of the chat information as the target timbre feature corresponding to the current broadcast scene includes: If the current broadcasting scene is a broadcasting scene for broadcasting chat information, the timbre features of the historical voice sent by the sender are extracted to obtain the timbre features of the sender as the target timbre features corresponding to the current broadcasting scene.
4. The method according to claim 2, characterized in that: If the current broadcast scene is not a broadcast scene for broadcasting chat information, obtaining a target timbre feature corresponding to the current broadcast scene from the stored timbre features, including: If the current broadcast scene is not a broadcast scene for broadcasting chat information, determining a target broadcast role corresponding to the text to be broadcasted; The timbre feature corresponding to the target broadcast character is obtained from the stored timbre features as the target timbre feature corresponding to the current broadcast scene.
5. The method according to claim 4, characterized in that The step of acquiring the timbre feature corresponding to the target broadcasting role from the stored timbre features as the target timbre feature corresponding to the current broadcasting scene includes: Determining role attribute information of the target broadcasting role; From the stored timbre features, a timbre feature matching the character attribute information is obtained as a target timbre feature corresponding to the current broadcast scene.
6. The method according to claim 4, characterized in that The step of acquiring the timbre feature corresponding to the target broadcasting role from the stored timbre features as the target timbre feature corresponding to the current broadcasting scene includes: Based on the predetermined correspondence between different announcement roles and timbre features, the timbre feature corresponding to the target announcement role is obtained from the stored timbre features as the target timbre feature corresponding to the current announcement scene.
7. The method according to any one of claims 1 to 6, characterized in that: The generating the speech to be broadcast corresponding to the text to be broadcast based on the context information, the emotion information and the target timbre feature corresponding to the current broadcast scene includes: The context information, the emotional information and the target timbre features corresponding to the current broadcast scene are input into a pre-trained speech synthesis model to obtain a synthesized speech that matches the context information, the emotional information and the target timbre features as the speech to be broadcast corresponding to the text to be broadcast.
8. The method according to any one of claims 1 to 6, characterized in that: Before playing the voice to be broadcast, the method further includes: Generating background audio corresponding to the text to be broadcast; The playing of the voice to be broadcast includes: While playing the voice to be broadcast, the background audio is also played.
9. A voice broadcasting device, characterized in that: The device comprises: a text acquisition module, a text analysis module, a speech generation module and a speech output module, wherein: The text acquisition module is used to acquire the text to be broadcast corresponding to the current broadcast scene; The text analysis module is used to obtain context information and emotional information corresponding to the text to be broadcast; The speech generation module is used to generate the speech to be broadcast corresponding to the text to be broadcast based on the context information, the emotion information and the target timbre characteristics corresponding to the current broadcast scene; The voice output module is used to play the voice to be broadcast.
10. An electronic device, characterized in that: include: one or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Message broadcast device and message broadcast method
CN106302134A
Method and device for processing text
CN108962219A
Audio playing method and device, electronic equipment and readable storage medium
CN113851106A
Speech synthesis method, emotion migration method, interaction method, storage medium and program product
CN114882868A
Voice output method and air conditioner
CN115540260A