[iOS] Input / output device selection
Closed this issue · 3 comments
Right now, when sound recording is activated on iOS, in the following codeblock, we do nothing to select audio device:
react-native-audio/ios/RNAInputAudioStream.m
Lines 121 to 128 in 0966070
It turns out, when external (e.g. bluetooth microphone / headphone) audio device is connected to iOS device, even if initially the sound from the app is output to that device, entering into Tuning (or interactive training mode), and activating sound recording, currently switches both audio input and output to the default (on-board of device) iOS speaker / mic. This happens inside this call.
Now, the problem is after a brief investigation I am not able to find how to select the audio input / output device (can't see such config in the docs of the methods we use in the codeblock linked above). It seems it might not possible to use input and output from different devices on iOS (not without user re-configuration of audio settings inside device configs), but we at least should instruct the app to keep using bluetooth mic/speaker, if they are connected and used before activating sound recording.
It requires further investigation, how to achieve it.
Probably, this should be used: https://developer.apple.com/documentation/avfaudio/avaudiosession
configAudioSystem()
feature added in v1.2.2 allows to ensure the bluetooth device is used for output, if connected, thus probably no more action needed for this ticket.