Android 音频通道切换HDMI,蓝牙,喇叭

avatar
作者
筋斗云
阅读量:3

Android 音频通道切换HDMI,蓝牙,喇叭

private void speakerSound() {         if (soundOutput.equals("speaker")) {             return;         }         soundOutput = "speaker";         audoManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);         audoManager.setMode(AudioManager.STREAM_MUSIC);         audoManager.stopBluetoothSco();         audoManager.setBluetoothScoOn(false);         audoManager.setSpeakerphoneOn(true);     }      private void hdmiSound() {         if (soundOutput.equals("hdmi")) {             return;         }         soundOutput = "hdmi"; mContext.getSystemService(Context.AUDIO_SERVICE);         audoManager.setMode(AudioManager.MODE_IN_COMMUNICATION);         audoManager.stopBluetoothSco();         audoManager.setBluetoothScoOn(true);         audoManager.setSpeakerphoneOn(false);     }      private void bluetoothSound() {         if (soundOutput.equals("bluetooth")) {             return;         }         soundOutput = "bluetooth";         audoManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);         audoManager.setMode(AudioManager.MODE_IN_COMMUNICATION);         audoManager.startBluetoothSco();         audoManager.setBluetoothScoOn(true);         audoManager.setSpeakerphoneOn(false);     } 

参考:
https://blog.csdn.net/u010983881/article/details/72420790

广告一刻

为您即时展示最新活动产品广告消息,让您随时掌握产品活动新动态!