Skip to main content
Participating Frequently
September 1, 2011
Answered

How do I change between earphone to speakerphone? (soundmixer class)

  • September 1, 2011
  • 4 replies
  • 1497 views

Hi everyone!

I download Air 3 and there have the device speaker control,

But how do I use soundmixer class to replace the sound from earphone to speakerphone

Can you show me an example code on button?, please...

Thanks!

This topic has been closed for replies.
Correct answer sanika Kulshreshtha

Set SoundMixer.audioPlaybackMode = "media";

SoundMixer.useSpeakerphoneForVoice = true;

You can see the beta documentation at http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/media/AudioPlaybackMode.html

-Sanika

4 replies

Adobe Employee
September 2, 2011

As discussed by sanika, you can switch between the earphone and the speakerphone by either changing the playbackmode to MEDIA or setting useSpeakerphoneForVoice to true.

Both options will switch the sound output to speakerphone.

-Varun

Participant
September 7, 2011

Varun or Sanika,

I am trying to use useSpeakerphoneForVoice for android project, but flash builder does not recoginized it. I even downlowded the AIR 3 release candidate and still no luck. The compiler is setup for swf versin 13.  Is it really available now?

the name exists in

lib\aot\lib\bitcode.api.arm-air.txt(9630):_ZN7avmplus8NativeID56flash_media_SoundMixer_useSpeakerphoneForVoice_get_thunkEPNS_9MethodEnvEjPim

any idea what is wrong?

Thanks.

Adobe Employee
September 10, 2011

Can you provide some sample code to demostrate how you are using the useSpeakerPhoneForVoice property.

sanika KulshreshthaCorrect answer
Participating Frequently
September 1, 2011

Set SoundMixer.audioPlaybackMode = "media";

SoundMixer.useSpeakerphoneForVoice = true;

You can see the beta documentation at http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/media/AudioPlaybackMode.html

-Sanika