I have an application that can play sound through a mono (SCO) headset, as well as a BT stereo headset. When playing through the SCO, I use m_player.setAudioStreamTypeAudioManager.STREAM_VOICE_CALL);, and for the stereo, I use: m_player.setAudioStreamType(AudioManager.STREAM_MUSIC);. When using mono, I simply set the speech stream as a solo using: am.setStreamSolo(AudioManager.STREAM_VOICE_CALL, true);and this disables all other streams. So if there was music in the background, this does not interfere with my application. However, since the BT stereo uses a music stream, I cannot do the same, and the music continues to play simultaneously with the audio from my application.
What can I do to pause the default music app while playing my audio? I know that FroYo (2.2) and above can use requestAudioFocus (), but I need this to work on 2.0 and above, so I need a solution that does not use requestAudioFocus ().
thank
source
share