How to mute audio in headset but let it play on speaker programmatically?

前端 未结 2 1200
深忆病人
深忆病人 2020-12-01 22:44

I am searching a work-around for my problem specified in this question:

How to disable the wired headset programmatically in Java

As mentioned there, I am ge

2条回答
  •  长情又很酷
    2020-12-01 23:27

    AudioManager mAudioMgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE); mAudioMgr.setSpeakerphoneOn(true); mAudioMgr.setMode(AudioManager.MODE_IN_COMMUNICATION);

提交回复
热议问题