views:

37

answers:

1

Hi,

I am developing a music mixing app in iphone. It'll mix the music and user can compose a new music from it. I need to record this final music. I had used AVAudiorecorder to record this one. But no change. It can record sound from microphone but I need to record app sound.

I had used audio queue call back function to record the audio. But when app runs I can hear the audio from my app and I couldn't hear any sound from recorded audio. There is no problem with recording since I can hear the audio recorded through microphone. But I need an offline recorder which can record the audio output of iphone, rather than the audio input through microphone. I need a recorder which can record audio using ipod touch (no microphone).

Any help?

A: 

Hi all,

I found the solution in another way . I had used audio graph consist of two audio units. A digital mixer and output audio unit. I had created the mixer with six channels so that I can play six instruments simultaneously. When the user compose the music, I'll save the content and during offline recording I'll sequence the saved instruments to mixer.

For better performance I'll stop the audio graph while loading new audio or instrument files. After loading the files, the recording will resume again.

In input playback function of mixer, according to the input bus number, audio packets will be fed to mixer. In input play back of output audio unit, a new buffer is allocated to store the mixer output. The mixer output was created using audio render function. Since I was not modifying audio input buffer there will be no sound outside the app. Finally I had an offline audio recorder.

Steps

  1. Create an audio session using recording and playback mode
  2. Create an audio graph with a mixer and an audio output unit.
  3. Configure mixer channels or input bus numbers (number of audio streams).
  4. Create input play back method for mixer and audio unit.
  5. Configure source and destination audio format to audio unit input and output buses.
  6. Create an audio file using destination format (For AAC encoding check for AAC encoding support).
  7. Fetch the audio files and develop a method to give audio packets for a specified channel.
  8. In audio input play back of mixer configure the audio file fetching.
  9. In audio input play back of output unit, use the audio render function to fetch the mixer output in new audio buffers. Store the audio buffer to opened audio file.
  10. Pause recording using audio graph stop and resume recording using audio graph start methods. During this interval configure the new sound file fetching.
  11. Finally stop recording and close the audio file.
Midhere