Skip to main content
Inspiring
Jan 16, 2017 2:10 PM UTC
Question

Event listener switch speaker - headset on android

How can I track the moment of switching headphone to speakers in Android?

I want this moment to put music on pause in the app.

Thank you.

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

deesharm
Adobe Employee
Adobe Employee
Jan 17, 2017 6:17 AM UTC

Hi Maxxtr,

The following code switches between modes:

SoundMixer.audioPlaybackMode = _useLoudspeaker ? AudioPlaybackMode.MEDIA : AudioPlaybackMode.VOICE;

Please read more about Sound Mixer class through below link:

SoundMixer - Adobe ActionScript® 3 (AS3 ) API Reference

Thanks,

Adobe AIR Team

Translate
maxxtrAuthor
Inspiring
Jan 17, 2017 11:36 AM UTC

Thank you deesharm.

I don't understand this code. How to track a moment of a mode switching?

The moment a user disables his headphones off the Android device.

Translate