Open khdavidkim opened 3 years ago
Just a note:
I applied this change to a local version of the plugin, where I used this to transcribe spoken audio recorded via cordova-plugin-media
.
This change solved a problem for me, where audio playback volume was getting stuck at around 25% (I suspect earphone levels), after recording, and could not be adjusted.
I'm not familiar with the implications of this change in Objective-C but it appears to work on my end with no adverse side effects.
Repro scenario:
AirPods pro are paired but not connected (in case).
I changed code (AVAudioSessionCategoryPlayAndRecord -> AVAudioSessionCategoryRecord) on 84line at SpeechRecognitoin.m.
[audioSession setCategory:AVAudioSessionCategoryRecord withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker error:nil];