开发者

how to play sound instaed Headset ,from speaker directly on android?

I am trying to play a media file and Listening it on Headset, Now I am trying to give a soft button that using fo开发者_如何学运维r SpeakerOn and Speakeroff.

mAudioManager.setMode(AudioManager.MODE_IN_CALL); 
mAudioManager.setSpeakerphoneOn(true);

I have give permission also in Androidmanifest.xml . But on calling these Apis, Mode is changed and using isSpeakerOn() api it showing the speaker status as we expected but In real time I am still getting sound from Headset only not from Speaker?

Give me some guideline so that we can achieve this switching of sound from headSet to Speaker?


Make sure audioManager.setWiredHeadsetOn(boolean on) set to false.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜