[go: up one dir, main page]

CN112786008B - Speech synthesis method and device, readable medium and electronic equipment - Google Patents

Speech synthesis method and device, readable medium and electronic equipment Download PDF

Info

Publication number
CN112786008B
CN112786008B CN202110075977.XA CN202110075977A CN112786008B CN 112786008 B CN112786008 B CN 112786008B CN 202110075977 A CN202110075977 A CN 202110075977A CN 112786008 B CN112786008 B CN 112786008B
Authority
CN
China
Prior art keywords
training
audio
sequence
acoustic feature
text
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110075977.XA
Other languages
Chinese (zh)
Other versions
CN112786008A (en
Inventor
吴鹏飞
伍林
潘俊杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202110075977.XA priority Critical patent/CN112786008B/en
Publication of CN112786008A publication Critical patent/CN112786008A/en
Priority to PCT/CN2021/139987 priority patent/WO2022156464A1/en
Application granted granted Critical
Publication of CN112786008B publication Critical patent/CN112786008B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L13/00Speech synthesis; Text to speech systems
    • G10L13/02Methods for producing synthetic speech; Speech synthesisers
    • G10L13/04Details of speech synthesis systems, e.g. synthesiser structure or memory management
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L13/00Speech synthesis; Text to speech systems
    • G10L13/02Methods for producing synthetic speech; Speech synthesisers
    • G10L13/033Voice editing, e.g. manipulating the voice of the synthesiser
    • G10L13/0335Pitch control
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/27Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique
    • G10L25/30Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique using neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Signal Processing (AREA)
  • Machine Translation (AREA)
  • Document Processing Apparatus (AREA)
  • Electrically Operated Instructional Devices (AREA)

Abstract

本公开涉及一种语音合成方法、装置、可读介质及电子设备,涉及电子信息处理技术领域,该方法包括:获取待合成文本和指定声学特征,指定声学特征用于指示音频的韵律特征,提取待合成文本对应的音素序列,将指定声学特征按照音素序列进行扩展,得到声学特征序列,将音素序列和声学特征序列输入预先训练的语音合成模型,以得到语音合成模型输出的,待合成文本对应的目标音频,目标音频的声学特征与指定声学特征匹配。本公开通过指定声学特征来控制文本的语音合成,使得语音合成模型输出的目标音频能够与指定声学特征对应,能够实现语音合成过程中声学特征的显性控制,提高了目标音频的表现力。

The present disclosure relates to a speech synthesis method, device, readable medium and electronic device, and relates to the field of electronic information processing technology. The method includes: obtaining a text to be synthesized and a specified acoustic feature, wherein the specified acoustic feature is used to indicate the rhythmic feature of the audio, extracting a phoneme sequence corresponding to the text to be synthesized, expanding the specified acoustic feature according to the phoneme sequence, obtaining an acoustic feature sequence, and inputting the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model to obtain a target audio corresponding to the text to be synthesized output by the speech synthesis model, wherein the acoustic feature of the target audio matches the specified acoustic feature. The present disclosure controls the speech synthesis of the text by specifying the acoustic feature, so that the target audio output by the speech synthesis model can correspond to the specified acoustic feature, and can realize the explicit control of the acoustic feature in the speech synthesis process, thereby improving the expressiveness of the target audio.

Description

语音合成方法、装置、可读介质及电子设备Speech synthesis method, device, readable medium and electronic device

技术领域Technical Field

本公开涉及电子信息处理技术领域,具体地,涉及一种语音合成方法、装置、可读介质及电子设备。The present disclosure relates to the technical field of electronic information processing, and in particular, to a speech synthesis method, device, readable medium and electronic device.

背景技术Background technique

随着电子信息处理技术的不断发展,语音作为人们获取信息的重要载体,已经被广泛应用于日常生活和工作中。涉及语音的应用场景中,通常会包括语音合成的处理,语音合成是指将用户指定的文本,合成为音频。语音合成过程中,如果需要根据指定的文本,合成符合某种声学特征的目标语音,需要借助预先准备的,符合该种声学特征的参考语音。然而,参考语音的时长往往与目标语音的时长差别较大,会导致合成结果不稳定。并且,针对用户多样化的需求,也很难预先准备各种声学特征对应的参考语音。因此,在语音合成过程中,无法实现对声学特征的有效控制。With the continuous development of electronic information processing technology, voice, as an important carrier for people to obtain information, has been widely used in daily life and work. Application scenarios involving voice usually include speech synthesis processing, which refers to synthesizing user-specified text into audio. In the process of speech synthesis, if it is necessary to synthesize a target speech that meets certain acoustic characteristics based on the specified text, it is necessary to use a pre-prepared reference speech that meets the acoustic characteristics. However, the duration of the reference speech is often quite different from that of the target speech, which will lead to unstable synthesis results. In addition, it is difficult to prepare reference speech corresponding to various acoustic features in advance to meet the diverse needs of users. Therefore, in the process of speech synthesis, effective control of acoustic features cannot be achieved.

发明内容Summary of the invention

提供该发明内容部分以便以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。该发明内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

第一方面,本公开提供一种语音合成方法,所述方法包括:In a first aspect, the present disclosure provides a speech synthesis method, the method comprising:

获取待合成文本和指定声学特征,所述指定声学特征用于指示音频的韵律特征;Acquire a text to be synthesized and a specified acoustic feature, where the specified acoustic feature is used to indicate a prosodic feature of the audio;

提取所述待合成文本对应的音素序列;Extracting a phoneme sequence corresponding to the text to be synthesized;

将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;Expanding the specified acoustic feature according to the phoneme sequence to obtain an acoustic feature sequence;

将所述音素序列和所述声学特征序列输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的目标音频,所述目标音频的声学特征与所述指定声学特征匹配。The phoneme sequence and the acoustic feature sequence are input into a pre-trained speech synthesis model to obtain a target audio corresponding to the text to be synthesized output by the speech synthesis model, wherein the acoustic features of the target audio match the specified acoustic features.

第二方面,本公开提供一种语音合成装置,所述装置包括:In a second aspect, the present disclosure provides a speech synthesis device, the device comprising:

获取模块,用于获取待合成文本和指定声学特征,所述指定声学特征用于指示音频的韵律特征;An acquisition module, used for acquiring the text to be synthesized and a specified acoustic feature, wherein the specified acoustic feature is used for indicating the prosodic feature of the audio;

提取模块,用于提取所述待合成文本对应的音素序列;An extraction module, used for extracting a phoneme sequence corresponding to the text to be synthesized;

扩展模块,用于将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;An expansion module, used for expanding the specified acoustic feature according to the phoneme sequence to obtain an acoustic feature sequence;

合成模块,用于将所述音素序列和所述声学特征序列输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的目标音频,所述目标音频的声学特征与所述指定声学特征匹配。A synthesis module is used to input the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model to obtain the target audio corresponding to the text to be synthesized output by the speech synthesis model, and the acoustic features of the target audio match the specified acoustic features.

第三方面,本公开提供一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现本公开第一方面所述方法的步骤。In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect of the present disclosure.

第四方面,本公开提供一种电子设备,包括:In a fourth aspect, the present disclosure provides an electronic device, including:

存储装置,其上存储有计算机程序;a storage device having a computer program stored thereon;

处理装置,用于执行所述存储装置中的所述计算机程序,以实现本公开第一方面所述方法的步骤。A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect of the present disclosure.

通过上述技术方案,本公开首先获取待合成文本,和用于指示音频的韵律特征的指定声学特征,之后从待合成文本中,提取出对应的音素序列,再按照音素序列,将指定声学特征进行扩展,得到声学特征序列,最后将音素序列和声学特征序列输入预先训练的语音合成模型,从而得到语音合成模型输出的待合成文本对应的,与指定声学特征匹配的目标音频。本公开通过指定声学特征来控制文本的语音合成,使得语音合成模型输出的目标音频能够与指定声学特征对应,能够实现语音合成过程中声学特征的显性控制,提高了目标音频的表现力。Through the above technical solution, the present disclosure first obtains the text to be synthesized and the specified acoustic features used to indicate the rhythmic features of the audio, then extracts the corresponding phoneme sequence from the text to be synthesized, and then expands the specified acoustic features according to the phoneme sequence to obtain the acoustic feature sequence, and finally inputs the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model, thereby obtaining the target audio that matches the specified acoustic features and corresponds to the text to be synthesized output by the speech synthesis model. The present disclosure controls the speech synthesis of the text by specifying the acoustic features, so that the target audio output by the speech synthesis model can correspond to the specified acoustic features, and can realize the explicit control of the acoustic features in the speech synthesis process, thereby improving the expressiveness of the target audio.

本公开的其他特征和优点将在随后的具体实施方式部分予以详细说明。Other features and advantages of the present disclosure will be described in detail in the following detailed description.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。在附图中:The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:

图1是根据一示例性实施例示出的一种语音合成方法的流程图;FIG1 is a flow chart of a speech synthesis method according to an exemplary embodiment;

图2是根据一示例性实施例示出的另一种语音合成方法的流程图;FIG2 is a flow chart of another speech synthesis method according to an exemplary embodiment;

图3是根据一示例性实施例示出的一种语音合成模型的处理流程图;FIG3 is a processing flow chart of a speech synthesis model according to an exemplary embodiment;

图4是根据一示例性实施例示出的一种语音合成模型的框图;FIG4 is a block diagram of a speech synthesis model according to an exemplary embodiment;

图5是根据一示例性实施例示出的一种训练语音合成模型的流程图;FIG5 is a flow chart of a training speech synthesis model according to an exemplary embodiment;

图6是根据一示例性实施例示出的另一种训练语音合成模型的流程图;FIG6 is a flow chart of another method for training a speech synthesis model according to an exemplary embodiment;

图7是根据一示例性实施例示出的另一种训练语音合成模型的流程图;FIG7 is a flow chart of another method for training a speech synthesis model according to an exemplary embodiment;

图8是根据一示例性实施例示出的一种语音合成装置的框图;FIG8 is a block diagram of a speech synthesis device according to an exemplary embodiment;

图9是根据一示例性实施例示出的另一种语音合成装置的框图;FIG9 is a block diagram of another speech synthesis device according to an exemplary embodiment;

图10是根据一示例性实施例示出的一种电子设备的框图。Fig. 10 is a block diagram of an electronic device according to an exemplary embodiment.

具体实施方式Detailed ways

下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and/or in parallel. In addition, the method embodiments may include additional steps and/or omit the steps shown. The scope of the present disclosure is not limited in this respect.

本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

图1是根据一示例性实施例示出的一种语音合成方法的流程图,如图1所示,该方法可以包括以下步骤:FIG. 1 is a flow chart of a speech synthesis method according to an exemplary embodiment. As shown in FIG. 1 , the method may include the following steps:

步骤101,获取待合成文本和指定声学特征,指定声学特征用于指示音频的韵律特征。Step 101, obtaining the text to be synthesized and the specified acoustic features, where the specified acoustic features are used to indicate the prosodic features of the audio.

举例来说,首先获取需要进行合成的待合成文本。待合成文本例如可以是用户指定的文本文件中的一个或多个语句,也可以是文本文件中的一个或多个段落、一个或多个章节,还可以是一个文本文件中的一个或多个词语。文本文件例如可以是一部电子书,也可以是其他类型的文件,例如新闻、公众号文章、博客等。同时,还可以获取指定声学特征,指定声学特征可以理解为用户指定的,期望将待合成文本合成为符合指定声学特征的音频(即后文提及的目标音频)。指定声学特征可以包括多个维度,例如可以包括基频(英文:Pitch)、音量(英文:Energy)、语速(英文:Duration)中的一种或多种,还可以包括:噪声水平、音调、音色、响度等。其中,噪声水平可以理解为能够反映音频中噪声大小的特征。For example, first obtain the text to be synthesized that needs to be synthesized. The text to be synthesized can be, for example, one or more sentences in a text file specified by the user, or one or more paragraphs, one or more chapters in a text file, or one or more words in a text file. The text file can be, for example, an e-book, or other types of files, such as news, public account articles, blogs, etc. At the same time, the specified acoustic features can also be obtained. The specified acoustic features can be understood as specified by the user, and it is expected that the text to be synthesized will be synthesized into audio that meets the specified acoustic features (i.e., the target audio mentioned later). The specified acoustic features can include multiple dimensions, for example, it can include one or more of the fundamental frequency (English: Pitch), volume (English: Energy), and speech speed (English: Duration), and can also include: noise level, pitch, timbre, loudness, etc. Among them, the noise level can be understood as a feature that can reflect the size of the noise in the audio.

步骤102,提取待合成文本对应的音素序列。Step 102: extract the phoneme sequence corresponding to the text to be synthesized.

示例的,可以将待合成文本输入预先训练的识别模型,以得到识别模型输出的,待合成文本对应的音素序列。也可以在预先建立的字典中,查找待合成文本中的每个字对应的音素,然后将每个字对应的音素组成待合成文本对应的音素序列。其中,音素可以理解为根据每个字的发音划分出的语音单位,也可以理解为每个字对应的拼音中的元音和辅音。音素序列中,包括了待合成文本中每个字对应的音素(一个字可以对应一个或多个音素)。例如,待合成文本为“今天天气很好”,可以依次在字典中查找每个字对应的音素,从而确定音素序列为“jintiantianqihenhao”。For example, the text to be synthesized can be input into a pre-trained recognition model to obtain the phoneme sequence corresponding to the text to be synthesized output by the recognition model. It is also possible to search for the phonemes corresponding to each character in the text to be synthesized in a pre-established dictionary, and then combine the phonemes corresponding to each character into a phoneme sequence corresponding to the text to be synthesized. Among them, phonemes can be understood as speech units divided according to the pronunciation of each character, and can also be understood as vowels and consonants in the pinyin corresponding to each character. The phoneme sequence includes the phonemes corresponding to each character in the text to be synthesized (one character can correspond to one or more phonemes). For example, if the text to be synthesized is "Today's weather is very good", the phonemes corresponding to each character can be searched in the dictionary in turn, so as to determine that the phoneme sequence is "jintiantianqihenhao".

步骤103,将指定声学特征按照音素序列进行扩展,得到声学特征序列。Step 103: Expand the designated acoustic feature according to the phoneme sequence to obtain an acoustic feature sequence.

步骤104,将音素序列和声学特征序列输入预先训练的语音合成模型,以得到语音合成模型输出的,待合成文本对应的目标音频,目标音频的声学特征与指定声学特征匹配。Step 104, input the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model to obtain the target audio corresponding to the text to be synthesized output by the speech synthesis model, and the acoustic features of the target audio match the specified acoustic features.

示例的,在得到音素序列之后,可以按照音素序列,将指定声学特征进行扩展,得到声学特征序列,声学特征序列中,包括了音素序列中,每个音素对应的声学特征。在一种实现方式中,可以根据音素序列的长度(即音素序列中包括的音素的数量),生成声学特征序列,其中每个音素对应的声学特征均为指定声学特征。在另一种实现方式中,也可以将指定声学特征作为平均值(或者标准差),按照预设的分布(例如高斯分布或者均匀分布),生成每个音素对应的声学特征。For example, after obtaining the phoneme sequence, the specified acoustic feature can be expanded according to the phoneme sequence to obtain an acoustic feature sequence, and the acoustic feature sequence includes the acoustic feature corresponding to each phoneme in the phoneme sequence. In one implementation, the acoustic feature sequence can be generated according to the length of the phoneme sequence (i.e., the number of phonemes included in the phoneme sequence), wherein the acoustic feature corresponding to each phoneme is the specified acoustic feature. In another implementation, the specified acoustic feature can also be used as the average value (or standard deviation) to generate the acoustic feature corresponding to each phoneme according to a preset distribution (e.g., Gaussian distribution or uniform distribution).

之后,可以将音素序列和声学特征序列作为预先训练的语音合成模型的输入,语音合成模型输出的,即为待合成文本对应的,与指定声学特征匹配的目标音频。其中,语音合成模型可以是预先训练的,可以理解成一种TTS(英文:Text To Speech,中文:从文本到语音)模型,能够根据待合成文本和指定声学特征,生成待合成文本对应的,与指定声学特征匹配的目标音频。具体的,语音合成模型可以是基于Tacotron模型、Deepvoice 3模型、Tacotron2模型、Wavenet模型等训练得到的,本公开对此不作具体限定。这样,在对待合成文本中进行语音合成的过程中,除了待合成文本中包括的语义,还考虑了指定声学特征,能够使目标音频具有指定声学特征,从而实现在语音合成的过程中,声学特征的显性控制,而无需花费大量的时间成本和人力成本预先创建各种声学特征对应的参考语音,同时也避免了由于参考语音和目标音频的时长差别较大导致的不稳定的问题,提高了目标音频的表现力,同时也改善了用户的听觉体验。Afterwards, the phoneme sequence and the acoustic feature sequence can be used as the input of a pre-trained speech synthesis model, and the output of the speech synthesis model is the target audio corresponding to the text to be synthesized and matching the specified acoustic features. Among them, the speech synthesis model can be pre-trained, which can be understood as a TTS (English: Text To Speech, Chinese: from text to speech) model, which can generate the target audio corresponding to the text to be synthesized and matching the specified acoustic features according to the text to be synthesized and the specified acoustic features. Specifically, the speech synthesis model can be trained based on the Tacotron model, Deepvoice 3 model, Tacotron2 model, Wavenet model, etc., and the present disclosure does not make specific limitations on this. In this way, in the process of speech synthesis for the text to be synthesized, in addition to the semantics included in the text to be synthesized, the specified acoustic features are also taken into consideration, so that the target audio can have the specified acoustic features, thereby realizing the explicit control of the acoustic features in the process of speech synthesis, without spending a lot of time and manpower costs to pre-create reference speech corresponding to various acoustic features. At the same time, it also avoids the instability problem caused by the large difference in duration between the reference speech and the target audio, improves the expressiveness of the target audio, and also improves the user's auditory experience.

综上所述,本公开首先获取待合成文本,和用于指示音频的韵律特征的指定声学特征,之后从待合成文本中,提取出对应的音素序列,再按照音素序列,将指定声学特征进行扩展,得到声学特征序列,最后将音素序列和声学特征序列输入预先训练的语音合成模型,从而得到语音合成模型输出的待合成文本对应的,与指定声学特征匹配的目标音频。本公开通过指定声学特征来控制文本的语音合成,使得语音合成模型输出的目标音频能够与指定声学特征对应,能够实现语音合成过程中声学特征的显性控制,提高了目标音频的表现力。In summary, the present disclosure first obtains the text to be synthesized and the specified acoustic features for indicating the rhythmic features of the audio, then extracts the corresponding phoneme sequence from the text to be synthesized, and then expands the specified acoustic features according to the phoneme sequence to obtain the acoustic feature sequence, and finally inputs the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model, thereby obtaining the target audio that matches the specified acoustic features and corresponds to the text to be synthesized output by the speech synthesis model. The present disclosure controls the speech synthesis of text by specifying acoustic features, so that the target audio output by the speech synthesis model can correspond to the specified acoustic features, and can realize the explicit control of the acoustic features in the speech synthesis process, thereby improving the expressiveness of the target audio.

图2是根据一示例性实施例示出的另一种语音合成方法的流程图,如图2所示,步骤103的实现方式可以包括:FIG. 2 is a flow chart of another speech synthesis method according to an exemplary embodiment. As shown in FIG. 2 , the implementation of step 103 may include:

步骤1031,根据指定声学特征,确定音素序列中每个音素对应的声学特征。Step 1031: Determine the acoustic feature corresponding to each phoneme in the phoneme sequence according to the specified acoustic feature.

步骤1032,将每个音素对应的声学特征组成声学特征序列。Step 1032: The acoustic features corresponding to each phoneme are combined into an acoustic feature sequence.

示例的,在一种实现方式中,可以先确定音素序列的长度,即音素序列中包括的音素的数量。然后对指定声学特征进行复制,得到一个与音素序列的长度相同的声学特征序列,其中,每个声学特征都与指定声学特征相同,也就是说,声学特征序列中每个音素对应的声学特征均为指定声学特征。例如,音素序列的长度为100(即其中包括100个音素),那么可以将每个音素对应的声学特征都确定为指定声学特征,那么可以将100个音素对应的声学特征组成声学特征序列。以指定声学特征为1*5维的向量来举例,那么声学特征序列包括100个1*5维的向量,可以组成100*5维的向量。For example, in one implementation, the length of the phoneme sequence, that is, the number of phonemes included in the phoneme sequence, can be determined first. Then the specified acoustic feature is copied to obtain an acoustic feature sequence with the same length as the phoneme sequence, wherein each acoustic feature is the same as the specified acoustic feature, that is, the acoustic feature corresponding to each phoneme in the acoustic feature sequence is the specified acoustic feature. For example, if the length of the phoneme sequence is 100 (i.e., it includes 100 phonemes), then the acoustic feature corresponding to each phoneme can be determined as the specified acoustic feature, and then the acoustic features corresponding to the 100 phonemes can be composed into an acoustic feature sequence. Taking the specified acoustic feature as a 1*5-dimensional vector as an example, the acoustic feature sequence includes 100 1*5-dimensional vectors, which can form a 100*5-dimensional vector.

图3是根据一示例性实施例示出的一种语音合成模型的处理流程图,如图3所示,语音合成模型可以用于执行以下步骤:FIG. 3 is a processing flow chart of a speech synthesis model according to an exemplary embodiment. As shown in FIG. 3 , the speech synthesis model can be used to perform the following steps:

步骤A,根据音素序列确定待合成文本对应的文本特征序列,文本特征序列包括音素序列中每个音素对应的文本特征。Step A: determining a text feature sequence corresponding to the text to be synthesized according to the phoneme sequence, wherein the text feature sequence includes a text feature corresponding to each phoneme in the phoneme sequence.

步骤B,根据文本特征序列与声学特征序列,生成目标音频。Step B: Generate target audio based on the text feature sequence and the acoustic feature sequence.

举例来说,语音合成模型合成目标音频的具体过程,可以先根据音素序列,提取待合成文本对应的文本特征序列(即Text Embedding),文本特征序列中包括了音素序列中每个音素对应的文本特征,文本特征可以理解为能够表征该音素的文本向量。例如,音素序列中包括100个音素,每个音素对应的文本向量为1*80维的向量,那么文本特征序列可以为100*80维的向量。For example, the specific process of synthesizing the target audio by the speech synthesis model can first extract the text feature sequence (i.e., Text Embedding) corresponding to the text to be synthesized based on the phoneme sequence. The text feature sequence includes the text features corresponding to each phoneme in the phoneme sequence. The text feature can be understood as a text vector that can represent the phoneme. For example, the phoneme sequence includes 100 phonemes, and the text vector corresponding to each phoneme is a 1*80-dimensional vector, so the text feature sequence can be a 100*80-dimensional vector.

在获得文本特征序列之后,可以将文本特征序列与声学特征序列进行结合,以生成与指定声学特征匹配的目标音频。例如,可以将文本特征序列与声学特征序列进行拼接,得到一个组合序列,然后根据组合序列生成目标音频。例如,音素序列中包括100个音素,文本特征序列可以为100*80维的向量,相应的声学特征序列为100*5维的向量,那么组合序列可以为100*85维的向量。可以根据这个100*85维的向量,生成目标音频。After obtaining the text feature sequence, the text feature sequence can be combined with the acoustic feature sequence to generate a target audio that matches the specified acoustic feature. For example, the text feature sequence and the acoustic feature sequence can be concatenated to obtain a combined sequence, and then the target audio is generated based on the combined sequence. For example, the phoneme sequence includes 100 phonemes, the text feature sequence can be a 100*80-dimensional vector, and the corresponding acoustic feature sequence is a 100*5-dimensional vector, then the combined sequence can be a 100*85-dimensional vector. The target audio can be generated based on this 100*85-dimensional vector.

以图4所示的语音合成模型来举例,语音合成模型为Tacotron模型,其中包括:编码器(即Encoder)、注意力网络(即Attention)、解码器(即Decoder)和后处理网络(即Post-processing)。编码器可以包括嵌入层(即Character Embedding层)、预处理网络(Pre-net)子模型和CBHG(英文:Convolution Bank+Highway network+bidirectional GatedRecurrent Unit,中文:卷积层+高速网络+双向递归神经网络)子模型。可以将音素序列输入编码器,首先,通过嵌入层将音素序列转换为词向量,然后将词向量输入至Pre-net子模型,以对词向量进行非线性变换,从而提升语音合成模型的收敛和泛化能力,最后,通过CBHG子模型根据非线性变换后的词向量,获得能够表征待合成文本的文本特征序列。Taking the speech synthesis model shown in FIG4 as an example, the speech synthesis model is a Tacotron model, which includes: an encoder (i.e., Encoder), an attention network (i.e., Attention), a decoder (i.e., Decoder) and a post-processing network (i.e., Post-processing). The encoder may include an embedding layer (i.e., Character Embedding layer), a pre-processing network (Pre-net) sub-model and a CBHG (English: Convolution Bank + Highway network + bidirectional Gated Recurrent Unit, Chinese: Convolution layer + high-speed network + bidirectional recurrent neural network) sub-model. The phoneme sequence can be input into the encoder. First, the phoneme sequence is converted into a word vector through the embedding layer, and then the word vector is input into the Pre-net sub-model to perform a nonlinear transformation on the word vector, thereby improving the convergence and generalization ability of the speech synthesis model. Finally, the text feature sequence that can represent the text to be synthesized is obtained according to the word vector after nonlinear transformation through the CBHG sub-model.

之后可以将声学特征序列和编码器输出的文本特征序列进行拼接,得到组合序列,再将组合序列输入注意力网络,注意力网络可以为组合序列中的每个元素增加一个注意力权重。具体的,注意力网络可以为位置敏感注意力(英文:Locative SensitiveAttention)网络,也可以为GMM(英文:Gaussian Mixture Model,缩写GMM)attention网络,还可以是Multi-Head Attention网络,本公开对此不作具体限定。Afterwards, the acoustic feature sequence and the text feature sequence output by the encoder can be concatenated to obtain a combined sequence, and then the combined sequence is input into the attention network, and the attention network can add an attention weight to each element in the combined sequence. Specifically, the attention network can be a location sensitive attention (English: Location Sensitive Attention) network, or a GMM (English: Gaussian Mixture Model, abbreviated GMM) attention network, or a Multi-Head Attention network, which is not specifically limited in the present disclosure.

再将注意力网络的输出作为解码器的输入。解码器可以包括预处理网络子模型(可以与编码器中包括的预处理网络子模型的相同)、Attention-RNN、Decoder-RNN。预处理网络子模型用于对输入进行非线性变换,Attention-RNN的结构为一层单向的、基于zoneout的LSTM(英文:Long Short-Term Memory,中文:长短期记忆网络),能够将预处理网络子模型的输出作为输入,经过LSTM单元后输出到Decoder-RNN中。Decode-RNN为两层单向的、基于zoneout的LSTM,经过LSTM单元输出梅尔频谱信息,梅尔频谱信息中可以包括一个或多个梅尔频谱特征。最后将梅尔频谱信息输入后处理网络,后处理网络可以包括声码器(例如,Wavenet声码器、Griffin-Lim声码器等),用于对梅尔频谱特征信息进行转换,以得到目标音频。The output of the attention network is then used as the input of the decoder. The decoder may include a preprocessing network submodel (which may be the same as the preprocessing network submodel included in the encoder), Attention-RNN, and Decoder-RNN. The preprocessing network submodel is used to perform nonlinear transformation on the input. The structure of Attention-RNN is a one-layer unidirectional, zoneout-based LSTM (English: Long Short-Term Memory, Chinese: Long Short-Term Memory Network), which can take the output of the preprocessing network submodel as input and output it to the Decoder-RNN after passing through the LSTM unit. The Decoder-RNN is a two-layer unidirectional, zoneout-based LSTM, which outputs Mel spectrum information through the LSTM unit, and the Mel spectrum information may include one or more Mel spectrum features. Finally, the Mel spectrum information is input into the post-processing network, which may include a vocoder (for example, Wavenet vocoder, Griffin-Lim vocoder, etc.) for converting the Mel spectrum feature information to obtain the target audio.

图5是根据一示例性实施例示出的一种训练语音合成模型的流程图,如图5所示,语音合成模型是通过如下方式训练获得的:FIG5 is a flow chart showing a method of training a speech synthesis model according to an exemplary embodiment. As shown in FIG5 , the speech synthesis model is obtained by training in the following manner:

步骤C,提取训练文本对应的训练音频的真实声学特征,真实声学特征用于指示训练音频的韵律特征。Step C, extracting the real acoustic features of the training audio corresponding to the training text, where the real acoustic features are used to indicate the prosodic features of the training audio.

步骤D,将真实声学特征按照训练文本对应的训练音素序列进行扩展,得到训练声学特征序列。Step D: Expand the real acoustic features according to the training phoneme sequence corresponding to the training text to obtain a training acoustic feature sequence.

步骤E,将训练音素序列和训练声学特征序列输入语音合成模型,并根据语音合成模型的输出与训练音频,训练语音合成模型。Step E: input the training phoneme sequence and the training acoustic feature sequence into the speech synthesis model, and train the speech synthesis model according to the output of the speech synthesis model and the training audio.

对语音合成模型进行训练,需要先获取训练文本和训练文本对应的训练音频,训练文本可以有多个,相应的,训练音频也有多个。例如可以通过在互联网上抓取大量的文本作为训练文本,然后将训练文本对应的音频,作为训练音频。针对训练音频,可以提取训练音频对应的真实声学特征。例如,可以通过信号处理、标注等方式,得到训练音频对应的真实声学特征,其中,真实声学特征用于指示训练音频的韵律特征,可以包括:训练音频的基频、音量、语速中的至少一种,还可以包括:噪声水平、音调、音色、响度等。同时,还可以提取训练文本对应的训练音素序列,训练音素序列中,可以包括训练文本中每个字对应的训练音素(一个字可以对应一个或多个训练音素)。To train the speech synthesis model, it is necessary to first obtain the training text and the training audio corresponding to the training text. There can be multiple training texts, and correspondingly, there are also multiple training audios. For example, a large amount of text can be captured on the Internet as training text, and then the audio corresponding to the training text is used as training audio. For the training audio, the real acoustic features corresponding to the training audio can be extracted. For example, the real acoustic features corresponding to the training audio can be obtained by signal processing, annotation, etc., wherein the real acoustic features are used to indicate the rhythmic features of the training audio, and may include: at least one of the fundamental frequency, volume, and speech rate of the training audio, and may also include: noise level, pitch, timbre, loudness, etc. At the same time, the training phoneme sequence corresponding to the training text can also be extracted. The training phoneme sequence can include the training phonemes corresponding to each word in the training text (one word can correspond to one or more training phonemes).

之后,将真实声学特征按照训练文本对应的训练音素序列进行扩展,得到训练声学特征序列。训练声学特征序列中包括了每个训练音素对应的训练声学特征。例如,可以根据训练音素序列中包括的训练音素的数量,生成训练声学特征序列,其中,每个训练音素对应的训练声学特征均为真实声学特征。Afterwards, the real acoustic features are expanded according to the training phoneme sequence corresponding to the training text to obtain a training acoustic feature sequence. The training acoustic feature sequence includes the training acoustic features corresponding to each training phoneme. For example, the training acoustic feature sequence can be generated according to the number of training phonemes included in the training phoneme sequence, wherein the training acoustic features corresponding to each training phoneme are all real acoustic features.

最后,将训练音素序列和训练声学特征序列,作为语音合成模型的输入,并根据语音合成模型的输出与训练音频,训练语音合成模型。例如,可以根据语音合成模型的输出,与训练音频的差(或者均方差)作为语音合成模型的损失函数,以降低损失函数为目标,利用反向传播算法来修正语音合成模型中的神经元的参数,神经元的参数例如可以是神经元的权重(英文:Weight)和偏置量(英文:Bias)。重复上述步骤,直至损失函数满足预设条件,例如损失函数小于预设的损失阈值。Finally, the training phoneme sequence and the training acoustic feature sequence are used as the input of the speech synthesis model, and the speech synthesis model is trained according to the output of the speech synthesis model and the training audio. For example, the difference (or mean square error) between the output of the speech synthesis model and the training audio can be used as the loss function of the speech synthesis model. With the goal of reducing the loss function, the back propagation algorithm is used to correct the parameters of the neurons in the speech synthesis model. The parameters of the neurons can be, for example, the weights (English: Weight) and biases (English: Bias) of the neurons. Repeat the above steps until the loss function meets the preset conditions, such as the loss function is less than the preset loss threshold.

图6是根据一示例性实施例示出的另一种训练语音合成模型的流程图,如图6所示,真实声学特征包括:基频、音量、语速中的至少一种,相应的,步骤C的实现方式可以包括:FIG6 is a flowchart of another method for training a speech synthesis model according to an exemplary embodiment. As shown in FIG6 , the real acoustic feature includes at least one of fundamental frequency, volume, and speech rate. Accordingly, the implementation of step C may include:

步骤C1,若真实声学特征中包括语速,根据训练音频和训练音素序列,确定训练音素序列中,每个训练音素对应的时长,以确定训练音频的语速。Step C1: if the real acoustic feature includes speech speed, determine the duration corresponding to each training phoneme in the training phoneme sequence according to the training audio and the training phoneme sequence to determine the speech speed of the training audio.

具体的实现方式可以包括:Specific implementation methods may include:

首先,根据训练音频和训练音素序列,确定每个训练音素对应的时长。例如,可以利用HTS(英文:HMM-based Speech Synthesis System),将训练音频,按照训练音素序列中包括的训练音素进行划分,以得到每个训练音素对应的时长,可以表示为durationi,表示第i个训练音素对应的时长。First, the duration corresponding to each training phoneme is determined according to the training audio and the training phoneme sequence. For example, HTS (English: HMM-based Speech Synthesis System) can be used to divide the training audio according to the training phonemes included in the training phoneme sequence to obtain the duration corresponding to each training phoneme, which can be expressed as duration i , indicating the duration corresponding to the i-th training phoneme.

之后,对每个训练音素对应的时长进行对数运算,以得到每个训练音素对应的对数时长,通过对数运算,可以将时长的变化范围进行压缩,从而放大时长的变化程度。例如可以表示为log_durationi,表示第i个训练音素对应的对数时长。Afterwards, a logarithmic operation is performed on the duration corresponding to each training phoneme to obtain the logarithmic duration corresponding to each training phoneme. By logarithmic operation, the variation range of the duration can be compressed, thereby amplifying the variation degree of the duration. For example, it can be expressed as log_duration i , which represents the logarithmic duration corresponding to the i-th training phoneme.

最后,将训练音素序列中每个训练音素对应的对数时长的统计值,作为训练音频的语速。例如可以将每个训练音素对应的对数时长的平均值(或者标准差、极值等)作为训练音频的语速,可以表示为log_duration_mean。Finally, the statistical value of the logarithmic duration corresponding to each training phoneme in the training phoneme sequence is used as the speaking speed of the training audio. For example, the average value (or standard deviation, extreme value, etc.) of the logarithmic duration corresponding to each training phoneme can be used as the speaking speed of the training audio, which can be expressed as log_duration_mean.

步骤C2,若真实声学特征中包括基频,提取训练音频包括的每个音频帧的基频,以确定训练音频的基频。Step C2: if the real acoustic feature includes the fundamental frequency, extract the fundamental frequency of each audio frame included in the training audio to determine the fundamental frequency of the training audio.

具体实现方式可以包括:Specific implementation methods may include:

首先,可以利用sox、librosa、straight等音频处理工具,对训练音频进行处理,以得到训练音频中每个音频的基频,然后对每个音频帧对应的基频进行对数运算,以得到每个音频帧对应的对数基频。通过对数运算,可以将基频的变化范围进行压缩,从而放大基频的变化程度。例如每个音频帧对应的基频可以表示为pitchj,表示第j个音频帧对应的基频,相应的,第j个音频帧对应的对数基频可以表示为log_pitchjFirst, audio processing tools such as sox, librosa, and straight can be used to process the training audio to obtain the fundamental frequency of each audio in the training audio, and then logarithmic operation is performed on the fundamental frequency corresponding to each audio frame to obtain the logarithmic fundamental frequency corresponding to each audio frame. Through logarithmic operation, the variation range of the fundamental frequency can be compressed, thereby amplifying the degree of variation of the fundamental frequency. For example, the fundamental frequency corresponding to each audio frame can be expressed as pitch j , which represents the fundamental frequency corresponding to the jth audio frame. Correspondingly, the logarithmic fundamental frequency corresponding to the jth audio frame can be expressed as log_pitch j .

然后,将训练音频中每个音频帧对应的对数基频的统计值,作为训练音频的基频。例如可以将每个音频帧对应的对数基频的平均值和对数基频的标准差,作为训练音频的基频,可以表示为log_pitch_mean和log_pitch_std,其中,log_pitch_mean能够反映训练音频整体上基频的大小,log_pitch_std能够反映训练音频的基频的变化幅度。Then, the statistical value of the logarithmic fundamental frequency corresponding to each audio frame in the training audio is used as the fundamental frequency of the training audio. For example, the mean value and standard deviation of the logarithmic fundamental frequency corresponding to each audio frame can be used as the fundamental frequency of the training audio, which can be expressed as log_pitch_mean and log_pitch_std, where log_pitch_mean can reflect the magnitude of the fundamental frequency of the training audio as a whole, and log_pitch_std can reflect the variation range of the fundamental frequency of the training audio.

步骤C3,若真实声学特征中包括音量,提取训练音频包括的每个音频帧的音量,以确定训练音频的音量。Step C3: if the real acoustic feature includes volume, extract the volume of each audio frame included in the training audio to determine the volume of the training audio.

具体实现方式可以包括:Specific implementation methods may include:

首先,可以利用sox、librosa、straight等音频处理工具,对训练音频进行处理,以得到训练音频中每个音频的音量,然后对每个音频帧对应的音量进行对数运算,以得到每个音频帧对应的对数音量。通过对数运算,可以将音量的变化范围进行压缩,从而放大音量的变化程度。例如每个音频帧对应的音量可以表示为energyj,表示第j个音频帧对应的音量。相应的,第j个音频帧对应的对数音量可以表示为log_energyjFirst, you can use audio processing tools such as sox, librosa, and straight to process the training audio to obtain the volume of each audio in the training audio, and then perform logarithmic operations on the volume corresponding to each audio frame to obtain the logarithmic volume corresponding to each audio frame. Through logarithmic operations, the range of volume changes can be compressed, thereby amplifying the degree of volume change. For example, the volume corresponding to each audio frame can be expressed as energy j , which represents the volume corresponding to the jth audio frame. Correspondingly, the logarithmic volume corresponding to the jth audio frame can be expressed as log_energy j .

然后,将每个音频帧对应的对数音量的统计值,作为训练音频的音量。例如可以将每个音频帧对应的对数音量的平均值作为训练音频的音量,可以表示为log_energy_mean。Then, the statistical value of the logarithmic volume corresponding to each audio frame is used as the volume of the training audio. For example, the average value of the logarithmic volume corresponding to each audio frame can be used as the volume of the training audio, which can be expressed as log_energy_mean.

进一步,若真实声学特征还包括噪声水平,那么步骤C还可以包括:根据训练音频对应的线性预测系数,确定训练音频对应的噪声水平。Furthermore, if the real acoustic feature also includes a noise level, step C may further include: determining the noise level corresponding to the training audio according to a linear prediction coefficient corresponding to the training audio.

示例的,可以确定训练音频的LPC系数(英文:Linear Prediction Coefficient,中文:线性预测系数),然后对训练音频的LPC系数的第1维进行对数运算,并将对数运算的结果作为训练音频对应的噪声水平,通过对数运算,可以将噪声水平的变化范围进行压缩,从而放大噪声水平的变化程度。噪声水平例如可以表示为log_spectral_tilt。For example, the LPC coefficient (Linear Prediction Coefficient) of the training audio can be determined, and then the first dimension of the LPC coefficient of the training audio is logarithmically operated, and the result of the logarithmic operation is used as the noise level corresponding to the training audio. Through the logarithmic operation, the range of noise level variation can be compressed, thereby amplifying the degree of noise level variation. The noise level can be expressed as log_spectral_tilt, for example.

在真实声学特征中包括了基频、音量、语速和噪声水平的情况下,可以将训练音频的基频、音量、语速和噪声水平,组成训练音频的真实声学特征。例如,真实声学特征可以是一个1*5维的向量:{基频:(log_pitch_mean,log_pitch_std),音量:log_energy_mean,语速:log_duration_mean,噪声水平:log_spectral_tilt}。相应的,在指定声学特征包括了基频、音量、语速和噪声水平的情况下,步骤101中获取的指定声学特征,也可以包括上述5个维度。In the case where the fundamental frequency, volume, speaking rate and noise level are included in the real acoustic features, the fundamental frequency, volume, speaking rate and noise level of the training audio can be used to form the real acoustic features of the training audio. For example, the real acoustic feature can be a 1*5-dimensional vector: {fundamental frequency: (log_pitch_mean, log_pitch_std), volume: log_energy_mean, speaking rate: log_duration_mean, noise level: log_spectral_tilt}. Accordingly, in the case where the specified acoustic features include the fundamental frequency, volume, speaking rate and noise level, the specified acoustic features obtained in step 101 can also include the above 5 dimensions.

图7是根据一示例性实施例示出的另一种训练语音合成模型的流程图,如图7所示,语音合成模型还可以是通过如下方式训练获得的:FIG. 7 is a flowchart of another method for training a speech synthesis model according to an exemplary embodiment. As shown in FIG. 7 , the speech synthesis model may also be obtained by training in the following manner:

步骤F,根据预设的训练集中包括多个训练音频的真实声学特征,确定训练集的统计声学特征。Step F: determining the statistical acoustic features of the training set according to the real acoustic features of a plurality of training audios included in the preset training set.

步骤G,根据统计声学特征对每个训练音频的真实声学特征进行归一化处理。Step G, normalizing the true acoustic features of each training audio according to the statistical acoustic features.

相应的,步骤D的实现方式可以为:Accordingly, step D may be implemented as follows:

将归一化处理后的真实声学特征,按照训练音素序列进行扩展,得到训练声学特征序列。The normalized real acoustic features are expanded according to the training phoneme sequence to obtain a training acoustic feature sequence.

举例来说,在对真实声学特征进行扩展之前,还可以对真实声学特征进行归一化处理。例如,训练集中包括多个训练文本,每个训练文本对应一个训练音频。可以按照步骤C1至C4的方式,确定每个训练音频的真实声学特征,并确定训练集的统计声学特征。统计声学特征例如可以是真实声学特征的平均值、标准差、方差或者极值等。然后再根据统计声学特征对每个训练音频的真实声学特征进行归一化处理。例如,可以将真实声学特征的平均值μ和标准差σ,作为统计声学特征,然后将处于[μ-3σ,μ+3σ]之间的真实声学特征,映射到[-1,1]内,处于[μ-3σ,μ+3σ]之外的真实声学特征,可以截断为-1或1。还可以分别求得真实声学特征中每个维度的平均值和标准差,并对真实声学特征中每个维度进行归一化处理。例如,以真实声学特征中的log_pitch_mean来举例,可以求得每个训练音频的log_pitch_mean的平均值pitch_μ和标准差pitch_σ,然后将处于[pitch_μ-3pitch_σ,pitch_μ+3pitch_σ]之间的log_pitch_mean,映射到[-1,1]内,将处于[pitch_μ-3pitch_σ,pitch_μ+3pitch_σ]之外的log_pitch_mean,截断为-1或1,以对log_pitch_mean进行归一化处理。For example, before the real acoustic features are expanded, the real acoustic features can also be normalized. For example, the training set includes multiple training texts, each training text corresponds to a training audio. The real acoustic features of each training audio can be determined in the manner of steps C1 to C4, and the statistical acoustic features of the training set can be determined. The statistical acoustic features can be, for example, the mean value, standard deviation, variance or extreme value of the real acoustic features. Then the real acoustic features of each training audio are normalized according to the statistical acoustic features. For example, the mean value μ and standard deviation σ of the real acoustic features can be used as statistical acoustic features, and then the real acoustic features between [μ-3σ, μ+3σ] are mapped to [-1,1], and the real acoustic features outside [μ-3σ, μ+3σ] can be truncated to -1 or 1. The mean value and standard deviation of each dimension in the real acoustic features can also be obtained respectively, and each dimension in the real acoustic features can be normalized. For example, taking the log_pitch_mean in the real acoustic feature as an example, the average pitch_μ and standard deviation pitch_σ of the log_pitch_mean of each training audio can be obtained, and then the log_pitch_mean between [pitch_μ-3pitch_σ, pitch_μ+3pitch_σ] is mapped to [-1,1], and the log_pitch_mean outside [pitch_μ-3pitch_σ, pitch_μ+3pitch_σ] is truncated to -1 or 1 to normalize the log_pitch_mean.

进一步的,可以将归一化处理后的真实声学特征,按照训练音素序列进行扩展,得到训练声学特征序列。例如,可以根据训练音素序列中包括的训练音素的数量,生成训练声学特征序列,其中,每个训练音素对应的训练声学特征均为归一化处理后的真实声学特征。Furthermore, the normalized real acoustic features can be expanded according to the training phoneme sequence to obtain a training acoustic feature sequence. For example, the training acoustic feature sequence can be generated according to the number of training phonemes included in the training phoneme sequence, wherein the training acoustic features corresponding to each training phoneme are all normalized real acoustic features.

需要说明的是,步骤101中获取的指定声学特征,也可以包括上述经过归一化处理的5个维度。归一化处理后的指定声学特征,更具有解释性。以指定声学特征为{-1,1,0,1,0}为例,其中,log_pitch_mean的值为-1,那么表示语音合成模型生成的,符合指定声学特征的目标音频的特点是低沉。log_pitch_std的值为1,表示目标音频的基频变化大。log_energy_mean的值为0,表示目标音频是正常音量。log_duration_mean对应的值为1,表示目标音频的语速慢(即音素对应的平均时长长)。log_spectral_tilt对应的值为0,表示目标音频的噪声水平为正常。It should be noted that the specified acoustic features obtained in step 101 may also include the above-mentioned 5 dimensions that have been normalized. The specified acoustic features after normalization are more explanatory. Taking the specified acoustic features as {-1, 1, 0, 1, 0} as an example, where the value of log_pitch_mean is -1, it means that the target audio generated by the speech synthesis model and meeting the specified acoustic features is characterized by being low. The value of log_pitch_std is 1, indicating that the fundamental frequency of the target audio varies greatly. The value of log_energy_mean is 0, indicating that the target audio is of normal volume. The corresponding value of log_duration_mean is 1, indicating that the speaking speed of the target audio is slow (that is, the average duration corresponding to the phonemes is long). The corresponding value of log_spectral_tilt is 0, indicating that the noise level of the target audio is normal.

综上所述,本公开首先获取待合成文本,和用于指示音频的韵律特征的指定声学特征,之后从待合成文本中,提取出对应的音素序列,再按照音素序列,将指定声学特征进行扩展,得到声学特征序列,最后将音素序列和声学特征序列输入预先训练的语音合成模型,从而得到语音合成模型输出的待合成文本对应的,与指定声学特征匹配的目标音频。本公开通过指定声学特征来控制文本的语音合成,使得语音合成模型输出的目标音频能够与指定声学特征对应,能够实现语音合成过程中声学特征的显性控制,提高了目标音频的表现力。In summary, the present disclosure first obtains the text to be synthesized and the specified acoustic features for indicating the rhythmic features of the audio, then extracts the corresponding phoneme sequence from the text to be synthesized, and then expands the specified acoustic features according to the phoneme sequence to obtain the acoustic feature sequence, and finally inputs the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model, thereby obtaining the target audio that matches the specified acoustic features and corresponds to the text to be synthesized output by the speech synthesis model. The present disclosure controls the speech synthesis of text by specifying acoustic features, so that the target audio output by the speech synthesis model can correspond to the specified acoustic features, and can realize the explicit control of the acoustic features in the speech synthesis process, thereby improving the expressiveness of the target audio.

图8是根据一示例性实施例示出的一种语音合成装置的框图,如图8所示,该装置200可以包括以下模块:FIG8 is a block diagram of a speech synthesis device according to an exemplary embodiment. As shown in FIG8 , the device 200 may include the following modules:

获取模块201,用于获取待合成文本和指定声学特征,指定声学特征用于指示音频的韵律特征。The acquisition module 201 is used to acquire the text to be synthesized and the specified acoustic features, where the specified acoustic features are used to indicate the prosodic features of the audio.

提取模块202,用于提取待合成文本对应的音素序列。The extraction module 202 is used to extract the phoneme sequence corresponding to the text to be synthesized.

扩展模块203,用于将指定声学特征按照音素序列进行扩展,得到声学特征序列。The expansion module 203 is used to expand the specified acoustic feature according to the phoneme sequence to obtain an acoustic feature sequence.

合成模块204,用于将音素序列和声学特征序列输入预先训练的语音合成模型,以得到语音合成模型输出的,待合成文本对应的目标音频,目标音频的声学特征与指定声学特征匹配。The synthesis module 204 is used to input the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model to obtain the target audio corresponding to the text to be synthesized output by the speech synthesis model, and the acoustic features of the target audio match the specified acoustic features.

图9是根据一示例性实施例示出的另一种语音合成装置的框图,如图9所示,扩展模块203可以包括:FIG. 9 is a block diagram of another speech synthesis device according to an exemplary embodiment. As shown in FIG. 9 , the expansion module 203 may include:

确定子模块2031,用于根据指定声学特征,确定音素序列中每个音素对应的声学特征。The determination submodule 2031 is used to determine the acoustic feature corresponding to each phoneme in the phoneme sequence according to the specified acoustic feature.

扩展子模块2032,用于将每个音素对应的声学特征组成声学特征序列。The expansion submodule 2032 is used to combine the acoustic features corresponding to each phoneme into an acoustic feature sequence.

在一种应用场景中,上述实施例中的语音合成模型可以用于执行以下步骤:In one application scenario, the speech synthesis model in the above embodiment can be used to perform the following steps:

步骤A,根据音素序列确定待合成文本对应的文本特征序列,文本特征序列包括音素序列中每个音素对应的文本特征。Step A: determining a text feature sequence corresponding to the text to be synthesized according to the phoneme sequence, wherein the text feature sequence includes a text feature corresponding to each phoneme in the phoneme sequence.

步骤B,根据文本特征序列与声学特征序列,生成目标音频。Step B: Generate target audio based on the text feature sequence and the acoustic feature sequence.

在一种应用场景中,指定声学特征包括:基频、音量、语速中的至少一种。In one application scenario, the specified acoustic feature includes at least one of fundamental frequency, volume, and speech rate.

在另一种应用场景中,语音合成模型是通过如下方式训练获得的:In another application scenario, the speech synthesis model is trained in the following way:

步骤C,提取训练文本对应的训练音频的真实声学特征,真实声学特征用于指示训练音频的韵律特征。Step C, extracting the real acoustic features of the training audio corresponding to the training text, where the real acoustic features are used to indicate the prosodic features of the training audio.

步骤D,将真实声学特征按照训练文本对应的训练音素序列进行扩展,得到训练声学特征序列。Step D: Expand the real acoustic features according to the training phoneme sequence corresponding to the training text to obtain a training acoustic feature sequence.

步骤E,将训练音素序列和训练声学特征序列输入语音合成模型,并根据语音合成模型的输出与训练音频,训练语音合成模型。Step E: input the training phoneme sequence and the training acoustic feature sequence into the speech synthesis model, and train the speech synthesis model according to the output of the speech synthesis model and the training audio.

具体的,真实声学特征包括:基频、音量、语速中的至少一种,步骤C的实现方式可以包括:Specifically, the real acoustic feature includes: at least one of fundamental frequency, volume, and speech rate. The implementation of step C may include:

步骤C1,若真实声学特征中包括语速,根据训练音频和训练音素序列,确定训练音素序列中,每个训练音素对应的时长,以确定训练音频的语速。Step C1: if the real acoustic feature includes speech speed, determine the duration corresponding to each training phoneme in the training phoneme sequence according to the training audio and the training phoneme sequence to determine the speech speed of the training audio.

具体的实现方式可以包括:首先,根据训练音频和训练音素序列,确定每个训练音素对应的时长。之后,对每个训练音素对应的时长进行对数运算,以得到每个训练音素对应的对数时长。最后,将训练音素序列中每个训练音素对应的对数时长的统计值,作为训练音频的语速。The specific implementation method may include: first, determining the duration corresponding to each training phoneme according to the training audio and the training phoneme sequence. Then, performing a logarithmic operation on the duration corresponding to each training phoneme to obtain the logarithmic duration corresponding to each training phoneme. Finally, taking the statistical value of the logarithmic duration corresponding to each training phoneme in the training phoneme sequence as the speech speed of the training audio.

步骤C2,若真实声学特征中包括基频,提取训练音频包括的每个音频帧的基频,以确定训练音频的基频。Step C2: if the real acoustic feature includes the fundamental frequency, extract the fundamental frequency of each audio frame included in the training audio to determine the fundamental frequency of the training audio.

具体实现方式可以包括:首先,对每个音频帧对应的基频进行对数运算,以得到每个音频帧对应的对数基频。然后,将训练音频中每个音频帧对应的对数基频的统计值,作为训练音频的基频。The specific implementation method may include: first, performing a logarithmic operation on the fundamental frequency corresponding to each audio frame to obtain the logarithmic fundamental frequency corresponding to each audio frame, and then using the statistical value of the logarithmic fundamental frequency corresponding to each audio frame in the training audio as the fundamental frequency of the training audio.

步骤C3,若真实声学特征中包括音量,提取训练音频包括的每个音频帧的音量,以确定训练音频的音量。Step C3: if the real acoustic feature includes volume, extract the volume of each audio frame included in the training audio to determine the volume of the training audio.

具体实现方式可以包括:首先,对每个音频帧对应的音量进行对数运算,以得到每个音频帧对应的对数音量。然后,将训练音频中每个音频帧对应的对数音量的统计值,作为训练音频的音量。The specific implementation method may include: first, performing a logarithmic operation on the volume corresponding to each audio frame to obtain the logarithmic volume corresponding to each audio frame, and then using the statistical value of the logarithmic volume corresponding to each audio frame in the training audio as the volume of the training audio.

在又一种应用场景中,语音合成模型还可以是通过如下方式训练获得的:In another application scenario, the speech synthesis model can also be trained in the following way:

步骤F,根据预设的训练集中包括多个训练音频的真实声学特征,确定训练集的统计声学特征。Step F: determining the statistical acoustic features of the training set according to the real acoustic features of a plurality of training audios included in the preset training set.

步骤G,根据统计声学特征对每个训练音频的真实声学特征进行归一化处理。Step G, normalizing the true acoustic features of each training audio according to the statistical acoustic features.

相应的,步骤D的实现方式可以为:Accordingly, step D may be implemented as follows:

将归一化处理后的真实声学特征,按照训练音素序列进行扩展,得到训练声学特征序列。The normalized real acoustic features are expanded according to the training phoneme sequence to obtain a training acoustic feature sequence.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

综上所述,本公开首先获取待合成文本,和用于指示音频的韵律特征的指定声学特征,之后从待合成文本中,提取出对应的音素序列,再按照音素序列,将指定声学特征进行扩展,得到声学特征序列,最后将音素序列和声学特征序列输入预先训练的语音合成模型,从而得到语音合成模型输出的待合成文本对应的,与指定声学特征匹配的目标音频。本公开通过指定声学特征来控制文本的语音合成,使得语音合成模型输出的目标音频能够与指定声学特征对应,能够实现语音合成过程中声学特征的显性控制,提高了目标音频的表现力。In summary, the present disclosure first obtains the text to be synthesized and the specified acoustic features for indicating the rhythmic features of the audio, then extracts the corresponding phoneme sequence from the text to be synthesized, and then expands the specified acoustic features according to the phoneme sequence to obtain the acoustic feature sequence, and finally inputs the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model, thereby obtaining the target audio that matches the specified acoustic features and corresponds to the text to be synthesized output by the speech synthesis model. The present disclosure controls the speech synthesis of text by specifying acoustic features, so that the target audio output by the speech synthesis model can correspond to the specified acoustic features, and can realize the explicit control of the acoustic features in the speech synthesis process, thereby improving the expressiveness of the target audio.

下面参考图10,其示出了适于用来实现本公开实施例的电子设备(即上述语音合成方法的执行主体)300的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图10示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Referring to FIG. 10 below, it shows a schematic diagram of the structure of an electronic device (i.e., the execution subject of the above-mentioned speech synthesis method) 300 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG. 10 is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present disclosure.

如图10所示,电子设备300可以包括处理装置(例如中央处理器、图形处理器等)301,其可以根据存储在只读存储器(ROM)302中的程序或者从存储装置308加载到随机访问存储器(RAM)303中的程序而执行各种适当的动作和处理。在RAM 303中,还存储有电子设备300操作所需的各种程序和数据。处理装置301、ROM 302以及RAM 303通过总线304彼此相连。输入/输出(I/O)接口305也连接至总线304。As shown in FIG10 , the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to the bus 304.

通常,以下装置可以连接至I/O接口305:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置306;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置307;包括例如磁带、硬盘等的存储装置308;以及通信装置309。通信装置309可以允许电子设备300与其他设备进行无线或有线通信以交换数据。虽然图10示出了具有各种装置的电子设备300,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Typically, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 309. The communication device 309 may allow the electronic device 300 to communicate wirelessly or wired with other devices to exchange data. Although FIG. 10 shows an electronic device 300 with various devices, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.

特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置309从网络上被下载和安装,或者从存储装置308被安装,或者从ROM 302被安装。在该计算机程序被处理装置301执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

在一些实施方式中,终端设备、服务器可以利用诸如HTTP(HyperText TransferProtocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the terminal devices and servers may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取待合成文本和指定声学特征,所述指定声学特征用于指示音频的韵律特征;提取所述待合成文本对应的音素序列;将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;将所述音素序列和所述声学特征序列输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的目标音频,所述目标音频的声学特征与所述指定声学特征匹配。The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains the text to be synthesized and the specified acoustic features, wherein the specified acoustic features are used to indicate the rhythmic features of the audio; extracts the phoneme sequence corresponding to the text to be synthesized; expands the specified acoustic features according to the phoneme sequence to obtain an acoustic feature sequence; inputs the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model to obtain the target audio corresponding to the text to be synthesized output by the speech synthesis model, and the acoustic features of the target audio match the specified acoustic features.

可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定,例如,获取模块还可以被描述为“获取待合成文本和指定声学特征的模块”。The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, an acquisition module may also be described as a "module for acquiring text to be synthesized and specifying acoustic features".

本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

根据本公开的一个或多个实施例,示例1提供了一种语音合成方法,包括:获取待合成文本和指定声学特征,所述指定声学特征用于指示音频的韵律特征;提取所述待合成文本对应的音素序列;将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;将所述音素序列和所述声学特征序列输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的目标音频,所述目标音频的声学特征与所述指定声学特征匹配。According to one or more embodiments of the present disclosure, Example 1 provides a speech synthesis method, including: obtaining a text to be synthesized and a specified acoustic feature, wherein the specified acoustic feature is used to indicate the rhythmic feature of the audio; extracting a phoneme sequence corresponding to the text to be synthesized; expanding the specified acoustic feature according to the phoneme sequence to obtain an acoustic feature sequence; inputting the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model to obtain a target audio corresponding to the text to be synthesized output by the speech synthesis model, wherein the acoustic feature of the target audio matches the specified acoustic feature.

根据本公开的一个或多个实施例,示例2提供了示例1的方法,所述将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列,包括:根据所述指定声学特征,确定所述音素序列中每个音素对应的声学特征;将每个所述音素对应的所述声学特征组成所述声学特征序列。According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, which expands the specified acoustic features according to the phoneme sequence to obtain an acoustic feature sequence, including: determining the acoustic features corresponding to each phoneme in the phoneme sequence according to the specified acoustic features; and composing the acoustic features corresponding to each phoneme into the acoustic feature sequence.

根据本公开的一个或多个实施例,示例3提供了示例1的方法,所述语音合成模型用于:根据所述音素序列确定所述待合成文本对应的文本特征序列,所述文本特征序列包括所述音素序列中每个音素对应的文本特征;根据所述文本特征序列与所述声学特征序列,生成所述目标音频。According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, wherein the speech synthesis model is used to: determine a text feature sequence corresponding to the text to be synthesized based on the phoneme sequence, wherein the text feature sequence includes text features corresponding to each phoneme in the phoneme sequence; and generate the target audio based on the text feature sequence and the acoustic feature sequence.

根据本公开的一个或多个实施例,示例4提供了示例1至示例3的方法,所述指定声学特征包括:基频、音量、语速中的至少一种。According to one or more embodiments of the present disclosure, Example 4 provides the method of Examples 1 to 3, wherein the specified acoustic feature includes at least one of fundamental frequency, volume, and speech rate.

根据本公开的一个或多个实施例,示例5提供了示例1的方法,所述语音合成模型是通过如下方式训练获得的:提取训练文本对应的训练音频的真实声学特征,所述真实声学特征用于指示所述训练音频的韵律特征;将所述真实声学特征按照所述训练文本对应的训练音素序列进行扩展,得到训练声学特征序列;将所述训练音素序列和所述训练声学特征序列输入所述语音合成模型,并根据所述语音合成模型的输出与所述训练音频,训练所述语音合成模型。According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 1, wherein the speech synthesis model is obtained by training in the following manner: extracting real acoustic features of training audio corresponding to a training text, wherein the real acoustic features are used to indicate the rhythmic features of the training audio; expanding the real acoustic features according to a training phoneme sequence corresponding to the training text to obtain a training acoustic feature sequence; inputting the training phoneme sequence and the training acoustic feature sequence into the speech synthesis model, and training the speech synthesis model based on the output of the speech synthesis model and the training audio.

根据本公开的一个或多个实施例,示例6提供了示例5的方法,所述真实声学特征包括:基频、音量、语速中的至少一种;所述提取训练文本对应的训练音频的真实声学特征,包括:若所述真实声学特征中包括语速,根据所述训练音频和所述训练音素序列,确定所述训练音素序列中,每个训练音素对应的时长,以确定所述训练音频的语速;若所述真实声学特征中包括基频,提取所述训练音频包括的每个音频帧的基频,以确定所述训练音频的基频;若所述真实声学特征中包括音量,提取所述训练音频包括的每个音频帧的音量,以确定所述训练音频的音量。According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein the real acoustic features include: at least one of fundamental frequency, volume, and speaking rate; the extracting the real acoustic features of the training audio corresponding to the training text includes: if the real acoustic features include speaking rate, determining the duration corresponding to each training phoneme in the training phoneme sequence according to the training audio and the training phoneme sequence to determine the speaking rate of the training audio; if the real acoustic features include fundamental frequency, extracting the fundamental frequency of each audio frame included in the training audio to determine the fundamental frequency of the training audio; if the real acoustic features include volume, extracting the volume of each audio frame included in the training audio to determine the volume of the training audio.

根据本公开的一个或多个实施例,示例7提供了示例6的方法,所述根据所述训练音频和所述训练音素序列,确定所述训练音素序列中,每个训练音素对应的时长,以确定所述训练音频的语速,包括:根据所述训练音频和所述训练音素序列,确定每个所述训练音素对应的时长;对每个所述训练音素对应的时长进行对数运算,以得到每个所述训练音素对应的对数时长;将所述训练音素序列中每个所述训练音素对应的对数时长的统计值,作为所述训练音频的语速;所述提取所述训练音频包括的每个音频帧的基频,以确定所述训练音频的基频,包括:对每个所述音频帧对应的基频进行对数运算,以得到每个所述音频帧对应的对数基频;将所述训练音频中每个所述音频帧对应的对数基频的统计值,作为所述训练音频的基频;所述提取所述训练音频包括的每个音频帧的音量,以确定所述训练音频的音量,包括:对每个所述音频帧对应的音量进行对数运算,以得到每个所述音频帧对应的对数音量;将所述训练音频中每个所述音频帧对应的对数音量的统计值,作为所述训练音频的音量。According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 6, wherein the method of determining the duration corresponding to each training phoneme in the training phoneme sequence according to the training audio and the training phoneme sequence to determine the speaking speed of the training audio comprises: determining the duration corresponding to each training phoneme according to the training audio and the training phoneme sequence; performing a logarithmic operation on the duration corresponding to each training phoneme to obtain the logarithmic duration corresponding to each training phoneme; using the statistical value of the logarithmic duration corresponding to each training phoneme in the training phoneme sequence as the speaking speed of the training audio; extracting the training audio comprises The method comprises: performing a logarithmic operation on the fundamental frequency corresponding to each of the audio frames to obtain the logarithmic fundamental frequency corresponding to each of the audio frames; using the statistical value of the logarithmic fundamental frequency corresponding to each of the audio frames in the training audio as the fundamental frequency of the training audio; extracting the volume of each audio frame included in the training audio to determine the volume of the training audio comprises: performing a logarithmic operation on the volume corresponding to each of the audio frames to obtain the logarithmic volume corresponding to each of the audio frames; using the statistical value of the logarithmic volume corresponding to each of the audio frames in the training audio as the volume of the training audio.

根据本公开的一个或多个实施例,示例8提供了示例5至示例7的方法,所述语音合成模型还通过如下方式训练获得的:根据预设的训练集中包括多个所述训练音频的所述真实声学特征,确定所述训练集的统计声学特征;根据所述统计声学特征对每个所述训练音频的所述真实声学特征进行归一化处理;所述将所述真实声学特征按照所述训练文本对应的训练音素序列进行扩展,得到训练声学特征序列,包括:将归一化处理后的所述真实声学特征,按照所述训练音素序列进行扩展,得到所述训练声学特征序列。According to one or more embodiments of the present disclosure, Example 8 provides the methods of Examples 5 to 7, and the speech synthesis model is also trained in the following manner: according to the real acoustic features of multiple training audios included in a preset training set, the statistical acoustic features of the training set are determined; according to the statistical acoustic features, the real acoustic features of each training audio are normalized; and the real acoustic features are expanded according to the training phoneme sequence corresponding to the training text to obtain the training acoustic feature sequence, including: the normalized real acoustic features are expanded according to the training phoneme sequence to obtain the training acoustic feature sequence.

根据本公开的一个或多个实施例,示例9提供了一种语音合成装置,包括:获取模块,用于获取待合成文本和指定声学特征,所述指定声学特征用于指示音频的韵律特征;提取模块,用于提取所述待合成文本对应的音素序列;扩展模块,用于将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;合成模块,用于将所述音素序列和所述声学特征序列输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的目标音频,所述目标音频的声学特征与所述指定声学特征匹配。According to one or more embodiments of the present disclosure, Example 9 provides a speech synthesis device, including: an acquisition module, used to acquire a text to be synthesized and a specified acoustic feature, wherein the specified acoustic feature is used to indicate the rhythmic feature of the audio; an extraction module, used to extract a phoneme sequence corresponding to the text to be synthesized; an expansion module, used to expand the specified acoustic feature according to the phoneme sequence to obtain an acoustic feature sequence; and a synthesis module, used to input the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model to obtain a target audio corresponding to the text to be synthesized output by the speech synthesis model, wherein the acoustic feature of the target audio matches the specified acoustic feature.

根据本公开的一个或多个实施例,示例10提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现示例1至示例8中所述方法的步骤。According to one or more embodiments of the present disclosure, Example 10 provides a computer-readable medium having a computer program stored thereon, which implements the steps of the methods described in Examples 1 to 8 when executed by a processing device.

根据本公开的一个或多个实施例,示例11提供了一种电子设备,包括:存储装置,其上存储有计算机程序;处理装置,用于执行所述存储装置中的所述计算机程序,以实现示例1至示例8中所述方法的步骤。According to one or more embodiments of the present disclosure, Example 11 provides an electronic device, comprising: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of the method described in Examples 1 to 8.

以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Although the subject matter has been described in language specific to structural features and/or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims (9)

1.一种语音合成方法,其特征在于,所述方法包括:1. A speech synthesis method, characterized in that the method comprises: 获取待合成文本和指定声学特征,所述指定声学特征用于指示音频的韵律特征;Acquire a text to be synthesized and a specified acoustic feature, where the specified acoustic feature is used to indicate a prosodic feature of the audio; 提取所述待合成文本对应的音素序列;Extracting a phoneme sequence corresponding to the text to be synthesized; 将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;Expanding the specified acoustic feature according to the phoneme sequence to obtain an acoustic feature sequence; 将所述音素序列和所述声学特征序列输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的目标音频,所述目标音频的声学特征与所述指定声学特征匹配;Inputting the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model to obtain a target audio corresponding to the text to be synthesized output by the speech synthesis model, wherein the acoustic feature of the target audio matches the specified acoustic feature; 所述语音合成模型是通过如下方式训练获得的:The speech synthesis model is obtained by training in the following way: 提取训练文本对应的训练音频的真实声学特征,所述真实声学特征用于指示所述训练音频的韵律特征;Extracting real acoustic features of the training audio corresponding to the training text, wherein the real acoustic features are used to indicate the prosodic features of the training audio; 将所述真实声学特征按照所述训练文本对应的训练音素序列进行扩展,得到训练声学特征序列;Expanding the real acoustic features according to the training phoneme sequence corresponding to the training text to obtain a training acoustic feature sequence; 将所述训练音素序列和所述训练声学特征序列输入所述语音合成模型,并根据所述语音合成模型的输出与所述训练音频,训练所述语音合成模型;Inputting the training phoneme sequence and the training acoustic feature sequence into the speech synthesis model, and training the speech synthesis model according to the output of the speech synthesis model and the training audio; 所述语音合成模型还通过如下方式训练获得的:The speech synthesis model is also trained in the following way: 根据预设的训练集中包括多个所述训练音频的所述真实声学特征,确定所述训练集的统计声学特征;Determine the statistical acoustic features of the training set according to the real acoustic features of the plurality of training audios in the preset training set; 根据所述统计声学特征对每个所述训练音频的所述真实声学特征进行归一化处理;Normalizing the real acoustic features of each of the training audios according to the statistical acoustic features; 所述将所述真实声学特征按照所述训练文本对应的训练音素序列进行扩展,得到训练声学特征序列,包括:The step of expanding the real acoustic features according to the training phoneme sequence corresponding to the training text to obtain a training acoustic feature sequence includes: 将归一化处理后的所述真实声学特征,按照所述训练音素序列进行扩展,得到所述训练声学特征序列。The normalized real acoustic features are expanded according to the training phoneme sequence to obtain the training acoustic feature sequence. 2.根据权利要求1所述的方法,其特征在于,所述将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列,包括:2. The method according to claim 1, characterized in that the step of expanding the specified acoustic feature according to the phoneme sequence to obtain the acoustic feature sequence comprises: 根据所述指定声学特征,确定所述音素序列中每个音素对应的声学特征;Determining, according to the specified acoustic feature, an acoustic feature corresponding to each phoneme in the phoneme sequence; 将每个所述音素对应的所述声学特征组成所述声学特征序列。The acoustic features corresponding to each of the phonemes are combined into the acoustic feature sequence. 3.根据权利要求1所述的方法,其特征在于,所述语音合成模型用于:3. The method according to claim 1, wherein the speech synthesis model is used for: 根据所述音素序列确定所述待合成文本对应的文本特征序列,所述文本特征序列包括所述音素序列中每个音素对应的文本特征;Determine a text feature sequence corresponding to the to-be-synthesized text according to the phoneme sequence, wherein the text feature sequence includes a text feature corresponding to each phoneme in the phoneme sequence; 根据所述文本特征序列与所述声学特征序列,生成所述目标音频。The target audio is generated according to the text feature sequence and the acoustic feature sequence. 4.根据权利要求1-3中任一项所述的方法,其特征在于,所述指定声学特征包括:基频、音量、语速中的至少一种。4. The method according to any one of claims 1-3 is characterized in that the specified acoustic features include: at least one of fundamental frequency, volume, and speaking rate. 5.根据权利要求1所述的方法,其特征在于,所述真实声学特征包括:基频、音量、语速中的至少一种;所述提取训练文本对应的训练音频的真实声学特征,包括:5. The method according to claim 1, characterized in that the real acoustic features include: at least one of fundamental frequency, volume, and speech rate; the real acoustic features of the training audio corresponding to the training text are extracted, comprising: 若所述真实声学特征中包括语速,根据所述训练音频和所述训练音素序列,确定所述训练音素序列中,每个训练音素对应的时长,以确定所述训练音频的语速;If the real acoustic feature includes speech speed, determining the duration corresponding to each training phoneme in the training phoneme sequence according to the training audio and the training phoneme sequence, so as to determine the speech speed of the training audio; 若所述真实声学特征中包括基频,提取所述训练音频包括的每个音频帧的基频,以确定所述训练音频的基频;If the real acoustic feature includes a fundamental frequency, extracting the fundamental frequency of each audio frame included in the training audio to determine the fundamental frequency of the training audio; 若所述真实声学特征中包括音量,提取所述训练音频包括的每个音频帧的音量,以确定所述训练音频的音量。If the real acoustic feature includes volume, the volume of each audio frame included in the training audio is extracted to determine the volume of the training audio. 6.根据权利要求5所述的方法,其特征在于,所述根据所述训练音频和所述训练音素序列,确定所述训练音素序列中,每个训练音素对应的时长,以确定所述训练音频的语速,包括:6. The method according to claim 5, characterized in that the step of determining, based on the training audio and the training phoneme sequence, the duration corresponding to each training phoneme in the training phoneme sequence to determine the speaking speed of the training audio comprises: 根据所述训练音频和所述训练音素序列,确定每个所述训练音素对应的时长;Determine the duration corresponding to each training phoneme according to the training audio and the training phoneme sequence; 对每个所述训练音素对应的时长进行对数运算,以得到每个所述训练音素对应的对数时长;Performing a logarithmic operation on the duration corresponding to each of the training phonemes to obtain the logarithmic duration corresponding to each of the training phonemes; 将所述训练音素序列中每个所述训练音素对应的对数时长的统计值,作为所述训练音频的语速;Taking the statistical value of the logarithmic duration corresponding to each training phoneme in the training phoneme sequence as the speaking speed of the training audio; 所述提取所述训练音频包括的每个音频帧的基频,以确定所述训练音频的基频,包括:The extracting the fundamental frequency of each audio frame included in the training audio to determine the fundamental frequency of the training audio comprises: 对每个所述音频帧对应的基频进行对数运算,以得到每个所述音频帧对应的对数基频;Performing a logarithmic operation on the fundamental frequency corresponding to each of the audio frames to obtain the logarithmic fundamental frequency corresponding to each of the audio frames; 将所述训练音频中每个所述音频帧对应的对数基频的统计值,作为所述训练音频的基频;Using the statistical value of the logarithmic fundamental frequency corresponding to each of the audio frames in the training audio as the fundamental frequency of the training audio; 所述提取所述训练音频包括的每个音频帧的音量,以确定所述训练音频的音量,包括:The extracting the volume of each audio frame included in the training audio to determine the volume of the training audio includes: 对每个所述音频帧对应的音量进行对数运算,以得到每个所述音频帧对应的对数音量;Performing a logarithmic operation on the volume corresponding to each of the audio frames to obtain a logarithmic volume corresponding to each of the audio frames; 将所述训练音频中每个所述音频帧对应的对数音量的统计值,作为所述训练音频的音量。The statistical value of the logarithmic volume corresponding to each of the audio frames in the training audio is used as the volume of the training audio. 7.一种语音合成装置,其特征在于,所述装置包括:7. A speech synthesis device, characterized in that the device comprises: 获取模块,用于获取待合成文本和指定声学特征,所述指定声学特征用于指示音频的韵律特征;An acquisition module, used for acquiring the text to be synthesized and a specified acoustic feature, wherein the specified acoustic feature is used for indicating the prosodic feature of the audio; 提取模块,用于提取所述待合成文本对应的音素序列;An extraction module, used for extracting a phoneme sequence corresponding to the text to be synthesized; 扩展模块,用于将所述指定声学特征按照所述音素序列进行扩展,得到声学特征序列;An expansion module, used for expanding the specified acoustic feature according to the phoneme sequence to obtain an acoustic feature sequence; 合成模块,用于将所述音素序列和所述声学特征序列输入预先训练的语音合成模型,以得到所述语音合成模型输出的,所述待合成文本对应的目标音频,所述目标音频的声学特征与所述指定声学特征匹配;A synthesis module, used for inputting the phoneme sequence and the acoustic feature sequence into a pre-trained speech synthesis model to obtain a target audio corresponding to the text to be synthesized output by the speech synthesis model, wherein the acoustic feature of the target audio matches the specified acoustic feature; 所述语音合成模型是通过如下方式训练获得的:The speech synthesis model is obtained by training in the following way: 提取训练文本对应的训练音频的真实声学特征,所述真实声学特征用于指示所述训练音频的韵律特征;Extracting real acoustic features of the training audio corresponding to the training text, wherein the real acoustic features are used to indicate the prosodic features of the training audio; 将所述真实声学特征按照所述训练文本对应的训练音素序列进行扩展,得到训练声学特征序列;Expanding the real acoustic features according to the training phoneme sequence corresponding to the training text to obtain a training acoustic feature sequence; 将所述训练音素序列和所述训练声学特征序列输入所述语音合成模型,并根据所述语音合成模型的输出与所述训练音频,训练所述语音合成模型;Inputting the training phoneme sequence and the training acoustic feature sequence into the speech synthesis model, and training the speech synthesis model according to the output of the speech synthesis model and the training audio; 所述语音合成模型还通过如下方式训练获得的:The speech synthesis model is also trained in the following way: 根据预设的训练集中包括多个所述训练音频的所述真实声学特征,确定所述训练集的统计声学特征;Determine the statistical acoustic features of the training set according to the real acoustic features of the plurality of training audios in the preset training set; 根据所述统计声学特征对每个所述训练音频的所述真实声学特征进行归一化处理;Normalizing the real acoustic features of each of the training audios according to the statistical acoustic features; 所述将所述真实声学特征按照所述训练文本对应的训练音素序列进行扩展,得到训练声学特征序列,包括:The step of expanding the real acoustic features according to the training phoneme sequence corresponding to the training text to obtain a training acoustic feature sequence includes: 将归一化处理后的所述真实声学特征,按照所述训练音素序列进行扩展,得到所述训练声学特征序列。The normalized real acoustic features are expanded according to the training phoneme sequence to obtain the training acoustic feature sequence. 8.一种计算机可读介质,其上存储有计算机程序,其特征在于,该程序被处理装置执行时实现权利要求1-6中任一项所述方法的步骤。8. A computer-readable medium having a computer program stored thereon, characterized in that when the program is executed by a processing device, the steps of the method according to any one of claims 1 to 6 are implemented. 9.一种电子设备,其特征在于,包括:9. An electronic device, comprising: 存储装置,其上存储有计算机程序;a storage device having a computer program stored thereon; 处理装置,用于执行所述存储装置中的所述计算机程序,以实现权利要求1-6中任一项所述方法的步骤。A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 6.
CN202110075977.XA 2021-01-20 2021-01-20 Speech synthesis method and device, readable medium and electronic equipment Active CN112786008B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110075977.XA CN112786008B (en) 2021-01-20 2021-01-20 Speech synthesis method and device, readable medium and electronic equipment
PCT/CN2021/139987 WO2022156464A1 (en) 2021-01-20 2021-12-21 Speech synthesis method and apparatus, readable medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110075977.XA CN112786008B (en) 2021-01-20 2021-01-20 Speech synthesis method and device, readable medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN112786008A CN112786008A (en) 2021-05-11
CN112786008B true CN112786008B (en) 2024-04-12

Family

ID=75757402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110075977.XA Active CN112786008B (en) 2021-01-20 2021-01-20 Speech synthesis method and device, readable medium and electronic equipment

Country Status (2)

Country Link
CN (1) CN112786008B (en)
WO (1) WO2022156464A1 (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112786008B (en) * 2021-01-20 2024-04-12 北京有竹居网络技术有限公司 Speech synthesis method and device, readable medium and electronic equipment
CN113345417B (en) * 2021-05-31 2024-03-01 平安科技(深圳)有限公司 Speech synthesis method, device, equipment and storage medium
CN113096638B (en) * 2021-06-09 2021-09-07 北京世纪好未来教育科技有限公司 Speech synthesis model training method, speech synthesis method and device
CN113903326A (en) * 2021-09-27 2022-01-07 平安科技(深圳)有限公司 Speech synthesis method, apparatus, device and storage medium
CN113870838A (en) * 2021-09-27 2021-12-31 平安科技(深圳)有限公司 Voice synthesis method, device, equipment and medium
CN115985282A (en) * 2021-10-14 2023-04-18 北京字跳网络技术有限公司 Speech rate adjustment method, device, electronic device and readable storage medium
CN113724684B (en) * 2021-10-19 2024-06-14 南京航空航天大学 A speech synthesis method and system for air traffic control instructions
CN114495899B (en) * 2021-12-29 2025-03-18 深圳市优必选科技股份有限公司 A method, device and terminal device for audio synthesis based on duration information
CN114255738A (en) * 2021-12-30 2022-03-29 北京有竹居网络技术有限公司 Speech synthesis method, device, medium and electronic equipment
CN114566143B (en) * 2022-03-31 2022-10-11 北京帝派智能科技有限公司 Voice synthesis method and voice synthesis system capable of locally modifying content
CN114937446A (en) * 2022-04-21 2022-08-23 北京三快在线科技有限公司 Voice synthesis method, device, equipment and storage medium
CN116312462A (en) * 2023-03-13 2023-06-23 腾讯音乐娱乐科技(深圳)有限公司 Speech synthesis method, predictive network training method, server, and storage medium
CN120048245A (en) * 2023-11-27 2025-05-27 腾讯科技(深圳)有限公司 Speech synthesis method, apparatus, device, storage medium, and program product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102385858A (en) * 2010-08-31 2012-03-21 国际商业机器公司 Emotional voice synthesis method and system
US10186252B1 (en) * 2015-08-13 2019-01-22 Oben, Inc. Text to speech synthesis using deep neural network with constant unit length spectrogram
CN111199724A (en) * 2019-12-31 2020-05-26 出门问问信息科技有限公司 Information processing method and device and computer readable storage medium
CN111583904A (en) * 2020-05-13 2020-08-25 北京字节跳动网络技术有限公司 Speech synthesis method, speech synthesis device, storage medium and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6810378B2 (en) * 2001-08-22 2004-10-26 Lucent Technologies Inc. Method and apparatus for controlling a speech synthesis system to provide multiple styles of speech
US8886538B2 (en) * 2003-09-26 2014-11-11 Nuance Communications, Inc. Systems and methods for text-to-speech synthesis using spoken example
US9728185B2 (en) * 2014-05-22 2017-08-08 Google Inc. Recognizing speech using neural networks
CN110992927B (en) * 2019-12-11 2024-02-20 广州酷狗计算机科技有限公司 Audio generation method, device, computer readable storage medium and computing equipment
CN112786008B (en) * 2021-01-20 2024-04-12 北京有竹居网络技术有限公司 Speech synthesis method and device, readable medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102385858A (en) * 2010-08-31 2012-03-21 国际商业机器公司 Emotional voice synthesis method and system
US10186252B1 (en) * 2015-08-13 2019-01-22 Oben, Inc. Text to speech synthesis using deep neural network with constant unit length spectrogram
CN111199724A (en) * 2019-12-31 2020-05-26 出门问问信息科技有限公司 Information processing method and device and computer readable storage medium
CN111583904A (en) * 2020-05-13 2020-08-25 北京字节跳动网络技术有限公司 Speech synthesis method, speech synthesis device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN112786008A (en) 2021-05-11
WO2022156464A1 (en) 2022-07-28

Similar Documents

Publication Publication Date Title
CN112786008B (en) Speech synthesis method and device, readable medium and electronic equipment
CN112786007B (en) Speech synthesis method and device, readable medium and electronic equipment
CN112786011B (en) Speech synthesis method, synthesis model training method, device, medium and equipment
CN112786006B (en) Speech synthesis method, synthesis model training method, device, medium and equipment
CN112927674B (en) Speech style transfer method, device, readable medium and electronic device
CN112489620B (en) Speech synthesis method, apparatus, readable medium and electronic device
CN112489621B (en) Speech synthesis method, device, readable medium and electronic equipment
CN112309366B (en) Speech synthesis method, speech synthesis device, storage medium and electronic equipment
CN108630190B (en) Method and apparatus for generating a speech synthesis model
US11450313B2 (en) Determining phonetic relationships
CN112331176B (en) Speech synthesis method, speech synthesis device, storage medium and electronic equipment
CN112786013B (en) Libretto or script of a ballad-singer-based speech synthesis method and device, readable medium and electronic equipment
CN112259089A (en) Voice recognition method and device
CN111354343B (en) Voice wake-up model generation method and device and electronic equipment
CN113450756B (en) A training method for a speech synthesis model and a speech synthesis method
CN111489735B (en) Voice recognition model training method and device
CN114255740A (en) Speech recognition method, apparatus, computer equipment and storage medium
CN114512121A (en) Speech synthesis method, model training method and device
CN113689867B (en) A training method, device, electronic device and medium for a speech conversion model
CN114220436A (en) Speech processing method, apparatus, computer equipment and storage medium
CN114999442A (en) A meta-learning-based adaptive text-to-speech method and related devices
de Abreu Pinna et al. A brazilian portuguese real-time voice recognition to deal with sensitive data
WO2022168173A1 (en) Speaker embedding device, speaker embedding method, and speaker embedding program
CN119360818A (en) Speech generation method, device, computer equipment and medium based on artificial intelligence
CN119516997A (en) Speech synthesis method, device, computer equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant