The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
How to pause/resume music if player is already listening mus
Limanima


Joined: 09 Oct 2013
Posts: 75
I have a problem regarding music in android (and possibly in iOS too).
I want to stop playing music (or not playing it at all) if the user is already listening music from other source.
I've found this article that shows how this can be done.

http://developer.android.com/training/managing-audio/audio-focus.html

Basicaly, the idea is to handle the onAudioFocusChange callback from the audio manager and enable/disable the in-game music.

I searched the SDL mixer code but couldn't find this event, nor any references to the AudioManager refered in the link.

Is is possible to do this in the current version of SDL?