Issue
I am building a project with Ionic 5 / Angular. I want to build a voice call app, which needs to access my phone ear speaker, not the loudspeaker.
The problem is when I fetch my device's audio output using enumerateDevices()
, I don't find any other audio output besides the default audio output (the loudspeaker itself).
I want to attach the HTMLMediaElement using .setSinkId() to the ear speaker's device ID, but didn't find it. Is there any native plugin or workaround for this? Or is it just my phone that doesn't support it? Currently, I am using Samsung Galaxy A51.
Thank you.
Solution
Check this Plugin: Github Repo
NPM : Npm LInk
Usage:
AudioToggle.setAudioMode(AudioToggle.SPEAKER);
// or
AudioToggle.setAudioMode(AudioToggle.EARPIECE);
Answered By - Najam Us Saqib
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.