Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there any high level Audio Queue Record Service Library for iOS?
    text
    copied!<p>I'm trying to develop an application which about VOIP,</p> <p>is there any high level audio queue service library for iOS ?</p> <p>because I'm not very good at for working on extension filename ".mm",</p> <p>using an open source would be a better option.</p> <p>or someone could give me some hints for how to fetch the buffer from AudioQueueBufferRef ?</p> <p>the ideal way is like a delegate :</p> <pre><code>- (void)audioRecorderDidReceivedBuffer:(Buffer) { do something for other operations } </code></pre> <hr> <ul> <li><p><strong>Update</strong> I found an article which about <a href="http://atastypixel.com/blog/using-remoteio-audio-unit/" rel="nofollow">Using RemoteIO audio unit</a></p> <p>maybe the input callback is what I need. </p></li> </ul> <blockquote> <p>Overvier</p> <ol> <li>Identify the audio component (kAudioUnitType_Output/ kAudioUnitSubType_RemoteIO/ kAudioUnitManufacturerApple)</li> <li>Use AudioComponentFindNext(NULL, &amp;descriptionOfAudioComponent) to obtain the AudioComponent, which is like the factory with which you obtain the audio unit</li> <li>Use AudioComponentInstanceNew(ourComponent, &amp;audioUnit) to make an instance of the audio unit</li> <li>Enable IO for recording and possibly playback with AudioUnitSetProperty</li> <li>Describe the audio format in an AudioStreamBasicDescription structure, and apply the format using AudioUnitSetProperty</li> <li>Provide a callback for recording, and possibly playback, again using AudioUnitSetProperty</li> <li>Allocate some buffers</li> <li>Initialise the audio unit</li> <li>Start the audio unit</li> <li>Rejoice</li> </ol> </blockquote> <pre><code>// Enable IO for recording UInt32 flag = 1; status = AudioUnitSetProperty(audioUnit, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, kInputBus, &amp;flag, sizeof(flag)); // Set input callback AURenderCallbackStruct callbackStruct; callbackStruct.inputProc = recordingCallback; callbackStruct.inputProcRefCon = self; status = AudioUnitSetProperty(audioUnit, kAudioOutputUnitProperty_SetInputCallback, kAudioUnitScope_Global, kInputBus, &amp;callbackStruct, sizeof(callbackStruct)); //recordingCallback static OSStatus recordingCallback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData) { // TODO: Use inRefCon to access our interface object to do stuff // Then, use inNumberFrames to figure out how much data is available, and make // that much space available in buffers in an AudioBufferList. AudioBufferList *bufferList; // &lt;- Fill this up with buffers (you will want to malloc it, as it's a dynamic-length list) // Then: // Obtain recorded samples OSStatus status; status = AudioUnitRender([audioInterface audioUnit], ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, bufferList); checkStatus(status); // Now, we have the samples we just read sitting in buffers in bufferList DoStuffWithTheRecordedAudio(bufferList); return noErr; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload