WO2022126904A1 - 语音转换方法、装置、计算机设备及存储介质 - Google Patents

语音转换方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2022126904A1
WO2022126904A1 PCT/CN2021/083136 CN2021083136W WO2022126904A1 WO 2022126904 A1 WO2022126904 A1 WO 2022126904A1 CN 2021083136 W CN2021083136 W CN 2021083136W WO 2022126904 A1 WO2022126904 A1 WO 2022126904A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio
source
sample
conversion model
model
Prior art date
Application number
PCT/CN2021/083136
Other languages
English (en)
French (fr)
Inventor
孙奥兰
王健宗
程宁
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022126904A1 publication Critical patent/WO2022126904A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L21/00Speech or voice signal processing techniques to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
    • G10L21/003Changing voice quality, e.g. pitch or formants
    • G10L21/007Changing voice quality, e.g. pitch or formants characterised by the process used
    • G10L21/013Adapting to target pitch
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L19/02Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis using spectral analysis, e.g. transform vocoders or subband vocoders
    • 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
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L21/00Speech or voice signal processing techniques to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
    • G10L21/003Changing voice quality, e.g. pitch or formants
    • G10L21/007Changing voice quality, e.g. pitch or formants characterised by the process used
    • G10L21/013Adapting to target pitch
    • G10L2021/0135Voice conversion or morphing

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular, to a voice conversion method, apparatus, computer equipment and storage medium.
  • the purpose of the embodiments of the present application is to provide a voice conversion method, device, computer equipment and storage medium, so as to solve the problem that the voice conversion feature is single and cannot meet the diverse needs of users.
  • the embodiment of the present application provides a voice conversion method, which adopts the following technical solutions:
  • the embodiment of the present application also provides a voice conversion device, which adopts the following technical solutions:
  • the receiving module is used to receive the source audio
  • a source conversion module for converting the preset Mel filter of the source audio input into a source Mel spectrum
  • a processing module configured to input the source mel spectrum into a dual-trained first speech conversion model to obtain a target mel spectrum output by the first speech conversion model in response to the source mel spectrum;
  • the target conversion module is used to convert the target Mel spectrum into target audio according to the griffin_lim algorithm.
  • the embodiment of the present application also provides a computer device, which adopts the following technical solutions:
  • a computer device includes a memory and a processor, wherein computer-readable instructions are stored in the memory, and the processor also implements the following steps when executing the computer-readable instructions:
  • the embodiments of the present application also provide a computer-readable storage medium, which adopts the following technical solutions:
  • a computer-readable storage medium where computer-readable instructions are stored on the computer-readable storage medium, and when the computer-readable instructions are executed by the processor, the processor is caused to perform the following steps:
  • the embodiments of the present application mainly have the following beneficial effects: receiving source audio; converting the source audio input preset Mel filter into source Mel spectrum; inputting the source Mel spectrum To the dual-trained first speech conversion model, obtain a target mel spectrum output by the first speech conversion model in response to the source mel spectrum; convert the target mel spectrum into target audio according to the griffin_lim algorithm.
  • the first voice conversion model has been trained to learn the timbre and emotional characteristics of the audio, so that the voice conversion can take into account the timbre and mood.
  • the dual training method is used to make the first voice conversion model converge quickly and ensure the consistency of the voice content before and after conversion. .
  • FIG. 1 is an exemplary system architecture diagram to which the present application can be applied;
  • Fig. 2 is according to the flow chart of one embodiment of the speech conversion method of the present application.
  • FIG. 4 is a schematic structural diagram of an embodiment of a speech conversion device according to the present application.
  • FIG. 5 is a schematic structural diagram of an embodiment of a computer device according to the present application.
  • the system architecture 100 may include terminal devices 101 , 102 , and 103 , a network 104 and a server 105 .
  • the network 104 is a medium used to provide a communication link between the terminal devices 101 , 102 , 103 and the server 105 .
  • the network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
  • the user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages and the like.
  • Various communication client applications may be installed on the terminal devices 101 , 102 and 103 , such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, and the like.
  • the terminal devices 101, 102, and 103 can be various electronic devices that have a display screen and support web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, dynamic Picture Experts Compression Standard Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) Players, Laptops and Desktops, etc.
  • MP3 players Moving Picture Experts Group Audio Layer III, dynamic Picture Experts Compression Standard Audio Layer 3
  • MP4 Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4
  • the server 105 may be a server that provides various services, such as a background server that provides support for the pages displayed on the terminal devices 101 , 102 , and 103 .
  • the voice conversion method provided in the embodiments of the present application is generally performed by a server/terminal device , and accordingly, the voice conversion apparatus is generally set in the server/terminal device .
  • terminal devices, networks and servers in FIG. 1 are merely illustrative. There can be any number of terminal devices, networks and servers according to implementation needs.
  • the voice conversion method includes the following steps:
  • Step S201 receiving source audio.
  • the electronic device (such as the server/terminal device shown in FIG. 1 ) on which the voice conversion method runs can receive the source audio through a wired connection or a wireless connection.
  • the above wireless connection methods may include but are not limited to 3G/4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or developed in the future .
  • the source audio is an audio file recorded by a user through a recording device, or an audio file saved on a storage medium.
  • Step S202 converting the source audio input preset mel filter into a source mel spectrum.
  • the mel spectrum is a sound feature extracted from an audio file
  • the mel spectrum of the audio time-domain signal can be extracted by using the melspectrogram() function in the librosa library of python.
  • Step S203 inputting the source mel spectrum into the dual-trained first speech conversion model to obtain a target mel spectrum output by the first speech conversion model in response to the source mel spectrum.
  • the dual models are two models with the same structure and opposite training directions, that is, the source audio is input to the first speech conversion model, and the converted output is used as the input of the second speech conversion model, and the second speech conversion model The expected output is consistent with the input of the first speech conversion model.
  • the first speech conversion model and the second language conversion model of this application are both encoding and decoding Encoder-Decoder structures.
  • the encoder and decoder both use a 6-layer Feed Forward Transformer block, and two fully connected layers are split at the output of the Decoder.
  • the neurons are 80 and 1, respectively, representing a frame of Mel spectrum and stop token, specifically:
  • the input of the Decoder is the output of the Encoder and the starting frame.
  • the starting frame is an 80-dimensional column vector with all -1 dimensions.
  • One frame obtained by decoding each time is used as the input frame of the next Decoder.
  • the output of the first voice conversion model is used as the input of the second voice conversion model, and the output of the second voice conversion model is used as the first voice conversion model.
  • Input a sample can be cycled many times, and fewer samples are needed.
  • the model parameters are adjusted to minimize the error, the model converges faster, and the conversion effect is better.
  • Step S204 converting the target mel spectrum into target audio according to the griffin_lim algorithm.
  • the target audio frequency is generated by the Griffin-lim algorithm from the target Mel spectrum converted by the first speech conversion model to complete the speech conversion process.
  • the process of the Griffin-lim algorithm is: randomly initialize a phase spectrum, use the phase spectrum and the known target Mel spectrum to synthesize a new speech waveform through ISTFT (Inverse Fourier Transform), and use the synthesized speech to do STFT (Short Time Fourier Transform). Lie transform) to obtain a new amplitude spectrum and a new phase spectrum, and then use the known target Mel spectrum and the new phase spectrum to synthesize a new voice through ISTFT (Inverse Fourier Transform), and repeat this many times until The synthesized speech achieves satisfactory results.
  • ISTFT Inverse Fourier Transform
  • STFT Short Time Fourier Transform
  • the present application receives source audio; converts the source audio input preset mel filter into source mel spectrum; inputs the source mel spectrum into the dual-trained first speech conversion model to obtain the first voice conversion model.
  • a speech conversion model responds to the target mel spectrum output by the source mel spectrum; converts the target mel spectrum into target audio according to the griffin_lim algorithm.
  • the first voice conversion model has been trained to learn the timbre and emotional characteristics of the audio, so that the voice conversion can take into account the timbre and mood.
  • the dual training method is used to make the first voice conversion model converge quickly and ensure the consistency of the voice content before and after conversion. .
  • step S203 the above-mentioned electronic device may further perform the following steps:
  • the training sample includes a source audio sample X and a target audio sample Y;
  • the parameters of each node in the first speech conversion model and the second speech conversion model are adjusted until the mean square error of the target sample and the mean square error of the source sample are the smallest, and the first speech conversion model with the dual training completed is obtained.
  • the Encoder in the first speech conversion model receives the source audio sample X as input, and the output of the last layer of FFT block is the encoded image of the encoder. hidden state matrix;
  • the Decoder receives two inputs, one is the hidden state of the source audio sample X encoded by the Encoder, and the other input is the target audio sample Y. After 6 layers of FFT blocks, a fully connected layer is connected, including 80 neurons, to obtain all the The first speech conversion model outputs a predicted audio sample Y' in response to the source audio sample X. Calculate the loss function of the model.
  • MSEloss the mean square error loss function, is used to calculate the mean square error of Y and Y'.
  • the above electronic device may perform the following steps:
  • the predicted audio sample Y' is input into a pre-trained audio style classification model for classification, and the classification result output by the audio style classification model in response to the predicted audio sample Y' is obtained;
  • the style reward R S is calculated from the classification results according to the following formula:
  • P(y') is the classification result
  • is a preset adjustable parameter
  • the content reward R C that the predicted audio sample Y' is restored to X through the second speech conversion model is calculated;
  • the parameters of each node in the first speech conversion model and the second speech conversion model are adjusted until the comprehensive reward is the maximum.
  • the predicted audio sample Y' is input into a pre-trained audio style classification model to obtain a classification result.
  • the pre-trained audio style classification model may be a model pre-trained for timbre classification, a model pre-trained for emotion classification, or a combination of the two.
  • the comprehensive reward is calculated according to the following formula:
  • the composite reward be the harmonic mean of the content reward and the style reward.
  • the pre-trained audio style classification model includes at least a first fully connected layer and a second fully connected layer
  • the predicted audio sample Y' is input to the pre-trained audio style classification model
  • the model is classified, and the step of obtaining the classification result output by the audio style classification model in response to the predicted audio sample Y' includes:
  • the timbre and emotional reward are quantitatively scaled to realize a speech conversion model that incorporates fine-grained features, that is, ⁇ and ⁇ can be adjusted so that the trained first speech conversion model can convert the source audio into For target audio that incorporates timbre and emotional characteristics.
  • the present application may be used in numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, including A distributed computing environment for any of the above systems or devices, and the like.
  • This application may be described in the general context of computer-executable instructions, such as process modules, being executed by a computer.
  • process modules include routines, processes, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types.
  • the application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, process modules may be located in both local and remote computer storage media including storage devices.
  • the aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.
  • the present application provides an embodiment of a voice conversion apparatus.
  • the apparatus embodiment corresponds to the method embodiment shown in FIG. 2 .
  • the apparatus may Used in various electronic devices.
  • the voice conversion apparatus 400 in this embodiment includes: a receiving module 401 , a source conversion module 402 , a processing module 403 , and a target conversion module 404 . in:
  • a receiving module 401 configured to receive source audio
  • a source conversion module 402 configured to convert the preset Mel filter of the source audio input into a source Mel spectrum
  • a processing module 403 configured to input the source mel spectrum into a dual-trained first speech conversion model, and obtain a target mel spectrum output by the first speech conversion model in response to the source mel spectrum;
  • the target conversion module 404 is configured to convert the target Mel spectrum into target audio according to the griffin_lim algorithm.
  • the conversion model responds to the target mel spectrum output by the source mel spectrum; converts the target mel spectrum into target audio according to the griffin_lim algorithm.
  • the first voice conversion model has been trained to learn the timbre and emotional characteristics of the audio, so that the voice conversion can take into account the timbre and mood.
  • the dual training method is used to make the first voice conversion model converge quickly and ensure the consistency of the voice content before and after conversion. .
  • the voice conversion apparatus further includes:
  • the first acquisition sub-module is used to acquire training samples, the training samples include source audio samples X and target audio samples Y;
  • a first conversion submodule configured to input the source audio sample X into the first speech conversion model for audio prediction, and obtain a predicted audio sample Y' output by the first speech conversion model in response to the source audio sample X ;
  • the second conversion sub-module is configured to input the source audio sample X into the first voice conversion model for audio restoration, and obtain the restored audio sample X output by the second voice conversion model in response to the predicted audio sample Y' ', wherein the second speech conversion model is a dual model of the first speech conversion model;
  • the first calculation submodule is used to calculate the mean square error of the target sample based on the target audio sample Y and the predicted audio sample Y', and calculate the mean square error of the source sample based on the source audio sample X and the restored audio sample X';
  • the first adjustment sub-module is used to adjust the parameters of each node in the first speech conversion model and the second speech conversion model until the mean square error of the target sample and the mean square error of the source sample are the smallest, and the No. A speech conversion model.
  • the voice conversion apparatus further includes:
  • the first classification submodule is used to input the predicted audio sample Y ' into a pre-trained audio style classification model for classification, and obtain the classification result that the audio style classification model outputs in response to the predicted audio sample Y ';
  • the second calculation submodule is used to calculate the style reward R S according to the classification result according to the following formula:
  • P(y') is the classification result
  • is a preset adjustable parameter
  • the third calculation submodule is used to calculate the content reward R C that the predicted audio sample Y' is restored to X through the second speech conversion model according to the log-likelihood function;
  • the fourth calculation submodule is used to calculate the comprehensive reward according to the style reward and the content reward;
  • the first adjustment sub-module is used to adjust the parameters of each node in the first speech conversion model and the second speech conversion model until the comprehensive reward is the maximum.
  • the comprehensive reward is calculated according to the following formula:
  • R is the comprehensive reward
  • R S is the style reward
  • RC is the content reward RC .
  • the pre-trained audio style classification model includes at least a first fully connected layer, a second fully connected layer and a feature extraction network
  • the step of inputting the predicted audio sample Y' into a pre-trained audio style classification model for classification, and obtaining a classification result output by the audio style classification model in response to the predicted audio sample Y' includes:
  • FIG. 5 is a block diagram of a basic structure of a computer device according to this embodiment.
  • the computer device 5 includes a memory 51 , a processor 52 , and a network interface 53 that communicate with each other through a system bus. It should be pointed out that only the computer device 5 with components 51-53 is shown in the figure, but it should be understood that it is not required to implement all of the shown components, and more or less components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, special-purpose Integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processor (Digital Signal Processor, DSP), embedded devices, etc.
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • DSP Digital Signal Processor
  • the computer equipment may be a desktop computer, a notebook computer, a palmtop computer, a cloud server and other computing equipment.
  • the computer device can perform human-computer interaction with the user through a keyboard, a mouse, a remote control, a touch pad or a voice control device.
  • the memory 51 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc.
  • the memory 51 may be an internal storage unit of the computer device 5 , such as a hard disk or a memory of the computer device 5 .
  • the memory 51 may also be an external storage device of the computer device 5, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc.
  • the memory 51 may also include both the internal storage unit of the computer device 5 and its external storage device.
  • the memory 51 is generally used to store the operating system and various application software installed on the computer device 5 , such as computer-readable instructions of the speech conversion method.
  • the memory 51 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 52 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. This processor 52 is typically used to control the overall operation of the computer device 5 . In this embodiment, the processor 52 is configured to execute computer-readable instructions stored in the memory 51 or process data, for example, computer-readable instructions for executing the voice conversion method.
  • CPU Central Processing Unit
  • controller a controller
  • microcontroller a microcontroller
  • microprocessor microprocessor
  • This processor 52 is typically used to control the overall operation of the computer device 5 .
  • the processor 52 is configured to execute computer-readable instructions stored in the memory 51 or process data, for example, computer-readable instructions for executing the voice conversion method.
  • the network interface 53 may include a wireless network interface or a wired network interface, and the network interface 53 is generally used to establish a communication connection between the computer device 5 and other electronic devices.
  • the conversion model responds to the target mel spectrum output by the source mel spectrum; converts the target mel spectrum into target audio according to the griffin_lim algorithm.
  • the first voice conversion model has been trained to learn the timbre and emotional characteristics of the audio, so that the voice conversion can take into account the timbre and mood.
  • the dual training method is used to make the first voice conversion model converge quickly and ensure the consistency of the voice content before and after conversion. .
  • the present application also provides another embodiment, that is, to provide a computer-readable storage medium, where the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to The at least one processor is caused to perform the steps of the speech conversion method as described above.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the conversion model responds to the target mel spectrum output by the source mel spectrum; converts the target mel spectrum into target audio according to the griffin_lim algorithm.
  • the first voice conversion model has been trained to learn the timbre and emotional characteristics of the audio, so that the voice conversion can take into account the timbre and mood.
  • the dual training method is used to make the first voice conversion model converge quickly and ensure the consistency of the voice content before and after conversion. .
  • the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation.
  • the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of this application.
  • a storage medium such as ROM/RAM, magnetic disk, CD-ROM

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Acoustics & Sound (AREA)
  • Human Computer Interaction (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • Signal Processing (AREA)
  • Computational Linguistics (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Quality & Reliability (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Reverberation, Karaoke And Other Acoustics (AREA)
  • Electrically Operated Instructional Devices (AREA)

Abstract

一种应用于语音转换领域中的语音转换方法、装置、计算机设备及存储介质,其中方法包括:接收源音频(S201);将源音频输入预设的梅尔滤波器转换为源梅尔频谱(S202);将源梅尔频谱输入到经对偶训练的第一语音转换模型,获得第一语音转换模型响应源梅尔频谱输出的目标梅尔频谱(S203);将目标梅尔频谱根据griffin_lim算法转换为目标音频(S204)。第一语音转换模型经训练学习了音频的音色和情绪特征,使语音转换可以兼顾音色和情绪,同时使用对偶训练方式,使第一语音转换模型快速收敛,且保证了转换前后语音内容的一致性。

Description

语音转换方法、装置、计算机设备及存储介质
本申请要求于2020年12月18日提交中国专利局、申请号为202011504843.7,发明名称为“语音转换方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及语音转换方法、装置、计算机设备及存储介质。
背景技术
随着智能电子设备的普及,用户对信息处理的需求日益多样化,其中对语音也有进一步转换处理的需求。例如将语音卡通化,增加趣味性,或在唱歌时,将声音美化,生成更动听的声音。
发明人发现,大多数语音转换模型都是以分离说话人相关信息和说话人独立信息的语音表示为导向展开研究,这些系统只能分离音色信息,并进行音色的转换,转换特征单一,不能满足用户多样化的声音转换需求。
发明内容
本申请实施例的目的在于提出一种语音转换方法、装置、计算机设备及存储介质,以解决语音转换特征单一,不能满足用户多样化需求的问题。
为了解决上述技术问题,本申请实施例提供一种语音转换方法,采用了如下所述的技术方案:
接收源音频;
将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;
将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;
将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。
为了解决上述技术问题,本申请实施例还提供一种语音转换装置,采用了如下所述的技术方案:
接收模块,用于接收源音频;
源转换模块,用于将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;
处理模块,用于将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;
目标转换模块,用于将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。
为了解决上述技术问题,本申请实施例还提供一种计算机设备,采用了如下所述的技术方案:
一种计算机设备,包括存储器和处理器,存储器中存储有计算机可读指令,所述处理器执行所述计算机可读指令时还实现如下步骤:
接收源音频;
将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;
将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;
将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。
为了解决上述技术问题,本申请实施例还提供一种计算机可读存储介质,采用了如下 所述的技术方案:
一种计算机可读存储介质,计算机可读存储介质上存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行如下步骤:
接收源音频;
将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;
将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;
将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。
与现有技术相比,本申请实施例主要有以下有益效果:通过接收源音频;将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。第一语音转换模型经训练学习了音频的音色和情绪特征,使语音转换可以兼顾音色和情绪,同时使用对偶训练方式,使第一语音转换模型快速收敛,且保证了转换前后语音内容的一致性。
附图说明
为了更清楚地说明本申请中的方案,下面将对本申请实施例描述中所需要使用的附图作一个简单介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请可以应用于其中的示例性系统架构图;
图2根据本申请的语音转换方法的一个实施例的流程图;
图3是对偶训练一种具体实施方式的流程图;
图4是根据本申请的语音转换装置的一个实施例的结构示意图;
图5是根据本申请的计算机设备的一个实施例的结构示意图。
具体实施方式
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同;本文中在申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请;本申请的说明书和权利要求书及上述附图说明中的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。本申请的说明书和权利要求书或上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
为了使本技术领域的人员更好地理解本申请方案,下面将结合附图,对本申请实施例中的技术方案进行清楚、完整地描述。
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种通讯客户端应用,例如网页浏览器应用、购物类应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等。
终端设备101、102、103可以是具有显示屏并且支持网页浏览的各种电子设备,包括 但不限于智能手机、平板电脑、电子书阅读器、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、膝上型便携计算机和台式计算机等等。
服务器105可以是提供各种服务的服务器,例如对终端设备101、102、103上显示的页面提供支持的后台服务器。
需要说明的是,本申请实施例所提供的语音转换方法一般由 服务器/终端设备执行,相应地,语音转换装置一般设置于 服务器/终端设备中。
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。
继续参考图2,示出了根据本申请的语音转换的方法的一个实施例的流程图。所述的语音转换方法,包括以下步骤:
步骤S201,接收源音频。
在本实施例中,语音转换方法运行于其上的电子设备(例如图1所示的 服务器/终端设 )可以通过有线连接方式或者无线连接方式接收源音频。需要指出的是,上述无线连接方式可以包括但不限于3G/4G连接、WiFi连接、蓝牙连接、WiMAX连接、Zigbee连接、UWB(ultra wideband)连接、以及其他现在已知或将来开发的无线连接方式。
源音频为用户通过录音设备录制的音频文件,或保存在存储介质上的音频文件。
步骤S202,将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱。
在本实施例中,梅尔频谱是从音频文件中提取的声音特征,可以通过python的librosa库中的melspectrogram()函数提取音频时域信号的梅尔频谱。
步骤S203,将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱。
在本实施例中,对偶模型为结构相同,训练方向相反的两个模型,即源音频输入到第一语音转换模型,经转换后的输出作为第二语音转换模型的输入,第二语音转换模型预期的输出与第一语音转换模型的输入一致。
本申请的第一语音转换模型和第二语言转换模型都为编解码Encoder-Decoder结构,编解码器都采用了6层的Feed Forward Transformer block,在Decoder的输出端分出两个全连接层,神经元分别为80和1,表示一帧梅尔频谱和停止标识stop token,具体地:
Encoder接收源梅尔频谱作为输入,形状为(batchsize,melframes,meldims),其中batchsize=32,melframes按batch内最大帧长做padding补齐,meldims=80,最后一层FFT block的输出即encoder编码后的隐状态矩阵;
在语音转换时,Decoder的输入是Encoder的输出和起始帧,起始帧为80维全为-1的列向量,每次解码得到的一帧作为下次Decoder的输入帧。
使用对偶方式对第一语音转换模型和第二语音转换模型进行训练,第一语音转换模型的输出做为第二语音转换模型的输入,第二语音转换模型的输出又作为第一语音转换模型的输入,一个样本可以循环多次,需要的样本较少,通过多次计算模型输出与预期输出之间的误差,调整模型参数,使误差最小,模型的收敛更快,转换的效果更佳。
步骤S204,将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。
将通过第一语音转换模型转换得到的目标梅尔频谱通过Griffin-lim算法生成目标音频,完成语音转换过程。
Griffin-lim算法的过程为:随机初始化一个相位谱,用该相位谱与已知的目标梅尔频谱经过ISTFT(逆傅里叶变换)合成新的语音波形,用合成语音做STFT(短时傅里叶变换),得到新的幅度谱和新的相位谱,再用已知的目标梅尔频谱与新的相位谱经过ISTFT(逆傅里叶变换)合成新的语音,如此重复多次,直至合成的语音达到满意的效果。
本申请通过接收源音频;将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;将 所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。第一语音转换模型经训练学习了音频的音色和情绪特征,使语音转换可以兼顾音色和情绪,同时使用对偶训练方式,使第一语音转换模型快速收敛,且保证了转换前后语音内容的一致性。
在本实施例的一些可选的实现方式中,在步骤S203中,上述电子设备还可以执行以下步骤:
获取训练样本,所述训练样本包含源音频样本X和目标音频样本Y;
将所述源音频样本X输入到所述第一语音转换模型进行音频预测,获得所述第一语音转换模型响应所述源音频样本X输出的预测音频样本Y’;
将所述源音频样本X输入到所述第一语音转换模型进行音频还原,获得所述第二语音转换模型响应所述预测音频样本Y’输出的还原音频样本X’,其中所述第二语音转换模型为所述第一语音转换模型的对偶模型;
基于所述目标音频样本Y和预测音频样本Y’计算目标样本均方差,基于所述源音频样本X和还原音频样本X’计算源样本均方差;
调整所述第一语音转换模型和所述第二语音转换模型中各节点的参数,直到所述目标样本均方差和源样本均方差最小,得到对偶训练完成的第一语音转换模型。
这里提到的X、X’、Y、Y’都为梅尔频谱,在训练阶段,第一语音转换模型中Encoder接收源音频样本X作为输入,最后一层FFT block的输出即encoder编码后的隐状态矩阵;
Decoder接收两个输入,一个来自源音频样本X经过Encoder编码后的隐状态、另外一个输入是目标音频样本Y,经过6层FFT block后,接一个全连接层,包含80个神经元,获得所述第一语音转换模型响应所述源音频样本X输出的预测音频样本Y’。计算模型的损失函数,这里采用MSEloss,即均方差损失函数,计算Y和Y’均方差。
再将预测音频样本Y’输入到第二语音转换模型,得到还原音频样本X’,计算X和X’之间的均方差,调整第一语音转换模型和第二语音转换模型中各节点的参数,使Y和Y’均方差以及X和X’均方差最小,训练完成。
本申请通过对偶训练方式,利用少量样本使模型快速收敛,同时计算转换和还原过程均方差,提升了模型预测的效果。
在一些可选的实现方式中,上述电子设备可以执行以下步骤:
将所述预测音频样本Y’输入到预先训练的音频风格分类模型进行分类,获得所述音频风格分类模型响应所述预测音频样本Y’输出的分类结果;
按照下述公式根据所述分类结果计算风格奖励R S
R S=λP(y')
其中,P(y')为所述分类结果,λ为预设的可调参数;
根据对数似然函数计算所述预测音频样本Y’经所述第二语音转换模型还原为X的内容奖励R C
根据所述风格奖励和所述内容奖励,计算综合奖励;
调整所述第一语音转换模型和所述第二语音转换模型中各节点的参数,直至所述综合奖励最大。
本实施例中,将预测音频样本Y’输入到预先训练的音频风格分类模型中,获得分类结果。预先训练的音频风格分类模型可以是预先进行音色分类训练的模型、也可以为预先进行情绪分类训练的模型、还可以是二者的结合。风格奖励为R S=λP(Y’),λ为预设的参数,取值范围为0-1,P(Y’)为音频风格分类模型的输出。
然后计算预测音频样本Y’经第二语音转换模型还原为X的内容奖励R C,即预测音频样本Y’通过模型重新转为原始音频X的对数似然奖励:
R c=logP Φ(x|y′)
最后根据风格奖励和内容奖励计算综合奖励。
本实施例中,综合奖励按如下公式计算:
Figure PCTCN2021083136-appb-000001
为了尽可能保留音频内容和转换后的风格,令综合奖励为内容奖励和风格奖励的调和平均数。
在一些可选的实现方式中,所述预先训练的音频风格分类模型至少包含第一全连接层和第二全连接层,所述将所述预测音频样本Y’输入到预先训练的音频风格分类模型进行分类,获得所述音频风格分类模型响应所述预测音频样本Y’输出的分类结果的步骤包括:
Rs=σPα(y')+δPβ(y')
σ和δ为预设的可调参数,σ和δ大于0,σ+δ=1,Pα和Pβ分别为所述音色分类结果和所述情绪分类结果。
在训练过程中,通过调节σ和δ,对音色和情感奖励进行定量缩放,实现融合了细粒度特征的语音转换模型,即可以调整σ和δ使训练的第一语音转换模型可以将源音频转换为融合了音色和情绪特征的目标音频。
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如流程模块。一般地,流程模块包括执行特定任务或实现特定抽象数据类型的例程、流程、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,流程模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,该计算机可读指令可存储于一计算机可读取存储介质中,该流程在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。
应该理解的是,虽然附图的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,附图的流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
进一步参考图4,作为对上述图2所示方法的实现,本申请提供了一种语音转换装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图4所示,本实施例所述的语音转换装置400包括:接收模块401、源转换模块402、处理模块403以及目标转换模块404。其中:
接收模块401,用于接收源音频;
源转换模块402,用于将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;
处理模块403,用于将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;
目标转换模块404,用于将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。
通过接收源音频;将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源 梅尔频谱输出的目标梅尔频谱;将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。第一语音转换模型经训练学习了音频的音色和情绪特征,使语音转换可以兼顾音色和情绪,同时使用对偶训练方式,使第一语音转换模型快速收敛,且保证了转换前后语音内容的一致性。
在本实施例的一些可选的实现方式中,所述语音转换装置还包括:
第一获取子模块,用于获取训练样本,所述训练样本包含源音频样本X和目标音频样本Y;
第一转换子模块,用于将所述源音频样本X输入到所述第一语音转换模型进行音频预测,获得所述第一语音转换模型响应所述源音频样本X输出的预测音频样本Y’;
第二转换子模块,用于将所述源音频样本X输入到所述第一语音转换模型进行音频还原,获得所述第二语音转换模型响应所述预测音频样本Y’输出的还原音频样本X’,其中所述第二语音转换模型为所述第一语音转换模型的对偶模型;
第一计算子模块,用于基于所述目标音频样本Y和预测音频样本Y’计算目标样本均方差,基于所述源音频样本X和还原音频样本X’计算源样本均方差;
第一调整子模块,用于调整所述第一语音转换模型和所述第二语音转换模型中各节点的参数,直到所述目标样本均方差和源样本均方差最小,得到对偶训练完成的第一语音转换模型。
在本实施例的一些可选的实现方式中,所述语音转换装置还包括:
第一分类子模块,用于将所述预测音频样本Y’输入到预先训练的音频风格分类模型进行分类,获得所述音频风格分类模型响应所述预测音频样本Y’输出的分类结果;
第二计算子模块,用于按照下述公式根据所述分类结果计算风格奖励R S
R S=λP(y')
其中,P(y')为所述分类结果,λ为预设的可调参数;
第三计算子模块,用于根据对数似然函数计算所述预测音频样本Y’经所述第二语音转换模型还原为X的内容奖励R C
第四计算子模块,用于根据所述风格奖励和所述内容奖励,计算综合奖励;
第一调整子模块,用于调整所述第一语音转换模型和所述第二语音转换模型中各节点的参数,直至所述综合奖励最大。
在本实施例的一些可选的实现方式中,所述第四计算子模块中,所述综合奖励按如下公式计算:
Figure PCTCN2021083136-appb-000002
其中R为综合奖励,R S为风格奖励,R C为内容奖励R C
在本实施例的一些可选的实现方式中,所述第一分类子模块中,所述预先训练的音频风格分类模型,至少包含第一全连接层、第二全连接层和特征提取网络,所述将所述预测音频样本Y’输入到预先训练的音频风格分类模型进行分类,获得所述音频风格分类模型响应所述预测音频样本Y’输出的分类结果的步骤包括:
Rs=σPα(y')+δPβ(y')
σ和δ为预设的可调参数,σ和δ大于0,σ+δ=1,Pα和Pβ分别为所述音色分类结果和所述情绪分类结果。
为解决上述技术问题,本申请实施例还提供计算机设备。具体请参阅图5,图5为本实施例计算机设备基本结构框图。
所述计算机设备5包括通过系统总线相互通信连接存储器51、处理器52、网络接口53。需要指出的是,图中仅示出了具有组件51-53的计算机设备5,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。其中,本技术领域技术人员可以理解,这里的计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application  Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。
所述计算机设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述计算机设备可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。
所述存储器51至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器51可以是所述计算机设备5的内部存储单元,例如该计算机设备5的硬盘或内存。在另一些实施例中,所述存储器51也可以是所述计算机设备5的外部存储设备,例如该计算机设备5上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,所述存储器51还可以既包括所述计算机设备5的内部存储单元也包括其外部存储设备。本实施例中,所述存储器51通常用于存储安装于所述计算机设备5的操作系统和各类应用软件,例如语音转换方法的计算机可读指令等。此外,所述存储器51还可以用于暂时地存储已经输出或者将要输出的各类数据。
所述处理器52在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器52通常用于控制所述计算机设备5的总体操作。本实施例中,所述处理器52用于运行所述存储器51中存储的计算机可读指令或者处理数据,例如运行所述语音转换方法的计算机可读指令。
所述网络接口53可包括无线网络接口或有线网络接口,该网络接口53通常用于在所述计算机设备5与其他电子设备之间建立通信连接。
通过接收源音频;将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。第一语音转换模型经训练学习了音频的音色和情绪特征,使语音转换可以兼顾音色和情绪,同时使用对偶训练方式,使第一语音转换模型快速收敛,且保证了转换前后语音内容的一致性。
本申请还提供了另一种实施方式,即提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令可被至少一个处理器执行,以使所述至少一个处理器执行如上述的语音转换方法的步骤。所述计算机可读存储介质可以是非易失性,也可以是易失性。
通过接收源音频;将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。第一语音转换模型经训练学习了音频的音色和情绪特征,使语音转换可以兼顾音色和 情绪,同时使用对偶训练方式,使第一语音转换模型快速收敛,且保证了转换前后语音内容的一致性。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
显然,以上所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例,附图中给出了本申请的较佳实施例,但并不限制本申请的专利范围。本申请可以以许多不同的形式来实现,相反地,提供这些实施例的目的是使对本申请的公开内容的理解更加透彻全面。尽管参照前述实施例对本申请进行了详细的说明,对于本领域的技术人员来而言,其依然可以对前述各具体实施方式所记载的技术方案进行修改,或者对其中部分技术特征进行等效替换。凡是利用本申请说明书及附图内容所做的等效结构,直接或间接运用在其他相关的技术领域,均同理在本申请专利保护范围之内。

Claims (20)

  1. 一种语音转换方法,包括下述步骤:
    接收源音频;
    将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;
    将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;
    将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。
  2. 根据权利要求1所述的语音转换方法,其中,在所述将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱的步骤之前包括:
    获取训练样本,所述训练样本包含源音频样本X和目标音频样本Y;
    将所述源音频样本X输入到所述第一语音转换模型进行音频预测,获得所述第一语音转换模型响应所述源音频样本X输出的预测音频样本Y’;
    将所述源音频样本X输入到所述第一语音转换模型进行音频还原,获得所述第二语音转换模型响应所述预测音频样本Y’输出的还原音频样本X’,其中所述第二语音转换模型为所述第一语音转换模型的对偶模型;
    基于所述目标音频样本Y和预测音频样本Y’计算目标样本均方差,基于所述源音频样本X和还原音频样本X’计算源样本均方差;
    调整所述第一语音转换模型和所述第二语音转换模型中各节点的参数,直到所述目标样本均方差和源样本均方差最小,得到对偶训练完成的第一语音转换模型。
  3. 根据权利要求2所述的语音转换方法,其中,在所述将所述源音频样本X输入到所述第一语音转换模型进行音频预测,得到预测音频样本Y’的步骤之后,所述得到训练完成的第一语音转换模型的步骤之前,所述第一语音转换模型的训练还包括:
    将所述预测音频样本Y’输入到预先训练的音频风格分类模型进行分类,获得所述音频风格分类模型响应所述预测音频样本Y’输出的分类结果;
    按照下述公式根据所述分类结果计算风格奖励R S
    R S=λP(y')
    其中,P(y')为所述分类结果,λ为预设的可调参数;
    根据对数似然函数计算所述预测音频样本Y’经所述第二语音转换模型还原为X的内容奖励R C
    根据所述风格奖励和所述内容奖励,计算综合奖励;
    调整所述第一语音转换模型和所述第二语音转换模型中各节点的参数,直至所述综合奖励最大。
  4. 根据权利要求3所述的语音转换方法,其中,所述综合奖励按如下公式计算:
    Figure PCTCN2021083136-appb-100001
    其中R为综合奖励,R S为风格奖励,R C为内容奖励R C
  5. 根据权利要求3所述的语音转换方法,其中,所述预先训练的音频风格分类模型,至少包含第一全连接层、第二全连接层和特征提取网络,所述将所述预测音频样本Y’输入到预先训练的音频风格分类模型进行分类,获得所述音频风格分类模型响应所述预测音频样本Y’输出的分类结果的步骤包括:
    将所述预测音频样本Y’输入到所述特征提取网络,提取所述预测音频样本Y’的音频特征;
    将所述音频特征输入到所述第一全连接层进行音色分类,获得所述音频特征经所述第一全连接层计算的音色分类结果;
    将所述音频特征输入到所述第二全连接层进行情绪分类,获得所述音频特征经所述第 二全连接层计算的情绪分类结果;
    根据所述音色分类结果和所述情绪分类结果,按照下述公式计算风格奖励Rs:
    Rs=σPα(y')+δPβ(y')
    σ和δ为预设的可调参数,σ和δ大于0,σ+δ=1,Pα和Pβ分别为所述音色分类结果和所述情绪分类结果。
  6. 一种语音转换装置,包括:
    接收模块,用于接收源音频;
    源转换模块,用于将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;
    处理模块,用于将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;
    目标转换模块,用于将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。
  7. 根据权利要求6所述的语音转换装置,其中,所述语音转换装置还包括:
    第一获取子模块,用于获取训练样本,所述训练样本包含源音频样本X和目标音频样本Y;
    第一转换子模块,用于将所述源音频样本X输入到所述第一语音转换模型进行音频预测,获得所述第一语音转换模型响应所述源音频样本X输出的预测音频样本Y’;
    第二转换子模块,用于将所述源音频样本X输入到所述第一语音转换模型进行音频还原,获得所述第二语音转换模型响应所述预测音频样本Y’输出的还原音频样本X’,其中所述第二语音转换模型为所述第一语音转换模型的对偶模型;
    第一计算子模块,用于基于所述目标音频样本Y和预测音频样本Y’计算目标样本均方差,基于所述源音频样本X和还原音频样本X’计算源样本均方差;
    第一调整子模块,用于调整所述第一语音转换模型和所述第二语音转换模型中各节点的参数,直到所述目标样本均方差和源样本均方差最小,得到对偶训练完成的第一语音转换模型。
  8. 根据权利要求7所述的语音转换装置,其中,所述语音转换装置还包括:
    第一分类子模块,用于将所述预测音频样本Y’输入到预先训练的音频风格分类模型进行分类,获得所述音频风格分类模型响应所述预测音频样本Y’输出的分类结果;
    第二计算子模块,用于按照下述公式根据所述分类结果计算风格奖励R S
    R S=λP(y')
    其中,P(y')为所述分类结果,λ为预设的可调参数;
    第三计算子模块,用于根据对数似然函数计算所述预测音频样本Y’经所述第二语音转换模型还原为X的内容奖励R C
    第四计算子模块,用于根据所述风格奖励和所述内容奖励,计算综合奖励;
    第一调整子模块,用于调整所述第一语音转换模型和所述第二语音转换模型中各节点的参数,直至所述综合奖励最大。
  9. 根据权利要求8所述的语音转换装置,其中,所述综合奖励按如下公式计算:
    Figure PCTCN2021083136-appb-100002
    其中R为综合奖励,R S为风格奖励,R C为内容奖励R C
  10. 根据权利要求8所述的语音转换装置,其中,所述第一分类子模块中所述的预先训练的音频风格分类模型,至少包含第一全连接层、第二全连接层和特征提取网络,所述第一分类子模块包括:
    第一特征提取子单元,用于将所述预测音频样本Y’输入到所述特征提取网络,提取所述预测音频样本Y’的音频特征;
    第一分类子单元,用于将所述音频特征输入到所述第一全连接层进行音色分类,获得所述音频特征经所述第一全连接层计算的音色分类结果;
    第二分类子单元,用于将所述音频特征输入到所述第二全连接层进行情绪分类,获得 所述音频特征经所述第二全连接层计算的情绪分类结果;
    第一计算子单元,用于根据所述音色分类结果和所述情绪分类结果,按照下述公式计算风格奖励Rs:
    Rs=σPα(y')+δPβ(y')
    σ和δ为预设的可调参数,σ和δ大于0,σ+δ=1,Pα和Pβ分别为所述音色分类结果和所述情绪分类结果。
  11. 一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述处理器执行所述计算机可读指令时还实现如下步骤:
    接收源音频;
    将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;
    将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;
    将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。
  12. 根据权利要求11所述的计算机设备,其中,在所述将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱的步骤之前包括:
    获取训练样本,所述训练样本包含源音频样本X和目标音频样本Y;
    将所述源音频样本X输入到所述第一语音转换模型进行音频预测,获得所述第一语音转换模型响应所述源音频样本X输出的预测音频样本Y’;
    将所述源音频样本X输入到所述第一语音转换模型进行音频还原,获得所述第二语音转换模型响应所述预测音频样本Y’输出的还原音频样本X’,其中所述第二语音转换模型为所述第一语音转换模型的对偶模型;
    基于所述目标音频样本Y和预测音频样本Y’计算目标样本均方差,基于所述源音频样本X和还原音频样本X’计算源样本均方差;
    调整所述第一语音转换模型和所述第二语音转换模型中各节点的参数,直到所述目标样本均方差和源样本均方差最小,得到对偶训练完成的第一语音转换模型。
  13. 根据权利要求12所述的计算机设备,其中,在所述将所述源音频样本X输入到所述第一语音转换模型进行音频预测,得到预测音频样本Y’的步骤之后,所述得到训练完成的第一语音转换模型的步骤之前,所述第一语音转换模型的训练还包括:
    将所述预测音频样本Y’输入到预先训练的音频风格分类模型进行分类,获得所述音频风格分类模型响应所述预测音频样本Y’输出的分类结果;
    按照下述公式根据所述分类结果计算风格奖励R S
    R S=λP(y')
    其中,P(y')为所述分类结果,λ为预设的可调参数;
    根据对数似然函数计算所述预测音频样本Y’经所述第二语音转换模型还原为X的内容奖励R C
    根据所述风格奖励和所述内容奖励,计算综合奖励;
    调整所述第一语音转换模型和所述第二语音转换模型中各节点的参数,直至所述综合奖励最大。
  14. 根据权利要求13所述的计算机设备,其中,所述综合奖励按如下公式计算:
    Figure PCTCN2021083136-appb-100003
    其中R为综合奖励,R S为风格奖励,R C为内容奖励R C
  15. 根据权利要求13所述的计算机设备,其中,所述预先训练的音频风格分类模型,至少包含第一全连接层、第二全连接层和特征提取网络,所述将所述预测音频样本Y’输入到预先训练的音频风格分类模型进行分类,获得所述音频风格分类模型响应所述预测音频样本Y’输出的分类结果的步骤包括:
    将所述预测音频样本Y’输入到所述特征提取网络,提取所述预测音频样本Y’的音频特征;
    将所述音频特征输入到所述第一全连接层进行音色分类,获得所述音频特征经所述第一全连接层计算的音色分类结果;
    将所述音频特征输入到所述第二全连接层进行情绪分类,获得所述音频特征经所述第二全连接层计算的情绪分类结果;
    根据所述音色分类结果和所述情绪分类结果,按照下述公式计算风格奖励Rs:
    Rs=σPα(y')+δPβ(y')
    σ和δ为预设的可调参数,σ和δ大于0,σ+δ=1,Pα和Pβ分别为所述音色分类结果和所述情绪分类结果。
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行如下步骤:
    接收源音频;
    将所述源音频输入预设的梅尔滤波器转换为源梅尔频谱;
    将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱;
    将所述目标梅尔频谱根据griffin_lim算法转换为目标音频。
  17. 根据权利要求16所述的计算机可读存储介质,其中,在所述将所述源梅尔频谱输入到经对偶训练的第一语音转换模型,获得所述第一语音转换模型响应所述源梅尔频谱输出的目标梅尔频谱的步骤之前包括:
    获取训练样本,所述训练样本包含源音频样本X和目标音频样本Y;
    将所述源音频样本X输入到所述第一语音转换模型进行音频预测,获得所述第一语音转换模型响应所述源音频样本X输出的预测音频样本Y’;
    将所述源音频样本X输入到所述第一语音转换模型进行音频还原,获得所述第二语音转换模型响应所述预测音频样本Y’输出的还原音频样本X’,其中所述第二语音转换模型为所述第一语音转换模型的对偶模型;
    基于所述目标音频样本Y和预测音频样本Y’计算目标样本均方差,基于所述源音频样本X和还原音频样本X’计算源样本均方差;
    调整所述第一语音转换模型和所述第二语音转换模型中各节点的参数,直到所述目标样本均方差和源样本均方差最小,得到对偶训练完成的第一语音转换模型。
  18. 根据权利要求17所述的计算机可读存储介质,其中,在所述将所述源音频样本X输入到所述第一语音转换模型进行音频预测,得到预测音频样本Y’的步骤之后,所述得到训练完成的第一语音转换模型的步骤之前,所述第一语音转换模型的训练还包括:
    将所述预测音频样本Y’输入到预先训练的音频风格分类模型进行分类,获得所述音频风格分类模型响应所述预测音频样本Y’输出的分类结果;
    按照下述公式根据所述分类结果计算风格奖励R S
    R S=λP(y')
    其中,P(y')为所述分类结果,λ为预设的可调参数;
    根据对数似然函数计算所述预测音频样本Y’经所述第二语音转换模型还原为X的内容奖励R C
    根据所述风格奖励和所述内容奖励,计算综合奖励;
    调整所述第一语音转换模型和所述第二语音转换模型中各节点的参数,直至所述综合奖励最大。
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述综合奖励按如下公式计算:
    Figure PCTCN2021083136-appb-100004
    其中R为综合奖励,R S为风格奖励,R C为内容奖励R C
  20. 根据权利要求18所述的计算机可读存储介质,其中,所述预先训练的音频风格分类模型,至少包含第一全连接层、第二全连接层和特征提取网络,所述将所述预测音频样本Y’输入到预先训练的音频风格分类模型进行分类,获得所述音频风格分类模型响应所述预测音频样本Y’输出的分类结果的步骤包括:
    将所述预测音频样本Y’输入到所述特征提取网络,提取所述预测音频样本Y’的音频特征;
    将所述音频特征输入到所述第一全连接层进行音色分类,获得所述音频特征经所述第一全连接层计算的音色分类结果;
    将所述音频特征输入到所述第二全连接层进行情绪分类,获得所述音频特征经所述第二全连接层计算的情绪分类结果;
    根据所述音色分类结果和所述情绪分类结果,按照下述公式计算风格奖励Rs:
    Rs=σPα(y')+δPβ(y')
    σ和δ为预设的可调参数,σ和δ大于0,σ+δ=1,Pα和Pβ分别为所述音色分类结果和所述情绪分类结果。
PCT/CN2021/083136 2020-12-18 2021-03-26 语音转换方法、装置、计算机设备及存储介质 WO2022126904A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011504843.7 2020-12-18
CN202011504843.7A CN112634919B (zh) 2020-12-18 2020-12-18 语音转换方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022126904A1 true WO2022126904A1 (zh) 2022-06-23

Family

ID=75317205

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/083136 WO2022126904A1 (zh) 2020-12-18 2021-03-26 语音转换方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN112634919B (zh)
WO (1) WO2022126904A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116310863A (zh) * 2023-02-18 2023-06-23 广东技术师范大学 一种多尺度差分特征增强的遥感图像变化检测方法和装置

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113178200B (zh) * 2021-04-28 2024-03-01 平安科技(深圳)有限公司 语音转换方法、装置、服务器及存储介质
CN113284484B (zh) * 2021-05-24 2022-07-26 百度在线网络技术(北京)有限公司 模型训练方法及装置、语音识别方法和语音合成方法
CN113314102A (zh) * 2021-05-27 2021-08-27 武汉大学 一种对偶语音转换方法、装置、存储介质和设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108133705A (zh) * 2017-12-21 2018-06-08 儒安科技有限公司 基于对偶学习的语音识别与语音合成模型训练方法
US10186251B1 (en) * 2015-08-06 2019-01-22 Oben, Inc. Voice conversion using deep neural network with intermediate voice training
CN109887484A (zh) * 2019-02-22 2019-06-14 平安科技(深圳)有限公司 一种基于对偶学习的语音识别与语音合成方法及装置
CN111247585A (zh) * 2019-12-27 2020-06-05 深圳市优必选科技股份有限公司 语音转换方法、装置、设备及存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09305197A (ja) * 1996-05-16 1997-11-28 N T T Data Tsushin Kk 音声変換方法及び装置
CN108847249B (zh) * 2018-05-30 2020-06-05 苏州思必驰信息科技有限公司 声音转换优化方法和系统
CN111914115B (zh) * 2019-05-08 2024-05-28 阿里巴巴集团控股有限公司 一种声音信息的处理方法、装置及电子设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10186251B1 (en) * 2015-08-06 2019-01-22 Oben, Inc. Voice conversion using deep neural network with intermediate voice training
CN108133705A (zh) * 2017-12-21 2018-06-08 儒安科技有限公司 基于对偶学习的语音识别与语音合成模型训练方法
CN109887484A (zh) * 2019-02-22 2019-06-14 平安科技(深圳)有限公司 一种基于对偶学习的语音识别与语音合成方法及装置
CN111247585A (zh) * 2019-12-27 2020-06-05 深圳市优必选科技股份有限公司 语音转换方法、装置、设备及存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LAI JIAHAO: "Investigation on Deep Learning Based Voice Conversion", MASTER THESIS, TIANJIN POLYTECHNIC UNIVERSITY, CN, no. 1, 15 January 2020 (2020-01-15), CN , XP055942883, ISSN: 1674-0246 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116310863A (zh) * 2023-02-18 2023-06-23 广东技术师范大学 一种多尺度差分特征增强的遥感图像变化检测方法和装置

Also Published As

Publication number Publication date
CN112634919A (zh) 2021-04-09
CN112634919B (zh) 2024-05-28

Similar Documents

Publication Publication Date Title
WO2022126904A1 (zh) 语音转换方法、装置、计算机设备及存储介质
US11482207B2 (en) Waveform generation using end-to-end text-to-waveform system
WO2022007438A1 (zh) 情感语音数据转换方法、装置、计算机设备及存储介质
US11355097B2 (en) Sample-efficient adaptive text-to-speech
CN111599343B (zh) 用于生成音频的方法、装置、设备和介质
WO2022188734A1 (zh) 一种语音合成方法、装置以及可读存储介质
US20230298562A1 (en) Speech synthesis method, apparatus, readable medium, and electronic device
WO2022156544A1 (zh) 语音合成方法、装置、可读介质及电子设备
WO2022105553A1 (zh) 语音合成方法、装置、可读介质及电子设备
CN112786008B (zh) 语音合成方法、装置、可读介质及电子设备
WO2021051514A1 (zh) 一种语音识别方法、装置、计算机设备及非易失性存储介质
CN111968618A (zh) 语音合成方法、装置
CN116030792B (zh) 用于转换语音音色的方法、装置、电子设备和可读介质
CN107452378A (zh) 基于人工智能的语音交互方法和装置
WO2022052744A1 (zh) 会话信息处理方法、装置、计算机可读存储介质及设备
CN113327580A (zh) 语音合成方法、装置、可读介质及电子设备
CN111261177A (zh) 语音转换方法、电子装置及计算机可读存储介质
WO2022257454A1 (zh) 一种合成语音的方法、装置、终端及存储介质
CN114550702A (zh) 一种语音识别方法和装置
CN110286776A (zh) 字符组合信息的输入方法、装置、电子设备和存储介质
CN110379406A (zh) 语音评论转换方法、系统、介质和电子设备
JP2023169230A (ja) コンピュータプログラム、サーバ装置、端末装置、学習済みモデル、プログラム生成方法、及び方法
CN111862933A (zh) 用于生成合成语音的方法、装置、设备和介质
CN113421554B (zh) 语音关键词检测模型处理方法、装置及计算机设备
JP7113000B2 (ja) 映像を生成するための方法および装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21904844

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21904844

Country of ref document: EP

Kind code of ref document: A1