Routing audio to Bluetooth Headset (non-A2DP) on Android

后端 未结 5 786
隐瞒了意图╮
隐瞒了意图╮ 2021-01-29 21:51

I have a non-A2DP single ear BT headset (Plantronics 510) and would like to use it with my Android HTC Magic to listen to low quality audio like podcasts/audio books.

Af

5条回答
  •  醉酒成梦
    2021-01-29 22:22

    To turn on:

     localAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
     localAudioManager.setMode(0);
     localAudioManager.setBluetoothScoOn(true);
     localAudioManager.startBluetoothSco();
     localAudioManager.setMode(AudioManager.MODE_IN_CALL);
    

    To turn off:

     localAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
     localAudioManager.setBluetoothScoOn(false);
     localAudioManager.stopBluetoothSco();
     localAudioManager.setMode(AudioManager.MODE_NORMAL);
    

    I took it from here

提交回复
热议问题