This disclosure relates to a streaming vocoder
A speech-to-speech model can produce synthesized speech based on a source audio input. The last step of speech-to-speech conversion is generating audio samples at the desired sampling frequency, which can then be converted into synthesized speech through a vocoder. A common approach for generating these audio samples is called the Griffin-Lim algorithm, which is an iterative method that processes an entire audio sequence to generate output audio samples.
One aspect of the disclosure provides a computer-implemented method that when executed by data processing hardware causes the data processing hardware to perform operations that include receiving a current spectrogram frame and reconstructing a phase of the current spectrogram frame by, for each corresponding committed spectrogram frame in a sequence of M number of committed spectrogram frames preceding the current spectrogram frame, obtaining a value of a committed phase of the corresponding committed spectrogram frame and estimating the phase of the current spectrogram frame based on a magnitude of the current spectrogram frame and the value of the committed phase of each corresponding committed spectrogram frame in the sequence of M number of committed spectrogram frames preceding the current spectrogram frame. The method also includes synthesizing, for the current spectrogram frame, a new time-domain audio waveform frame based on the estimated phase of the current spectrogram frame.
Implementations of the disclosure may include one or more of the following optional features. In some implementations, the current spectrogram frame includes a log-magnitude spectrogram frame output from a speech conversion model, and prior to reconstructing the phase of the current spectrogram frame, the phase of the current spectrogram frame is initialized with a value equal to zero. In some examples, the M number of committed spectrogram frames preceding the current spectrogram frame is equal to one. In other examples, the M number of committed spectrogram frames preceding the current spectrogram frame is at least two.
In some implementations, the phase of the current spectrogram frame further includes, for each corresponding uncommitted spectrogram frame in a sequence of N number of uncommitted spectrogram frames subsequent to the current spectrogram frame, obtaining a value of an uncommitted phase of the corresponding uncommitted spectrogram frame. Here, estimating the phase of the current spectrogram frame is further based on the value of the uncommitted phase of each corresponding uncommitted spectrogram frame in the sequence of N number of committed spectrogram frames subsequent to the current spectrogram frame. The N number of uncommitted spectrogram frames and the M number of committed spectrogram frames may be equal or different. The N number of committed spectrogram frames subsequent to the current spectrogram frame may be equal to one. Optionally, the N number of committed frames subsequent to the current spectrogram frame is at least two.
In some examples, the current spectrogram frame is in a Short-time Fourier transform (STFT) domain when reconstructing the phase of the current spectrogram frame. In these examples, synthesizing the new time-domain audio waveform frame based on the estimated phase of the current spectrogram frame may include running a streaming inverse STFT on an output frame corresponding to the current spectrogram frame. Here, the output frame may be extracted using the estimated phase of the current spectrogram frame.
In some implementations, the operations further include, after reconstructing the phase of the current spectrogram frame, designating the current spectrogram frame as a committed frame and storing the estimated phase of the current spectrogram frame as a committed phase. The data processing hardware may on a user computing device or a server.
Another aspect of the disclosure provides a system including data processing hardware and memory hardware in communication with the data processing hardware. The memory hardware stores instructions that when executed on the data processing hardware causes the data processing hardware to perform operations that include receiving a current spectrogram frame and reconstructing a phase of the current spectrogram frame by, for each corresponding committed spectrogram frame in a sequence of M number of committed spectrogram frames preceding the current spectrogram frame, obtaining a value of a committed phase of the corresponding committed spectrogram frame and estimating the phase of the current spectrogram frame based on a magnitude of the current spectrogram frame and the value of the committed phase of each corresponding committed spectrogram frame in the sequence of M number of committed spectrogram frames preceding the current spectrogram frame. The method also includes synthesizing, for the current spectrogram frame, a new time-domain audio waveform frame based on the estimated phase of the current spectrogram frame.
This aspect may include one or more of the following optional features. In some implementations, the current spectrogram frame includes a log-magnitude spectrogram frame output from a speech conversion model, and prior to reconstructing the phase of the current spectrogram frame, the phase of the current spectrogram frame is initialized with a value equal to zero. In some examples, the M number of committed spectrogram frames preceding the current spectrogram frame is equal to one. In other examples, the M number of committed spectrogram frames preceding the current spectrogram frame is at least two.
In some implementations, the phase of the current spectrogram frame further includes, for each corresponding uncommitted spectrogram frame in a sequence of N number of uncommitted spectrogram frames subsequent to the current spectrogram frame, obtaining a value of an uncommitted phase of the corresponding uncommitted spectrogram frame. Here, estimating the phase of the current spectrogram frame is further based on the value of the uncommitted phase of each corresponding uncommitted spectrogram frame in the sequence of N number of committed spectrogram frames subsequent to the current spectrogram frame. The N number of uncommitted spectrogram frames and the M number of committed spectrogram frames may be equal or different. The N number of committed spectrogram frames subsequent to the current spectrogram frame may be equal to one. Optionally, the N number of committed frames subsequent to the current spectrogram frame is at least two.
In some examples, the current spectrogram frame is in a Short-time Fourier transform (STFT) domain when reconstructing the phase of the current spectrogram frame. In these examples, synthesizing the new time-domain audio waveform frame based on the estimated phase of the current spectrogram frame may include running a streaming inverse STFT on an output frame corresponding to the current spectrogram frame. Here, the output frame may be extracted using the estimated phase of the current spectrogram frame.
In some implementations, the operations further include, after reconstructing the phase of the current spectrogram frame, designating the current spectrogram frame as a committed frame and storing the estimated phase of the current spectrogram frame as a committed phase. The data processing hardware may on a user computing device or a server.
The details of one or more implementations of the disclosure are set forth in the accompanying drawings and the description below. Other aspects, features, and advantages will be apparent from the description and drawings, and from the claims.
Like reference symbols in the various drawings indicate like elements.
Speech-to-speech conversion systems are used to convert input speech into synthesized speech. This functionality has a variety of real world applications including language translation and converting atypical speech for speakers with impaired speech into canonical fluent speech. For the ideal user experience, speech-to-speech conversion should be quick (i.e., in real time) and computationally inexpensive such that it can be performed on a smart phone, a smart watch, or other similar device.
The present disclosure provides a streaming aware algorithm for inverting log magnitude spectrograms without mel transformation. That is, the present disclosure is directed toward receiving log magnitude spectrograms corresponding a synthetic speech representation output from a speech-to-speech (S2S) model, and using a streaming vocoder to convert/invert the log magnitude spectrograms into time-domain audio waveforms in real-time. The time-domain audio waveforms correspond to audio packets of synthesized speech that may be audibly output from an acoustic speaker. While conventional vocoders used for waveform generation require entire audio sequences for processing, the techniques of the present disclosure can operate on portions of an input signal (i.e., individual frames of a log magnitude spectrogram) to process each portion (i.e., frame) incrementally. Accordingly, the streaming vocoder of the present disclosure is capable of converting log magnitude spectrograms output from the S2S model into time-domain audio waveforms in a streaming manner (i.e., the speech conversion happens in real-time). The resulting speech-to-speech model runs faster and requires less memory than known speech-to-speech systems, such as a neural vocoder.
The speech conversion model 100 includes an encoder 210 configured to encode the input spectrogram 102 into an encoded spectrogram 212 and a decoder 220 configured to decode the encoded spectrogram 212 into the output spectrogram 222 corresponding to the synthesized speech representation. In some examples, the input spectrogram 102 corresponds to raw audio of input speech spoken by a human and sampled at 16 kHz sampling frequency. From the input spectrogram 212, the speech conversion model computes a Short-time Fourier transform (STFT) with a fast Fourier transform (FFT) size of 2048, a frame size equal to 50 milliseconds (ms), a frame step equal to 12.5 ms, and Hann windowing. Each frame step of 12.5 ms may correspond to 200 samples at 16 kHz). The speech conversion model 100 then converts the complex-valued STFT into a real-valued spectrogram by computing the magnitude of each STFT coefficient. The speech conversion model 100 may further process the magnitude spectrogram with a logarithmic compression function applied element-wise with an added shift to produce the output log-magnitude spectrogram 222. The resulting log-magnitude spectrogram (i.e., output spectrogram 222) may be fed as input to the streaming vocoder 375. Implementations herein are directed toward the streaming vocoder 375 operating in a streaming mode by processing the log-magnitude spectrogram 222 frame-by-frame to generate corresponding output audio frames in the time domain with length equal to 12.5 ms (for 200 samples). Simply put, the capability of the streaming vocoder 375 to operate in streaming mode allows for real-time speech-to-speech conversion such that a new output audio frame corresponding to synthesized speech in in the time domain is produced for each log magnitude spectrogram frame output by the S2S model 100.
The encoder 210 may include a stack of multi-head attention blocks (referred to herein as conformer blocks) which may include conformers or transformers. Each multi-head attention block may include a multi-head attention mechanism. The conformer blocks may be implemented by the encoder 210 to capture the fine-grained spectral patters of incoming atypical speech. In these implementations, the encoder sub samples the input audio data 102 using a convolutional layer, and then processes the input audio data 102 with the stack of Conformer blocks. Each Conformer block may include a feed-forward layer, a self-attention layer, a convolution layer, and a second feed-forward layer. In some implementations, the encoder 210 includes a neural network architecture that is Long Short-Term Memory (LSTM) based. The above examples are not intended to be limiting and the encoder 210 can include any suitable structure to generate the encoded spectrogram 212 from the input spectrogram 102.
Further, the decoder 220 (i.e., a spectrogram decoder) may generate the output spectrogram 222 corresponding to the synthesized speech representation based on the encoded spectrogram 212 output from the encoder 210. The decoder 220 may include recurrent neural network-based architectures that each receive the encoded spectrogram 212 output by the encoder 210. The decoder 220 may include a cross-attention mechanism 231 configured to receive the encoded spectrogram 212 from the encoder 210. The decoder 220 may further process the encoded spectrogram 212 using a number of long-short term memory (LSTM) layers and/or a conversion layer. Implementations are directed toward the decoder 220 generating the output spectrogram 222 from the encoded spectrogram 212 directly without performing any intermediate text-to-speech conversion on a textual representation corresponding to a transcription of the utterance.
In some implementations, the speech conversion model 100 continuously generates the log-magnitude spectrogram frames 222 corresponding to synthesized speech representations of an utterance as the source speaker 104 speaks corresponding portions of the utterance. The vocoder 375 (also referred to interchangeably as a synthesizer 375) of the speech conversion system 10 is configured to convert each frame of the log-magnitude spectrogram frames 222 emitted by the decoder 220 into a corresponding time-domain waveform 376 of synthesized speech of the same utterance 114 for audible output from another computing device 116. Thus, with the speech conversion model 100 continuously generating the log-magnitude spectrogram frames 222 corresponding to synthesized speech representations of portions of the utterance 108 spoken by the source speaker 104, the streaming vocoder 375 is able to convert the log-magnitude spectrogram frames 222 into corresponding time-domain audio waveforms on a frame-by-frame basis such that the conversation of the source speaker's 104 into synthesized speech audibly output by the user 118 (or audience) may be more naturally paced. A time-domain audio waveform includes an audio waveform that defines an amplitude of an audio signal over time. A computing device 110 associated with the source speaker 104 may capture the utterance 108 spoken by the source speaker 104 and provide the corresponding input audio data 102 to the speech-to-speech conversion system 10 for conversion into the output spectrogram 222. The computing device 110 may include, without limitation, a smart phone, tablet, desktop/laptop computer, smart speaker, smart display, smart appliance, assistant-enabled wearable device (e.g., smart watch, smart headphones, smart glasses, etc.), or vehicle infotainment system. Thereafter, the speech conversion system 10 may employ the vocoder 375 to convert the output spectrogram 222 into a time-domain audio waveform 376 that may be audibly output from the computing device 110 or another computing device 116 as the utterance 114 of synthesized canonical fluent speech.
Alternatively, the other computing device 116 may be associated with down-stream automated speech recognition (ASR) system in which the speech conversion system 10 functions as a front-end to provide the output audio data 106 corresponding to the synthesized speech representation as an input to the ASR system for conversion into recognized text. The recognized text could be presented to the other user 118 and/or could be provided to a natural language understanding (NLU) system for further processing. The functionality of the speech conversion system 10 can reside on a remote server 112, on either or both of the computing devices 110, 116, or any combination of the remote server and computing devices 110, 116. The speech conversion system 10 could be distributed across multiple devices such that the speech conversion model 100 resides on one of the computing device 110 or the remote server 112 and the vocoder 375 resides on one of the remote server 112 or the other computing device 116.
In some implementations, the streaming vocoder 375 executes a streaming/real-time Griffin-Lim algorithm 200 for inverting magnitude spectrograms in streaming mode.
The algorithm 200 receives, as input, the log magnitude spectrogram 222 (mag_f) (e.g., with size 1025, i.e., equal to the FFT size divided by two, plus one). Then, the algorithm 200 inverts the natural logarithm by exponentiating a current input magnitude frame (line 8 on
The algorithm pre-computes the phase of committed frames (in line 22) and uses them as a phase constrain, so that phase of committed frames do not change during GL iterations below. A number of iterations (n_iters) GL iterations are executed based on the current content of the sliding window queues (line 24). Namely, this includes computing the inverse and forward STFT, estimating the uncommitted phase and recomputing stft_w by combining the committed phase (commit_phase) and the uncommitted phase (uncommit_phase) with the magnitude spectrogram (mag_w) (line 35 of
After using the algorithm 200 to reconstruct the phase of the current spectrogram frame 222, the current spectrogram frame may be designated as a committed frame and the estimated phase of the current spectrogram frame may be stored (i.e., on memory hardware of the remote server 12, on either or both of the computing devices 110, 116, or any combination of the remote server and computing devices 110, 116) as a committed phase.
The algorithm 200 executes in streaming mode whenever a new log magnitude spectrogram frame 222 output from the speech conversion model 100 is available. Once stft_o is computed, a new frame of 200 samples of audio are synthesized running the streaming inverse STFT. Notably, all iterations performed by the algorithm occur in the STFT domain. Opposed to neural network-based vocoders performing spectrogram inversion, the streaming vocoder 375 employing the algorithm 200 does not require any training.
At operation 302, the method 300 includes receiving a current spectrogram frame 222. The current spectrogram frame 222 may include a log-magnitude spectrogram frame output from a speech conversion model 100. The phase of the current spectrogram frame 222 may be initialized with a value equal to zero.
At operation 304, the method 300 includes reconstructing a phase of the current spectrogram frame. Reconstructing the phase of the current spectrogram frame includes, for each corresponding committed spectrogram frame in a sequence of M number of committed spectrogram frames preceding the current spectrogram frame, obtaining a value of a committed phase of the corresponding committed spectrogram frame. Thereafter, reconstructing the phase of current spectrogram frame also includes estimating the phase of the current spectrogram frame based on a magnitude of the current spectrogram frame and the value of the committed phase of each corresponding committed spectrogram frame in the sequence of M number of committed spectrogram frames preceding the current spectrogram frame.
At operation 306, the method 300 includes synthesizing a new time-domain audio waveform frame for the current spectrogram frame based on the estimated phase of the current spectrogram frame. The current spectrogram frame may be in a Short-time Fourier transform (STFT) domain when reconstructing the phase of the current spectrogram frame. Here, synthesizing the new time-domain audio waveform frame based on the estimated phase of the current spectrogram frame may include running a streaming inverse STFT on an output frame corresponding to the current spectrogram frame. The output frame may be extracted using the estimated phase of the current spectrogram frame.
A software application (i.e., a software resource) may refer to computer software that causes a computing device to perform a task. In some examples, a software application may be referred to as an “application,” an “app,” or a “program.” Example applications include, but are not limited to, system diagnostic applications, system management applications, system maintenance applications, word processing applications, spreadsheet applications, messaging applications, media streaming applications, social networking applications, and gaming applications.
The computing device 400 includes a processor 410, memory 420, a storage device 430, a high-speed interface/controller 440 connecting to the memory 420 and high-speed expansion ports 450, and a low speed interface/controller 460 connecting to a low speed bus 470 and a storage device 430. Each of the components 410, 420, 430, 440, 450, and 460, are interconnected using various busses, and may be mounted on a common motherboard or in other manners as appropriate. The processor 410 can process instructions for execution within the computing device 400, including instructions stored in the memory 420 or on the storage device 430 to display graphical information for a graphical user interface (GUI) on an external input/output device, such as display 480 coupled to high speed interface 440. In other implementations, multiple processors and/or multiple buses may be used, as appropriate, along with multiple memories and types of memory. Also, multiple computing devices 400 may be connected, with each device providing portions of the necessary operations (e.g., as a server bank, a group of blade servers, or a multi-processor system).
The memory 420 stores information non-transitorily within the computing device 400. The memory 420 may be a computer-readable medium, a volatile memory unit(s), or non-volatile memory unit(s). The non-transitory memory 420 may be physical devices used to store programs (e.g., sequences of instructions) or data (e.g., program state information) on a temporary or permanent basis for use by the computing device 400. Examples of non-volatile memory include, but are not limited to, flash memory and read-only memory (ROM)/programmable read-only memory (PROM)/erasable programmable read-only memory (EPROM)/electronically erasable programmable read-only memory (EEPROM) (e.g., typically used for firmware, such as boot programs). Examples of volatile memory include, but are not limited to, random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), phase change memory (PCM) as well as disks or tapes.
The storage device 430 is capable of providing mass storage for the computing device 400. In some implementations, the storage device 430 is a computer-readable medium. In various different implementations, the storage device 430 may be a floppy disk device, a hard disk device, an optical disk device, or a tape device, a flash memory or other similar solid state memory device, or an array of devices, including devices in a storage area network or other configurations. In additional implementations, a computer program product is tangibly embodied in an information carrier. The computer program product contains instructions that, when executed, perform one or more methods, such as those described above. The information carrier is a computer- or machine-readable medium, such as the memory 420, the storage device 430, or memory on processor 410.
The high speed controller 440 manages bandwidth-intensive operations for the computing device 400, while the low speed controller 460 manages lower bandwidth-intensive operations. Such allocation of duties is exemplary only. In some implementations, the high-speed controller 440 is coupled to the memory 420, the display 480 (e.g., through a graphics processor or accelerator), and to the high-speed expansion ports 450, which may accept various expansion cards (not shown). In some implementations, the low-speed controller 460 is coupled to the storage device 430 and a low-speed expansion port 490. The low-speed expansion port 490, which may include various communication ports (e.g., USB, Bluetooth, Ethernet, wireless Ethernet), may be coupled to one or more input/output devices, such as a keyboard, a pointing device, a scanner, or a networking device such as a switch or router, e.g., through a network adapter.
The computing device 400 may be implemented in a number of different forms, as shown in the figure. For example, it may be implemented as a standard server 400a or multiple times in a group of such servers 400a, as a laptop computer 400b, or as part of a rack server system 400c.
Various implementations of the systems and techniques described herein can be realized in digital electronic and/or optical circuitry, integrated circuitry, specially designed ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software, software applications or code) include machine instructions for a programmable processor, and can be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms “machine-readable medium” and “computer-readable medium” refer to any computer program product, non-transitory computer readable medium, apparatus and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term “machine-readable signal” refers to any signal used to provide machine instructions and/or data to a programmable processor.
The processes and logic flows described in this specification can be performed by one or more programmable processors, also referred to as data processing hardware, executing one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit). Processors suitable for the execution of a computer program include, by way of example, both general and special purpose microprocessors, and any one or more processors of any kind of digital computer. Generally, a processor will receive instructions and data from a read only memory or a random access memory or both. The essential elements of a computer are a processor for performing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto optical disks, or optical disks. However, a computer need not have such devices. Computer readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto optical disks; and CD ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.
To provide for interaction with a user, one or more aspects of the disclosure can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube), LCD (liquid crystal display) monitor, or touch screen for displaying information to the user and optionally a keyboard and a pointing device, e.g., a mouse or a trackball, by which the user can provide input to the computer. Other kinds of devices can be used to provide interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input. In addition, a computer can interact with a user by sending documents to and receiving documents from a device that is used by the user; for example, by sending web pages to a web browser on a user's client device in response to requests received from the web browser.
A number of implementations have been described. Nevertheless, it will be understood that various modifications may be made without departing from the spirit and scope of the disclosure. Accordingly, other implementations are within the scope of the following claims.
This U.S. patent application claims priority under 35 U.S.C. § 119(e) to U.S. Provisional Application 63/312,195, filed on Feb. 21, 2022. The disclosure of this prior application is considered part of the disclosure of this application and is hereby incorporated by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
63312195 | Feb 2022 | US |