[英]Android - playback audio on internal phone speaker with bluetooth speaker connected
My setup: Android 4.4 tablet connected with Sony bluetooth speakers. 我的设置:Android 4.4平板电脑与Sony蓝牙扬声器连接。 Spotify is playing music on the bluetooth speaker.
Spotify正在通过蓝牙扬声器播放音乐。
Using 运用
audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
audio.setStreamVolume(AudioManager.STREAM_NOTIFICATION, audio.getStreamMaxVolume(AudioManager.STREAM_NOTIFICATION), 0);
soundPool = new SoundPool(20, AudioManager.STREAM_NOTIFICATION, 0);
SoundBeeps = soundPool.load(this,R.raw.beeps,1);
soundPool.play(SoundBeeps, 1, 1, 0, 0, 1);`
the notification sound is played back on both the internal and the bluetooth speaker. 通知声音会在内置扬声器和蓝牙扬声器上播放。
Is it possible to play a notification sound only on the tablet's internal speaker, not on the bluetooth speaker? 是否可以仅在平板电脑的内置扬声器上播放通知声音,而不能在蓝牙扬声器上播放通知声音?
soundPool = new SoundPool(20, AudioManager.STREAM_NOTIFICATION, 0);
the argument AudioManager.STREAM_NOTIFICATION
here is responsibe to make it play in that manner 这里的参数
AudioManager.STREAM_NOTIFICATION
负责使其以这种方式播放
I have not tried this but type this AudioManager.STREAM_
and hit ctrl+space you will get recommendations and use each one and test 我没有尝试过,但是键入此
AudioManager.STREAM_
并按ctrl + space键,您将获得建议并使用每一个并进行测试
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.