考虑驱动程序的延迟。有隐藏的函数AudioManager.getOutputLatency(int)来获得此功能。
这样称呼它:
AudioManager am = (AudioManager)getSystemService(Context.AUDIO_SERVICE);try{ Method m = am.getClass().getMethod("getOutputLatency", int.class); latency = (Integer)m.invoke(am, AudioManager.STREAM_MUSIC);}catch(Exception e){}在不同的设备上,我大约需要45-50 ms。在计算中使用结果。



