I am trying to build an application that will alert the user in case of an emergency by playing an audio file. To override situations where the user may be playing loud music and the emergency announcement may not be heard by the user (due to sharing of audio h/w with multiple apps), can I get exclusive access to audio output so only my audio stream is audible and rest all are stopped/killed/muted?
Share
You can use AudioManager to set your audio source to ‘solo’ which will mute other audio streams setStreamSolo or you can individually mute other streams using setStreamMute