Android - 连接蓝牙音箱的内置手机扬声器播放音频

时间:2016-02-07 19:54:27

标签: android audio bluetooth

我的设置:Android 4.4平板电脑连接索尼蓝牙音箱。 Spotify正在播放蓝牙音箱上的音乐。

使用

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);`

通知声音在内置和蓝牙扬声器上播放。

是否可以在平板电脑的内置扬声器上播放通知声音 ,而不是蓝牙扬声器?

1 个答案:

答案 0 :(得分:1)

soundPool = new SoundPool(20, AudioManager.STREAM_NOTIFICATION, 0);

这里的论证AudioManager.STREAM_NOTIFICATION负责使其以这种方式发挥作用 我没有试过这个,但是输入这个AudioManager.STREAM_并点击ctrl + space你会得到推荐并使用每一个并测试