Play audio trough phone speaker of an android device

我的未来我决定 提交于 2019-12-05 08:53:10

If you want to play audio through the earpiece, use the STREAM_VOICE_CALL stream type. If you use the MediaPlayer class there's a setAudioStreamType method that you can use for this purpose, and for the AudioTrack class you pass the stream type to the constructor.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!