loudSpeakerStatus on Android

Hello, on iOS there is a "Stream" method called "loudSpeakerStatus" that allows you to direct playback output to either speakers or phone. Is there such a method for Android?
 

Max

Administrator
Staff member
Good day.
There is Flashphoner.getAudioManager().setUseSpeakerPhone() function to enable/disable speakerphone in Android SDK. Please see MediaDevice example application code:
Java:
        mSpeakerPhone = (CheckBox) findViewById(R.id.use_speakerphone);
        mSpeakerPhone.setChecked(Flashphoner.getAudioManager().getAudioManager().isSpeakerphoneOn());
        mSpeakerPhone.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                Flashphoner.getAudioManager().setUseSpeakerPhone(isChecked);
            }
        });
 
Top