I am developing a microphone app that uses the iPhone built-in mic as input and play the sound through Bluetooth-connected speakers. However, the sound output is not working as expected through the external Bluetooth speakers.
Below is my sample code.
do{
let inputNode = audioEngine.inputNode
let outputNode = audioEngine.outputNode
let format = inputNode.inputFormat(forBus: 0)
inputNode.installTap(onBus: 0, bufferSize: 512, format: format) { (buffer, time) in
}
audioEngine.connect(inputNode, to: outputNode, format: format)
try audioEngine.start()
} catch {
}
I tried with above code but I only can hear the sound from iPhone speakers.
Please advise what are the changes I need to do my code.
New contributor
Nilusha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.