Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xiongyihui/python-webrtc-audio-processing
Python bindings of WebRTC Audio Processing
https://github.com/xiongyihui/python-webrtc-audio-processing
agc ns python vad webrtc-audio-processing
Last synced: 6 days ago
JSON representation
Python bindings of WebRTC Audio Processing
- Host: GitHub
- URL: https://github.com/xiongyihui/python-webrtc-audio-processing
- Owner: xiongyihui
- Created: 2017-02-24T11:14:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-09T14:12:08.000Z (about 2 months ago)
- Last Synced: 2024-10-16T02:24:30.624Z (23 days ago)
- Topics: agc, ns, python, vad, webrtc-audio-processing
- Language: C++
- Homepage:
- Size: 1.08 MB
- Stars: 168
- Watchers: 8
- Forks: 51
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WebRTC Audio Processing for Python
[![Build Status](https://travis-ci.org/xiongyihui/python-webrtc-audio-processing.svg?branch=master)](https://travis-ci.org/xiongyihui/python-webrtc-audio-processing)
[![Pypi](https://img.shields.io/pypi/v/webrtc_audio_processing.svg)](https://pypi.python.org/pypi/webrtc_audio_processing)Python binding of WebRTC Audio Processing.
## Requirements
+ swig
+ compile toolchain
+ python## Build
There are two way to build the package.1. using setup.py
```bash
git clone https://github.com/xiongyihui/python-webrtc-audio-processing.git
cd python-webrtc-audio-processing
git submodule init && git submodule update
python setup.py build
sudo python setup.py install
```2. using Makefile
```bash
git clone https://github.com/xiongyihui/python-webrtc-audio-processing.git
cd python-webrtc-audio-processing
git submodule init && git submodule update
cd webrtc-audio-processing
./autogen.sh
./configure --with-pic
make
cd ../src
make
```## Usage
```python
from webrtc_audio_processing import AudioProcessingModule as APap = AP(enable_vad=True, enable_ns=True)
ap.set_stream_format(16000, 1) # set sample rate and channels
ap.set_ns_level(1) # NS level from 0 to 3
ap.set_vad_level(1) # VAD level from 0 to 3audio_10ms = '\0' * 160 * 2 # 10ms, 16000 sample rate, 16 bits, 1 channel
# only support processing 10ms audio data each time
audio_out = ap.process_stream(audio_10ms)
print('voice: {}'.format(ap.has_voice()))
```