Compile and use WEBRTC Audio noise Reduction Module (NS) separately

Source: Internet
Author: User

reproduced in the original: http://www.cnblogs.com/mod109/p/5469799.html thank you very much.

The WEBRTC audio processing module is divided into noise reduction ns, Echo cancellation AEC(Echo control Acem), Automatic control gain AGC, Mute detection section. In addition WEBRTC has encapsulated a set of audio processing module APM, if it is not a special need, if users want to use the echo cancellation and other more complex modules, it is best to use all the audio processing module, do not compile part of it separately to avoid wasting valuable time.

However, the audio noise reduction part is relatively simple, with a few functions, in addition to the incoming audio data, the parameters that need to be adjusted are audio sampling rate and noise reduction level . In addition, this part of the code is written in C language syntax and can be compiled across platforms. The entire algorithm is not particularly complex, running up to the CPU is not many, can be up to the I7 8-core CPU of the high-speed computer, down to 380Mhz of small embedded systems and all versions of mobile products compiled and run. In addition, the effect is very good, through the test demo included in this article you can feel a bit.

Noise reduction has two parts of the code, one set is the fixed-point algorithm (noise_suppression_x.h), a set of floating-point algorithm (noise_suppression.h). The floating-point algorithm is relatively more accurate, but consumes more system resources, especially on low-end arm CPUs with weak floating-point computing power. However, in general, floating point and fixed-point algorithm in the actual effect is not audible difference, it is estimated that I have not encountered the need to use floating point situation. In use, floating-point and fixed-point are just variable names and functions no more than an X.

Audio processing time WEBRTC can only process 10ms data, less than 10ms of data do not pass in, because the instant is the incoming data less than 10ms last incoming is also according to 10ms of data out, this time there will be problems. In addition, the support sampling rate is only 8k,16k,32k three, whether it is a noise reduction module, or echo cancellation gain, and so on. For 8000 sample rate, 16bit of audio data, 10ms time sampling point is 80, a sample point 16bit is two bytes, then the data required to pass in Webrtcnsx_process is 160 bytes. For the 8000 and 16000 sample rate of audio data can be used regardless of high-frequency portion, only need to pass in low-frequency data, but for the 32K sampling rate of data must be filtered through the interface data into high-frequency and low-frequency input, the incoming noise reduction and then combined into audio data. More than 32K audio files must be reduced by the resampling interface to the corresponding sampling rate of processing, in the demo source code inside the corresponding interface users can check.

Noise reduction of the open source code includes fixed-point noise reduction, floating-point noise reduction, audio resampling, filtering interface, keyed out after modifying the header file contains the location to make it all in the same directory, if it is xcode under the compiler may have once function compiled problem, at this time to modify a macro can, In order to avoid modifying the problem, do not change this part.

The sample code gives the 32K sample rate of the test demo, also has 8 K sample rate implementation. 16K sampling rate only need to change the size of the 8K internal data from 80 to 160, PCM audio files can be used by Audacity software through the file-import-raw data, select a good bit number, channel, sample rate can display waveforms, play.

SOURCE Download: Webrtcaudiotest.rar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.