项目作者: deano2390

项目描述 :
Pre-built stable WebRTC library for Android
高级语言:
项目地址: git://github.com/deano2390/libwebrtc-android.git
创建时间: 2017-06-13T16:59:36Z
项目社区:https://github.com/deano2390/libwebrtc-android

开源协议:

下载


libwebrtc-android

Prebuilt WebRTC library for Android, available via gradle.

Built against the ‘stable’ release branches used in Chrome for Android (currently M59).

I will endevour to add the latest stable releases as and when they are released. (Release Schedule: https://www.chromium.org/developers/calendar)

Usage is demonstrated in the AppRTC sample app which I have mirrored and setup to use this library:
https://github.com/deano2390/AppRTC

Gradle

Add the jitpack repo to your your project’s build.gradle at the end of repositories

/build.gradle

  1. allprojects {
  2. repositories {
  3. jcenter()
  4. maven { url "https://jitpack.io" }
  5. }
  6. }

Then add the dependency to your module’s build.gradle:

/app/build.gradle

  1. dependencies {
  2. compile 'com.github.deano2390:libwebrtc-android:59-vanilla'
  3. }

Noise Suppressor

I needed access to the Software Noise Suppressor in WebRTC in my Java code so I wrote a small JNI wrapper to expose it. You can access this using the alternative branch release:

  1. dependencies {
  2. compile 'com.github.deano2390:libwebrtc-android:59-NS'
  3. }

Example usage:

  1. import org.webrtc.NoiseSuppressor;
  2. // setup
  3. int samplingRate = 16000; // 16Khz
  4. int mode = 2; // (0 = mild, 1 = medium, 2 = aggressive)
  5. NoiseSuppressor noiseSuppressor = new NoiseSuppressor(samplingRate, mode);
  6. // usage - inBuffer contains your frasmes of audio sample
  7. // the WebRTC noise suppressor uses a strict frame size of 160 samples
  8. short[] inBuffer = new short[160]; // copy input samples into here
  9. short[] outBuffer = new short[160]; // your de-noised audio frame will appear in outBuffer
  10. noiseSuppressor.processAudioFrame(inBuffer, outBuffer, (short) inBuffer.length);
  11. // teardown
  12. softNoiseSuppressor.close();

License

  1. Copyright (c) 2011, The WebRTC project authors. All rights reserved.
  2. Redistribution and use in source and binary forms, with or without
  3. modification, are permitted provided that the following conditions are
  4. met:
  5. * Redistributions of source code must retain the above copyright
  6. notice, this list of conditions and the following disclaimer.
  7. * Redistributions in binary form must reproduce the above copyright
  8. notice, this list of conditions and the following disclaimer in
  9. the documentation and/or other materials provided with the
  10. distribution.
  11. * Neither the name of Google nor the names of its contributors may
  12. be used to endorse or promote products derived from this software
  13. without specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  16. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  18. HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  19. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  20. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  21. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  22. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  24. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.