selectAudioRoute method

void selectAudioRoute({
  1. required String speakerSelected,
})

Implementation

void selectAudioRoute({
  required String speakerSelected,
}) async {
  switch (speakerSelected) {
    case 'speaker':
      Helper.selectAudioOutput('speaker');
      Helper.selectAudioInput("microphone-back");
      _audioSelected = 'speaker';
      break;
    case 'earpiece':
      Helper.selectAudioOutput('earpiece');
      Helper.selectAudioInput("microphone-bottom");
      _audioSelected = 'earpiece';

      break;
    case 'bluetooth':
      Helper.selectAudioOutput('bluetooth');
      Helper.selectAudioInput("bluetooth");
      _audioSelected = 'bluetooth';
      break;
    case 'wired-headset':
      Helper.selectAudioOutput('wired-headset');
      Helper.selectAudioInput("wired-headset");
      _audioSelected = 'wired-headset';
      break;
    default:
      Helper.selectAudioOutput('earpiece');
      Helper.selectAudioInput("microphone-bottom");
      _audioSelected = 'earpiece';
      break;
  }
}