Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play and record audio at the same time

I need to play and record at the same time. The problem is that played and recorded sound should be different. Played sound_1 is continuously send through headphone jack to connected device, device analyzes this sound_1 and sends back another sound_2 through headphone jack. I receive this sound_2, but when I try to record it, I get mix of sound_1 and sound_2. Is there any way to play/record separately, or I need some kind of filter for incoming sound_2? I tried to play sound with AVAudioPlayer and record with AudioQueue, session was PlayAndRecord.

Found some similar topic: Playing and recording Audio simutaneouly with headset jack pin in iOS?

but there was also no constructive answer.

like image 934
f3n1kc Avatar asked Nov 13 '22 08:11

f3n1kc


1 Answers

Solution for me was to decrease sample rate from 44100 to 22050

like image 109
f3n1kc Avatar answered Dec 17 '22 09:12

f3n1kc