0

I am implementing a WebRTC project for mobile devices using Cordova, in that I want the play the audio in earpiece of mobile device instead of speaker.

Is there any API/ way to play audio in earpiece,

I'm using cordova-plugin-iosrtc for iOS app and cross-walk for android.

Thanks, Shinto

shinto Joseph
  • 1,039
  • 3
  • 16
  • 27

1 Answers1

1

You can try with:

cordova.plugins.iosrtc.selectAudioOutput('earpiece');

Here you can find iosrtc documentation

nsanchez
  • 132
  • 2
  • 12
  • Thank you nsanchez – shinto Joseph Sep 15 '16 at 05:39
  • 1
    this function has been removed.: https://github.com/BasqueVoIPMafia/cordova-plugin-iosrtc/commit/6480fcad91604eddfb045e93343b55ee5773caf2 It suggested to use this instead: https://github.com/saghul/cordova-plugin-audioroute – Keyang Apr 24 '18 at 11:34