Force 8 kHz sampling rate on Android emulator.
BUG=None R=henrika@webrtc.org Review URL: https://webrtc-codereview.appspot.com/55419004 Cr-Commit-Position: refs/heads/master@{#9310}
This commit is contained in:
@@ -179,6 +179,12 @@ class WebRtcAudioManager {
|
||||
|
||||
// Returns the native output sample rate for this device's output stream.
|
||||
private int getNativeOutputSampleRate() {
|
||||
// Override this if we're running on an old emulator image which only
|
||||
// supports 8 kHz and doesn't support PROPERTY_OUTPUT_SAMPLE_RATE.
|
||||
if (WebRtcAudioUtils.runningOnEmulator()) {
|
||||
Logd("Running on old emulator, overriding sampling rate to 8 kHz.");
|
||||
return 8000;
|
||||
}
|
||||
if (!WebRtcAudioUtils.runningOnJellyBeanMR1OrHigher()) {
|
||||
return SAMPLE_RATE_HZ;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,12 @@ public final class WebRtcAudioUtils {
|
||||
+ ", id=" + Thread.currentThread().getId() + "]";
|
||||
}
|
||||
|
||||
// Returns true if we're running on emulator.
|
||||
public static boolean runningOnEmulator() {
|
||||
return Build.HARDWARE.equals("goldfish") &&
|
||||
Build.BRAND.startsWith("generic_");
|
||||
}
|
||||
|
||||
// Returns true if the device is blacklisted for HW AEC usage.
|
||||
public static boolean deviceIsBlacklistedForHwAecUsage() {
|
||||
List<String> blackListedModels = Arrays.asList(BLACKLISTED_AEC_MODELS);
|
||||
|
||||
Reference in New Issue
Block a user