如何使用低延迟的Android音频

如何使用低延迟的Android音频

本文介绍了如何使用低延迟的Android音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

您可能已经听说过,Android不提供低延迟音频API.低延迟音频的意思是,您应该能够从麦克风获取音频信号并播放声音,而两者之间没有太多时间间隔(例如5-7毫秒)

As you might have heard, Android does not provide with low latency audio API. What I mean by low latency audio is that you should be able to get audio signals from microphone and play the sound without much time gap in-between (e.g., 5-7 ms)

我尝试使用旧的Java(带有AudioRecord和AudioTrack)和新的" OpenSL ES.它们很糟糕,使应用程序无法使用.此问题在此处已得到详细记录.顺便说一句,iOS API可以产生大约5-7毫秒的延迟.

I've tried old java (with AudioRecord and AudioTrack) and "new" OpenSL ES. They are terrible and make app unusable.The issue was well documented here. BTW, iOS API can produce about 5-7 ms latency.

寻找解决方法:

但是我还是想做低延迟的音频. 类似此答案的内容.

But I am trying to do the low latency audio anyway. Something like this answer describes.

这对Android有意义吗? 答案令人沮丧.

Does this make sense for Android? An answer is discouraging.

所以我的问题.真的无法通过Android实现10毫秒的音频延迟吗?

So my question. Is there really no way to achieve 10 ms audio latency with Android?

说实话,我不希望很快找到解决方案,而只是希望一个伟大的头脑能回答这个问题.

To be honest, I am not expecting a solution in some time soon but just wish one great mind have answer to this problem.

推荐答案

android 4.1+具有低延迟音频api,应该为您提供低于10ms的延迟.但是其价值因硬件而异(欢迎使用丰富多样的android系统).

android 4.1+ has low latency audio api which should give you below 10ms latency. however the value varies by hardware (welcome to rich diverse world of android).

"android.hardware.audio.low_latency"功能描述符也可用于过滤出缺少低延迟支持的设备.

also feature descriptor of "android.hardware.audio.low_latency" can be used for filter out devices lacking low latency support.

签出 http://www.youtube. com/watch?v = Yc8YrVc47TI& feature = player_de%20tailpage#t = 1366s

以及以下内容: http://createdigitalmusic.com/2012/07/android-high-performance-audio-in-4-1-and-what-it-means-plus-libpd-goodness-今天/

这篇关于如何使用低延迟的Android音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 00:48