当我在 Pixel 2(Oreo 8.0)上构建应用程序时,我得到PerformanceMode::LowLatency:
2019-06-30 15:04:15.560 8506-8506/? D/AUDIO-APP: HearSightEngine - Stream PlayStream IS low latency
2019-06-30 15:04:15.572 8506-8506/? D/AUDIO-APP: HearSightEngine - Stream Recording IS low latency
当我在三星S7(牛轧糖7.0)应用程序上构建我的应用程序时,我听不到:
2019-06-30 14:49:30.874 20025-20025/? W/AUDIO-APP: HearSightEngine - Stream PlayStream is NOT low latency. Check your requested format, sample rate and channel count
2019-06-30 14:49:30.896 20025-20025/? W/AUDIO-APP: HearSightEngine - Stream Recording is NOT low latency. Check your requested format, sample rate and channel count
两个重大区别是
第一种情况使用
第二。
OpenSL ES是否支持PerformanceMode::LowLatency?还是三星S7不支持它?或者是其他东西?我阅读了常见问题解答[1],并提到了API的<26的AudioAttributes.FLAG_LOW_LATENCY,这样对我有帮助吗?
[1] https://github.com/google/oboe/blob/master/docs/FAQ.md
最佳答案
仅从牛轧糖7.1起。在Android的早期版本中,性能模式将返回PerformanceMode::None
。 Here's the code。
没有编程方式可以知道您在Android 7.0及更低版本上是否具有低延迟流。您可以使用adb shell dumpsys media.audio_flinger
手动验证它,并在应用程序流旁边查找F
(用于FAST跟踪)。
通过遵循guidance here,可以最大限度地提高接收低延迟流的机会。
关于android - OpenSL ES是否支持PerformanceMode::LowLatency?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56828501/