Audio Unit Error Codes
Contents |
PageOverviewSymbolsOverviewAudio
Audiounitinitialize Error Codes
Unit Component Services provides the C audio unit sample code interface for using audio units. An audio unit is
Carrier Split Unit Error Codes
an audio processing plug-in used for processing or generating audio data. To find, open, and audiounitsetproperty close audio units, you use a companion interface, Audio Component Services, described in Audio Component Services. An audio unit is uniquely identified by a triplet of codes known as osstatus type, subtype, and manufacturer ID. See the AudioComponentDescription structure in Audio Component Services Reference.SymbolsAudio Unit Initialization and Rendering Audiofunc AudioUnitInitialize(AudioUnit)Initializes an audio unitfunc AudioUnitUninitialize(AudioUnit)Uninitializes an audio unit.func AudioUnitAddRenderNotify(AudioUnit, AURenderCallback, UnsafeMutableRawPointer?)Registers a callback to receive audio unit render notifications.func AudioUnitRemoveRenderNotify(AudioUnit, AURenderCallback, UnsafeMutableRawPointer?)Unregisters a previously-registered render listener callback function.func AudioUnitRender(AudioUnit, UnsafeMutablePointer
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: https://developer.apple.com/reference/audiounit/1653800-audio_unit_component_services Sign up AudioUnit set property error (error code -10868) up vote 3 down vote favorite 2 I am trying to set a property in AudioUnit using AudioStreamBasicDescription. I am trying to set the format for the sound data. The error code returned is -10868. It only occurs on iOS 3.1.3 or less, but works on 3.2 or up. So it works in http://stackoverflow.com/questions/6722598/audiounit-set-property-error-error-code-10868 the simulator, on an iPod touch running 4.2, but not a 1st gen iPod touch. The error occurs when I try to set the format for the AudioUnit tone unit. The code looks like this (and is from cocoawithlove.com) // Set the format to 32 bit, single channel, floating point, linear PCM const int four_bytes_per_float = 4; const int eight_bits_per_byte = 8; AudioStreamBasicDescription streamFormat; streamFormat.mSampleRate = sampleRate; streamFormat.mFormatID = kAudioFormatLinearPCM; streamFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kAudioFormatFlagIsNonInterleaved; streamFormat.mBytesPerPacket = four_bytes_per_float; streamFormat.mFramesPerPacket = 1; streamFormat.mBytesPerFrame = four_bytes_per_float; streamFormat.mChannelsPerFrame = 1; streamFormat.mBitsPerChannel = four_bytes_per_float * eight_bits_per_byte; err = AudioUnitSetProperty (toneUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &streamFormat, sizeof(AudioStreamBasicDescription)); // err now has error code -10868 I checked around in headers and this error code corresponds to the error "kAudioUnitErr_FormatNotSupported". So I guess the format I'm trying to set is not supported on iOS 3.1? Where can I find supported formats? Any pointers on other formats I could try out? The render callback used: OSStatus RenderTone( void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData) { // Fixed amplitude is good enough for our purposes const double amp
channel and a single audio unit effect to filter the sound. Unless I initialise the audioController with 'nonInterleavedFloatStereoAudioDescription' as the audio format, I get the following error when trying to initialise an http://forum.theamazingaudioengine.com/discussion/104/aeaudiounitfilter-couldnt-setup-converter-audio-unit-error AEAudioUnitFilter: Error Domain=NSOSStatusErrorDomain Code=-10868 "Couldn't setup converter audio unit" UserInfo=0x1c5a5a20 {NSLocalizedDescription=Couldn't setup converter audio unit} Is this a known problem, or might I be doing something wrong? Everything works fine using floating point audio. Comments Michael May 2013 Could you post a sample project (or at least a chunk of sample code) demonstrating this issue, @willpragnell? willpragnell May 2013 Sure. https://github.com/willpragnell/AudioEngineDemo demonstrates the problem (you'll need error codes to init/update submodules before it will build). Thanks! willpragnell May 2013 Bump! (sorry) Has anyone else experienced this, or has anyone not been able to reproduce the problem using my sample project? Michael May 2013 Oops, sorry about that, Will - I forgot to look into this. I've just spent 20 mins exploring, and haven't actually figured out what's going on yet. Something to do with the unit error codes converter not being able to handle that format, perhaps, but I noticed if you move the AUGraphConnectNodeInput calls in AEAudioUnitFilter.m beneath the audio format assign calls (see attached patch), it doesn't throw any errors any more on setup. But then it reports 'Invalid input size' errors later while rendering. Jury's still out on this one though, as I've run out of time to spend on it for now. reversed-calls.patch 3.4K psobot June 2013 @Michael Thanks for the patch - that works wonderfully for me. For the record, I'm trying to add an AUNewTimePitch AudioConverter unit as an AEAudioUnitFilter. Do you have any plans to investigate this in the future and merge this into master? (For the record, I don't see any 'invalid input size' errors later when rendering with this patch applied.) willpragnell June 2013 Thanks for your time Michael. I'll experiment with the patch and see if I'm as lucky as psobot. Michael July 2013 Better late than never: I've incorporated this into SHA 78417f49 psobot July 2013 Sweet! Thanks @Michael. Sign In or Register to comment. Howdy, Stranger! It looks like you're new here. If you want to get involved, click one of these buttons!