Method, apparatus, electronic device and computer readable medium for processing audio

文档序号:1273725 发布日期:2020-08-25 浏览:25次 中文

阅读说明:本技术 用于处理音频的方法、装置、电子设备和计算机可读介质 (Method, apparatus, electronic device and computer readable medium for processing audio ) 是由 顾宇 于 2020-04-30 设计创作,主要内容包括:本公开的实施例公开了用于处理音频的方法和装置。该方法的一具体实施方式包括:生成第一音频所对应的音频帧序列中每个音频帧的音高;根据上述音高,从上述音频帧序列中选择音频帧作为待调整音频帧,得到待调整音频帧序列;基于上述待调整音频帧序列中每个待调整音频帧的音高和预设阈值,调整上述待调整音频帧的音高;基于调整后的音频帧与上述音频帧序列中未调整的音频帧,生成第二音频。本公开的实施例通过对原有音频数据进行调整,生成一批新的音频数据,使用新的音频数据来对声码器进行训练,使得训练后声码器在处理音频数据时有更好的表现。(Embodiments of the present disclosure disclose methods and apparatus for processing audio. One embodiment of the method comprises: generating a pitch of each audio frame in a sequence of audio frames corresponding to the first audio; according to the pitch, selecting an audio frame from the audio frame sequence as an audio frame to be adjusted to obtain an audio frame sequence to be adjusted; adjusting the pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of the audio frames to be adjusted and a preset threshold; and generating second audio based on the adjusted audio frame and the unadjusted audio frame in the audio frame sequence. The embodiment of the disclosure adjusts the original audio data to generate a batch of new audio data, and trains the vocoder by using the new audio data, so that the trained vocoder has better performance when processing the audio data.)

1. A method for processing audio, comprising:

generating a pitch of each audio frame in a sequence of audio frames corresponding to the first audio;

according to the pitch, selecting an audio frame from the audio frame sequence as an audio frame to be adjusted to obtain an audio frame sequence to be adjusted;

adjusting the pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of audio frames to be adjusted and a preset threshold;

generating a second audio based on the adjusted audio frame and an unadjusted audio frame of the sequence of audio frames.

2. The method of claim 1, wherein the generating a pitch of each audio frame in a sequence of audio frames to which the first audio corresponds comprises:

inputting the audio frame into a pre-trained pitch period extraction model to obtain a pitch period of the audio frame;

and generating the pitch of the audio frame according to the pitch period of the audio frame.

3. The method of claim 1, wherein the preset threshold comprises:

a first preset sub-threshold and a second preset sub-threshold; and

adjusting the pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of audio frames to be adjusted and a preset threshold, comprising:

in response to determining that the pitch of the audio frame to be adjusted is higher than the first preset sub-threshold, increasing the pitch of the audio frame to be adjusted;

in response to determining that the pitch of the audio frame to be adjusted is below the second preset sub-threshold, turning down the pitch of the audio frame to be adjusted.

4. The method of claim 1, wherein the generating second audio based on the adjusted audio frame and an unadjusted audio frame of the sequence of audio frames comprises:

and splicing the adjusted audio frame with an unadjusted audio frame in the audio frame sequence based on a waveform similar overlap addition algorithm wsola to generate the second audio.

5. The method according to one of claims 1-4, wherein the method further comprises:

training a second vocoder based on the first audio and the second audio.

6. The method of claim 5, wherein the training a second vocoder based on the first audio and the second audio comprises:

extracting acoustic features of the first audio to obtain first acoustic features;

generating a first vocoder based on the first acoustic feature and the first audio;

extracting the acoustic features of the second audio to obtain second acoustic features;

generating the second vocoder based on the second acoustic feature, the second audio, and the first vocoder.

7. The method of claim 6, wherein the generating a first vocoder based on the first acoustic feature and the first audio comprises:

inputting the first acoustic feature into an initial vocoder to obtain a first output result;

analyzing the first output result and the first audio to determine a first loss value;

and adjusting the parameters of the initial vocoder based on the first loss value until a first preset condition is met to obtain the first vocoder.

8. The method of claim 6, wherein the generating the second vocoder based on the second acoustic feature, the second audio, and the first vocoder comprises:

inputting the second acoustic feature into the first vocoder to obtain a second output result;

analyzing the second output result and the second audio to determine a second loss value;

and adjusting the parameters of the first vocoder based on the second loss value until a second preset condition is met to obtain the second vocoder.

9. An apparatus for processing audio, comprising:

a first generating unit configured to generate a pitch of each audio frame in a sequence of audio frames corresponding to a first audio;

the selection unit is configured to select an audio frame from the audio frame sequence as an audio frame to be adjusted according to the pitch, so as to obtain an audio frame sequence to be adjusted;

an adjusting unit configured to adjust a pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of audio frames to be adjusted and a preset threshold;

a second generating unit configured to generate a second audio based on the adjusted audio frame and an unadjusted audio frame of the sequence of audio frames.

10. An electronic device, comprising:

one or more processors;

storage means for storing one or more programs;

the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-8.

11. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-8.

Technical Field

Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method, an apparatus, an electronic device, and a computer-readable medium for processing audio.

Background

Vocoders can be used to achieve electronic human voice effects, and the use of vocoders to synthesize songs has become a field of fire comparison. Since the vocoder is data driven, various types of audio data are often required to train the vocoder when training the vocoder in order for the vocoder to perform better.

Disclosure of Invention

This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

Some embodiments of the present disclosure propose methods, apparatuses, devices and computer readable media for processing audio to solve the technical problems mentioned in the background section above.

In a first aspect, an embodiment of the present disclosure provides a method for processing audio, the method including: generating a pitch of each audio frame in a sequence of audio frames corresponding to the first audio; according to the pitch, selecting an audio frame from the audio frame sequence as an audio frame to be adjusted to obtain an audio frame sequence to be adjusted; adjusting the pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of the audio frames to be adjusted and a preset threshold; and generating second audio based on the adjusted audio frame and the unadjusted audio frame in the audio frame sequence.

In a second aspect, an embodiment of the present disclosure provides an apparatus for processing audio, the apparatus including: a first generating unit configured to generate a pitch of each audio frame in a sequence of audio frames corresponding to a first audio; the selection unit is configured to select an audio frame from the audio frame sequence as an audio frame to be adjusted according to the pitch to obtain an audio frame sequence to be adjusted; the adjusting unit is configured to adjust the pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of the audio frames to be adjusted and a preset threshold value; and the second generating unit is configured to generate second audio based on the adjusted audio frame and the unadjusted audio frame in the audio frame sequence.

In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement a method as in any one of the first aspects.

In a fourth aspect, some embodiments of the disclosure provide a computer readable medium having a computer program stored thereon, wherein the program when executed by a processor implements a method as in any one of the first aspect.

At least one of the above embodiments of the present disclosure has the following beneficial effects: first, by generating the pitch of each audio frame in the audio frame sequence corresponding to the first audio, a specific distribution range of the pitch of each audio frame in the audio frame sequence can be obtained. Then, according to the pitch, an audio frame can be selected from the audio frame sequence as an audio frame to be adjusted, so as to obtain an audio frame sequence to be adjusted. Then, the pitch of the audio frame to be adjusted is adjusted based on the pitch of each audio frame to be adjusted in the sequence of the audio frames to be adjusted and a preset threshold. Here, the audio frames in the sequence of audio frames may be adjusted in a targeted manner. And finally, generating a second audio based on the adjusted audio frame and the unadjusted audio frame in the audio frame sequence. The embodiment of the disclosure generates a batch of new audio data by adjusting the original audio data. Compared with the original audio data, the new audio data adjusts partial pitches in the original audio data. The new audio data is used to train the vocoder so that the trained vocoder performs better when processing different audio data.

Drawings

The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.

FIG. 1 is a schematic diagram of one application scenario of a method for processing audio according to some embodiments of the present disclosure;

FIG. 2 is a flow diagram of one embodiment of a method for processing audio, according to an embodiment of the present disclosure;

FIG. 3 is a flow diagram of still further embodiments of methods for processing audio according to the present disclosure;

FIG. 4 is a schematic block diagram of some embodiments of an apparatus for processing audio according to the present disclosure;

FIG. 5 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.

Detailed Description

Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.

It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.

It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.

It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.

The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.

The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.

Fig. 1 is a schematic diagram 100 of one application scenario of a method for processing audio according to some embodiments of the present disclosure.

As shown in fig. 1, as an example, the electronic device 101 may first obtain a pitch of each audio frame in a sequence of audio frames corresponding to the first audio 102. E.g., pitches of frame 1 through frame 10. Based on the pitch, a portion of the audio frames from the audio frame sequence 102 may be selected as audio frames to be adjusted, thereby obtaining an audio frame sequence 103 to be adjusted (e.g., 4 th frame, 5 th frame, and 6 th frame). Then, based on the pitch of each audio frame to be adjusted in the sequence to be adjusted 103 and a preset threshold, the pitch of the audio frame in the sequence to be adjusted 103 may be adjusted, so as to generate an adjusted audio frame sequence 104. Finally, a second audio may be generated based on the adjusted sequence of audio frames 104 and the unadjusted sequence of audio frames 105 (e.g., frame 1, frame 2, frame 3, frame 7, frame 8, frame 9, and frame 10) of the sequence of audio frames 102. Referring to fig. 1, the second audio corresponds to a sequence of audio frames 106.

It is to be understood that the method of generating audio for processing may be performed by the electronic device 101 described above. The electronic device 101 may be hardware or software. When the electronic device 101 is hardware, it may be various electronic devices with information processing capabilities, including but not limited to smartphones, tablets, e-book readers, laptop portable computers, desktop computers, servers, and the like. When the electronic device 101 is software, it can be installed in the electronic devices listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.

It should be understood that the number of electronic devices in fig. 1 is merely illustrative. There may be any number of electronic devices, as desired for implementation.

With continued reference to fig. 2, a flow 200 of one embodiment of a method for processing audio in accordance with the present disclosure is shown. The method for processing audio comprises the following steps:

step 201, generating a pitch of each audio frame in the sequence of audio frames corresponding to the first audio.

In some embodiments, an executing subject of a method for processing audio (e.g., electronic device 101 shown in fig. 1) may use various methods to generate a pitch for each audio frame in a sequence of audio frames to which the first audio corresponds. For example, a pitch period extraction method may be used to extract the pitch period for each audio frame in the sequence of audio frames corresponding to the first audio. The pitch period of each audio frame in the sequence of audio frames corresponding to the first audio may be obtained, or the pitch frequency of each audio frame in the sequence of audio frames corresponding to the first audio may be obtained. Wherein the pitch period of the audio frame may be used to characterize the pitch of the audio frame. Here, the pitch period extraction method may include, but is not limited to, at least one of: pitch period detection based on autocorrelation, a short-time autocorrelation function method, a cepstrum method, an average amplitude difference method and a data reduction method.

In some optional implementation manners of some embodiments, the executing body may further input the audio frame into a pre-trained pitch period extraction model to obtain a pitch period of the audio frame. Then, the pitch of the audio frame is obtained according to the pitch period of the audio frame. Here, the pitch period extraction model may be a convolutional neural network. Wherein the convolutional neural network may comprise a plurality of convolutional layers. Here, the convolutional neural network may be one of: residual network, VGG model and google lenet.

Step 202, selecting an audio frame from the audio frame sequence as an audio frame to be adjusted according to the pitch, so as to obtain an audio frame sequence to be adjusted.

In some embodiments, the execution subject may find out the audio frame with the pitch meeting the predetermined condition from the audio frame sequence as the audio frame to be adjusted according to the pitch obtained in step 201. These audio frames to be adjusted in turn constitute a sequence of audio frames to be adjusted. Here, the predetermined condition may be one of: the pitch of the audio frame is higher than a first preset threshold; the pitch of the audio frame is below a second preset threshold. The audio frame included in the audio frame sequence to be adjusted may be several consecutive frames in the audio frame sequence.

Step 203, adjusting the pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of audio frames to be adjusted and a preset threshold.

In some embodiments, the execution subject may obtain the sequence of audio frames to be adjusted from step 202. The pitch frequency of the audio frames in the sequence of audio frames to be adjusted may then be adjusted based on the preset threshold. Namely, the pitch of the audio frame to be adjusted is adjusted. Here, the preset threshold may be plural.

As an example, it is assumed here that there are three preset thresholds, which are a first preset threshold, a second preset threshold and a third preset threshold, respectively. Here, the first preset threshold is greater than the second preset threshold, and the second preset threshold is greater than the third preset threshold. And when the difference value between the pitch frequency corresponding to the pitch of the audio frames in the audio frame sequence to be adjusted and the first preset threshold is larger than a third preset threshold, increasing the pitch frequency corresponding to the pitch of the audio frames in the audio frame sequence. And when the difference value between the pitch frequency corresponding to the pitch of the audio frames in the audio frame sequence to be adjusted and the second preset threshold value is greater than a third preset threshold value, the pitch frequency corresponding to the pitch of the audio frames in the audio frame sequence is reduced.

In some optional implementations of some embodiments, the preset threshold may include: a first preset sub-threshold and a second preset sub-threshold. Here, the executing body may increase the pitch frequency of the audio frame to be adjusted in response to determining that the pitch of the audio frame to be adjusted is higher than the first preset sub-threshold. I.e. the pitch of the audio frame to be adjusted is increased. The executing subject responds to the determination that the pitch of the audio frame to be adjusted is lower than the pitch

And the second preset sub-threshold can reduce the pitch frequency of the audio frame to be adjusted. I.e. the pitch of the audio frame to be adjusted is adjusted down. Here, the high pitch or the low pitch which cannot be sung by the singer in the audio may be adjusted.

Step 204, generating a second audio based on the adjusted audio frame and the unadjusted audio frame in the audio frame sequence.

In some embodiments, the execution subject may generate the second audio by splicing the adjusted audio frame with an unadjusted audio frame in the sequence of audio frames using various splicing methods (e.g., OLA (Overlap-and-Add)).

Here, the second audio may be generated by adjusting audio frames with insufficient pitch in the sequence of audio frames corresponding to the first audio. For example, if the pitch frequency corresponding to the pitch of the audio frame a in the first audio is 0, the pitch frequency corresponding to the pitch of the audio frame a may be assigned by referring to the pitch frequencies corresponding to the pitches of several frames around the audio frame a, so as to adjust the pitch of the audio frame a.

In some optional implementations of some embodiments, the execution body may further use wsola (Waveform Similarity Overlap Add algorithm) to splice the adjusted audio frame with an unadjusted audio frame in the audio frame sequence to generate the second audio. The effect brought by the implementation mode is that the audio quality of the spliced second audio is improved by the waveform similarity overlap and add algorithm.

One of the above-described various embodiments of the present disclosure has the following advantageous effects: first, by generating the pitch of each audio frame in the audio frame sequence corresponding to the first audio, a specific distribution range of the pitch of each audio frame in the audio frame sequence can be obtained. Then, according to the pitch, an audio frame can be selected from the audio frame sequence as an audio frame to be adjusted, so as to obtain an audio frame sequence to be adjusted. Then, the pitch of the audio frame to be adjusted is adjusted based on the pitch of each audio frame to be adjusted in the sequence of the audio frames to be adjusted and a preset threshold. Here, the audio frames in the sequence of audio frames may be adjusted in a targeted manner. And finally, generating a second audio based on the adjusted audio frame and the unadjusted audio frame in the audio frame sequence. The embodiment of the disclosure generates a batch of new audio data by adjusting the original audio data. Compared with the original audio data, the new audio data adjusts partial pitches in the original audio data. The new audio data is used to train the vocoder so that the trained vocoder performs better when processing different audio data.

With continued reference to fig. 3, a flow 300 of some embodiments of a method for processing audio according to the present disclosure is shown. The method for processing audio comprises the following steps:

step 301, generating a pitch of each audio frame in the sequence of audio frames corresponding to the first audio.

Step 302, according to the pitch, selecting an audio frame from the audio frame sequence as an audio frame to be adjusted, so as to obtain an audio frame sequence to be adjusted.

Step 303, adjusting the pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of audio frames to be adjusted and a preset threshold.

Step 304, generating a second audio based on the adjusted audio frame and the unadjusted audio frame in the sequence of audio frames.

Here, the specific implementation and technical effects of the steps 301 and 304 can refer to the steps 201 and 204 in the embodiments corresponding to fig. 2, and are not described herein again.

Based on the first audio and the second audio, a second vocoder is trained, step 305.

In some embodiments, the execution subject may further train the second vocoder by using the first audio and the second audio as training data in various ways.

In some optional implementations of some embodiments, the executing body may further extract an acoustic feature of the first audio to obtain the first acoustic feature. Here, the initial vocoder may be trained using the extracted first acoustic feature and the first audio as training data, thereby obtaining the first vocoder. Wherein the initial vocoder may be a WaveRNN. Here, the method of parameter initialization in the initial vocoder may be one of the following: he initialization, random initialization, and Pre-train initialization.

Here, the acoustic features of the second audio may also be continuously extracted to obtain a second acoustic feature. The second acoustic feature and the second audio may be used as training data, and the training of the first vocoder may be continued using the training data to obtain a second vocoder. Here, the above acoustic features may include, but are not limited to, at least one of: mel frequency domain cepstrum coefficient, spectrum envelope, and fundamental frequency.

Optionally, the executing entity may input the first acoustic feature into an initial vocoder, and obtain the first output result through the initial vocoder. Then, the first output result and the first audio are analyzed to determine a first loss value. Based on the first penalty value, some optimization algorithm (e.g., gradient descent) is used to adjust the initial vocoder parameters until a first predetermined condition is met. Here, the first predetermined condition may be that the adjusted parameter of the initial vocoder meets a preset threshold, or may be that the above steps are cycled for a predetermined number of times (e.g., 500 times). Finally, the first vocoder is obtained.

Optionally, the executing body may input a second acoustic characteristic into the first vocoder, and obtain a second output result through the first vocoder. And then, analyzing the second output result and the second audio to determine a second loss value. Based on the second penalty value, some optimization algorithm (e.g., gradient descent) is used to adjust the parameters of the first vocoder. Until a second predetermined condition is met, where the second predetermined condition may be that the adjusted parameter of the first vocoder meets the preset threshold, or that the above steps are cycled through a predetermined number of times (e.g., 500 times). Finally, the second vocoder is obtained.

It is emphasized that the adjustment may be a fine tuning of the parameters in the first vocoder, and the second vocoder is obtained based on the first vocoder. The purpose of the fine tuning is to make the second vocoder perform better in the face of different singing data. Since the first vocoder is data driven. The newly generated batch of audio data is used to train the first vocoder to obtain the second vocoder, so that the second vocoder is more robust.

As can be seen from fig. 3, the flow 300 of the method for processing audio in some embodiments corresponding to fig. 3 highlights that the first audio and the second audio can be used as training data to train the second vocoder, compared to the description of some embodiments corresponding to fig. 2. The second audio can be regarded as the audio obtained by amplifying the first audio, and the use of the second audio to train the first vocoder can enable the prediction of the trained vocoder to be more accurate and the robustness to be better.

With further reference to fig. 4, as an implementation of the above-described methods for the above-described figures, the present disclosure provides some embodiments of an apparatus for processing audio, which correspond to those of the method embodiments described above for fig. 2, and which may be particularly applicable in various electronic devices.

As shown in fig. 4, an apparatus 400 for processing audio of some embodiments includes: a first generation unit 401, a selection unit 402, an adjustment unit 403, and a second generation unit 404. The first generating unit 401 is configured to generate a pitch of each audio frame in a sequence of audio frames corresponding to the first audio. A selecting unit 402, configured to select an audio frame from the audio frame sequence as an audio frame to be adjusted according to the pitch, so as to obtain an audio frame sequence to be adjusted. An adjusting unit 403, configured to adjust the pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of audio frames to be adjusted and a preset threshold. A second generating unit 404 configured to generate a second audio based on the adjusted audio frame and an unadjusted audio frame in the sequence of audio frames.

In some optional implementations of some embodiments, the first generating unit 401 may be further configured to: inputting the audio frame into a pre-trained pitch period extraction model to obtain the pitch period of the audio frame; and generating the pitch of the audio frame according to the pitch period of the audio frame.

In some optional implementations of some embodiments, the preset threshold includes: a first preset sub-threshold and a second preset sub-threshold. And the adjusting unit 403 may be further configured to: in response to determining that the pitch of the audio frame to be adjusted is higher than the first preset sub-threshold, increasing the pitch of the audio frame to be adjusted; and in response to determining that the pitch of the audio frame to be adjusted is lower than the second preset sub-threshold, reducing the pitch of the audio frame to be adjusted.

In some optional implementations of some embodiments, the second generating unit 404 may be further configured to: and splicing the adjusted audio frame with an unadjusted audio frame in the audio frame sequence based on a waveform similar overlap addition algorithm to generate the second audio.

In some optional implementations of some embodiments, the apparatus 400 for audio processing may further include a training unit. Wherein the training unit may be configured to: and training to obtain a second vocoder based on the first audio and the second audio.

In some optional implementations of some embodiments, the training unit may be further configured to: extracting the acoustic features of the first audio to obtain first acoustic features; generating a first vocoder based on said first acoustic feature and said first audio; extracting the acoustic features of the second audio to obtain second acoustic features; generating the second vocoder based on the second acoustic feature, the second audio, and the first vocoder.

In some optional implementations of some embodiments, the training unit may be further configured to: inputting the first acoustic feature into an initial vocoder to obtain a first output result; analyzing the first output result and the first audio to determine a first loss value; and adjusting the parameters of the initial vocoder based on the first loss value until a first preset condition is met to obtain the first vocoder.

In some optional implementations of some embodiments, the training unit may be further configured to: inputting the second acoustic feature into the first vocoder to obtain a second output result; analyzing the second output result and the second audio to determine a second loss value; and adjusting the parameters of the first vocoder based on the second loss value until a second preset condition is met to obtain the second vocoder.

It will be understood that the elements described in the apparatus 400 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 400 and the units included therein, and will not be described herein again.

Referring now to fig. 5, a schematic diagram of an electronic device (e.g., the electronic device of fig. 1) 500 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.

As shown in fig. 5, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.

Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 5 may represent one device or may represent multiple devices as desired.

In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program, when executed by the processing device 501, performs the above-described functions defined in the methods of some embodiments of the present disclosure.

It should be noted that the computer readable medium described above in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.

In some embodiments, the clients, 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 communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.

The computer readable medium may be embodied in the apparatus; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: generating a pitch of each audio frame in a sequence of audio frames corresponding to the first audio; according to the pitch, selecting an audio frame from the audio frame sequence as an audio frame to be adjusted to obtain an audio frame sequence to be adjusted; adjusting the pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of the audio frames to be adjusted and a preset threshold; and generating second audio based on the adjusted audio frame and the unadjusted audio frame in the audio frame sequence.

Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).

The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a first generating unit, a selecting unit, an adjusting unit, and a second generating unit. Where the names of the cells do not in some cases constitute a limitation of the cell itself, for example, the first generation cell may also be described as a "cell that generates the pitch of each audio frame in the sequence of audio frames to which the first audio corresponds".

The functions described herein above 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 a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.

In accordance with one or more embodiments of the present disclosure, there is provided a method for processing audio, including: generating a pitch of each audio frame in a sequence of audio frames corresponding to the first audio; according to the pitch, selecting an audio frame from the audio frame sequence as an audio frame to be adjusted to obtain an audio frame sequence to be adjusted; adjusting the pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of the audio frames to be adjusted and a preset threshold; and generating second audio based on the adjusted audio frame and the unadjusted audio frame in the audio frame sequence.

According to one or more embodiments of the present disclosure, the generating a pitch of each audio frame in the sequence of audio frames corresponding to the first audio includes: inputting the audio frame into a pre-trained pitch period extraction model to obtain the pitch period of the audio frame; and generating the pitch of the audio frame according to the pitch period of the audio frame.

According to one or more embodiments of the present disclosure, the preset threshold includes: a first preset sub-threshold and a second preset sub-threshold; and the adjusting the pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of audio frames to be adjusted and a preset threshold includes: in response to determining that the pitch of the audio frame to be adjusted is higher than the first preset sub-threshold, increasing the pitch of the audio frame to be adjusted; and in response to determining that the pitch of the audio frame to be adjusted is lower than the second preset sub-threshold, reducing the pitch of the audio frame to be adjusted.

According to one or more embodiments of the present disclosure, the generating the second audio based on the adjusted audio frame and the unadjusted audio frame in the sequence of audio frames includes: and based on a waveform similar overlap addition algorithm wsola, splicing the adjusted audio frame with an unadjusted audio frame in the audio frame sequence to generate the second audio.

According to one or more embodiments of the present disclosure, the method further includes: and training to obtain a second vocoder based on the first audio and the second audio.

According to one or more embodiments of the present disclosure, the training of the second vocoder based on the first audio and the second audio includes: extracting the acoustic features of the first audio to obtain first acoustic features; generating a first vocoder based on said first acoustic feature and said first audio; extracting the acoustic features of the second audio to obtain second acoustic features; generating the second vocoder based on the second acoustic feature, the second audio, and the first vocoder.

According to one or more embodiments of the present disclosure, the generating a first vocoder based on the first acoustic feature and the first audio includes: inputting the first acoustic feature into an initial vocoder to obtain a first output result; analyzing the first output result and the first audio to determine a first loss value; and adjusting the parameters of the initial vocoder based on the first loss value until a first preset condition is met to obtain the first vocoder.

According to one or more embodiments of the present disclosure, the generating the second vocoder based on the second acoustic feature, the second audio, and the first vocoder includes: inputting the second acoustic feature into the first vocoder to obtain a second output result; analyzing the second output result and the second audio to determine a second loss value; and adjusting the parameters of the first vocoder based on the second loss value until a second preset condition is met to obtain the second vocoder.

In accordance with one or more embodiments of the present disclosure, there is provided an apparatus for processing audio, including: a first generating unit configured to generate a pitch of each audio frame in a sequence of audio frames corresponding to a first audio; the selection unit is configured to select an audio frame from the audio frame sequence as an audio frame to be adjusted according to the pitch to obtain an audio frame sequence to be adjusted; the adjusting unit is configured to adjust the pitch of the audio frame to be adjusted based on the pitch of each audio frame to be adjusted in the sequence of the audio frames to be adjusted and a preset threshold value; and the second generating unit is configured to generate second audio based on the adjusted audio frame and the unadjusted audio frame in the audio frame sequence.

According to one or more embodiments of the present disclosure, the first generating unit may be further configured to: inputting the audio frame into a pre-trained pitch period extraction model to obtain the pitch period of the audio frame; and generating the pitch of the audio frame according to the pitch period of the audio frame.

According to one or more embodiments of the present disclosure, the preset threshold includes: a first preset sub-threshold and a second preset sub-threshold. And the adjustment unit may be further configured to: in response to determining that the pitch of the audio frame to be adjusted is higher than the first preset sub-threshold, increasing the pitch of the audio frame to be adjusted; and in response to determining that the pitch of the audio frame to be adjusted is lower than the second preset sub-threshold, reducing the pitch of the audio frame to be adjusted.

According to one or more embodiments of the present disclosure, the second generating unit may be further configured to: and splicing the adjusted audio frame with an unadjusted audio frame in the audio frame sequence based on a waveform similar overlap addition algorithm to generate the second audio.

According to one or more embodiments of the present disclosure, an apparatus for audio processing may further include a training unit. Wherein the training unit may be configured to: and training to obtain a second vocoder based on the first audio and the second audio.

According to one or more embodiments of the present disclosure, the training unit may be further configured to: extracting the acoustic features of the first audio to obtain first acoustic features; generating a first vocoder based on said first acoustic feature and said first audio; extracting the acoustic features of the second audio to obtain second acoustic features; generating the second vocoder based on the second acoustic feature, the second audio, and the first vocoder.

According to one or more embodiments of the present disclosure, the training unit may be further configured to: inputting the first acoustic feature into an initial vocoder to obtain a first output result; analyzing the first output result and the first audio to determine a first loss value; and adjusting the parameters of the initial vocoder based on the first loss value until a first preset condition is met to obtain the first vocoder.

According to one or more embodiments of the present disclosure, the training unit may be further configured to: inputting the second acoustic feature into the first vocoder to obtain a second output result; analyzing the second output result and the second audio to determine a second loss value; and adjusting the parameters of the first vocoder based on the second loss value until a second preset condition is met to obtain the second vocoder.

According to one or more embodiments of the present disclosure, there is provided an electronic device including: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement a method as described in any of the embodiments above.

According to one or more embodiments of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements the method as described in any of the embodiments above.

The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种语音信号增强方法和装置以及设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!