0

I am working on radio app in which i want to record live radio streaming on an record button click.It should record just the radio streaming sound. Currently i am recording from Mike but its not the way i want as it also captures the surrounding/background voice. I did read few post but all of them are regarding AVaudioRecorder. I have used wunderradio api for playing the radio from url. I haven't got any method/function in their api which will record that audio from url. I want to record the buffered audio only from that url,so that I can play that recorded file later.

Any help would be appreciated.

Shashank
  • 877
  • 7
  • 15

1 Answers1

0

Recording audio playback by using the microphone is really not the right way to do it. If you're using AudioQueue services for audio playback you can use the AudioFileWritePackets function to write audio data to a file.

If you implement recording this way you can write audio files in the format they're streamed in. So an mp3 audio stream can be written as an mp3 file to disk since you're writing encoded audio packets with the AudioFileWritePackets function.

To get a better understanding of how this all should be implemented you can have a look at the SpeakHere sample code of Apple. The SpeakHere project records from the microphone but it's still a good example to see how the AudioFileWritePackets function works. In your case you need to use the AudioFileWritePackets function in the output callback of your AudioQueue. This is the callback that's called when a buffer is finished playing. So it's a good to place to write the already played audio buffers data to a file.

Kemal Taskin
  • 481
  • 4
  • 10
  • I'm looking for a similar solution but never used AudioQueue services before. Do you know of any code samples I can take a look at that perform what you're suggesting? – Oren Oct 08 '15 at 00:36