Android - 如何请求语音呼叫流的音频焦点

时间:2014-03-23 22:20:44

标签: android audio streaming android-audiomanager

如何在Android中请求并获得语音呼叫流的音频焦点?当我为音乐流执行以下代码时,它工作正常,我获得了焦点但是对于STREAM_VOICE_CALL,框架不会授予它:

// this works
     AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);

         int result=  am.requestAudioFocus(null, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);


---------

//未授权:

      AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);

         int result=  am.requestAudioFocus(null, AudioManager.STREAM_VOICE_CALL, AudioManager.AUDIOFOCUS_GAIN);

有人确认操作系统是否可以访问果冻豆中的语音呼叫音频流?

0 个答案:

没有答案