OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 package org.webrtc.voiceengine; | 11 package org.webrtc.voiceengine; |
12 | 12 |
13 import java.lang.Thread; | 13 import java.lang.Thread; |
14 import java.nio.ByteBuffer; | 14 import java.nio.ByteBuffer; |
15 | 15 |
16 import android.content.Context; | 16 import android.content.Context; |
17 import android.media.AudioFormat; | 17 import android.media.AudioFormat; |
18 import android.media.AudioManager; | 18 import android.media.AudioManager; |
19 import android.media.AudioTrack; | 19 import android.media.AudioTrack; |
20 import android.os.Process; | 20 import android.os.Process; |
21 | 21 |
22 import org.webrtc.Logging; | 22 import org.webrtc.Logging; |
23 | 23 |
24 class WebRtcAudioTrack { | 24 class WebRtcAudioTrack { |
25 private static final boolean DEBUG = true; | 25 private static final boolean DEBUG = false; |
26 | 26 |
27 private static final String TAG = "WebRtcAudioTrack"; | 27 private static final String TAG = "WebRtcAudioTrack"; |
28 | 28 |
29 // Default audio data format is PCM 16 bit per sample. | 29 // Default audio data format is PCM 16 bit per sample. |
30 // Guaranteed to be supported by all devices. | 30 // Guaranteed to be supported by all devices. |
31 private static final int BITS_PER_SAMPLE = 16; | 31 private static final int BITS_PER_SAMPLE = 16; |
32 | 32 |
33 // Requested size of each recorded buffer provided to the client. | 33 // Requested size of each recorded buffer provided to the client. |
34 private static final int CALLBACK_BUFFER_SIZE_MS = 10; | 34 private static final int CALLBACK_BUFFER_SIZE_MS = 10; |
35 | 35 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 if (!condition) { | 246 if (!condition) { |
247 throw new AssertionError("Expected condition to be true"); | 247 throw new AssertionError("Expected condition to be true"); |
248 } | 248 } |
249 } | 249 } |
250 | 250 |
251 private native void nativeCacheDirectBufferAddress( | 251 private native void nativeCacheDirectBufferAddress( |
252 ByteBuffer byteBuffer, long nativeAudioRecord); | 252 ByteBuffer byteBuffer, long nativeAudioRecord); |
253 | 253 |
254 private native void nativeGetPlayoutData(int bytes, long nativeAudioRecord); | 254 private native void nativeGetPlayoutData(int bytes, long nativeAudioRecord); |
255 } | 255 } |
OLD | NEW |