CoreAudio playback issue
CoreAudio playback issue
- Subject: CoreAudio playback issue
- From: Pascal <email@hidden>
- Date: Mon, 8 Nov 2010 12:51:17 -0300
Hi,
I am writing a beatbox sequencer for the iphone using CoreAudio.
I have 4 sounds that play on a pattern. I have a AUGraph with IORemote and MultiChannelMixer together. The 4 inputs of the mixer have a callback reading the sound buffers attached to it. It works fine as long as long as sequencer pattern is simple and does not play too many sounds at the same time. If I turn on multiple sounds at the same time, glitches appear and it sound like the CPU is overloaded (I am using an iPhone 1st gen for testing).
I a using CAF sound files (16bits, 44.1Khz) and a canonical audio format:
size_t bytesPerSample = sizeof (AudioUnitSampleType);
stereoStreamFormat.mFormatID = kAudioFormatLinearPCM;
stereoStreamFormat.mFormatFlags = kAudioFormatFlagsAudioUnitCanonical;
stereoStreamFormat.mBytesPerPacket = bytesPerSample;
stereoStreamFormat.mFramesPerPacket = 1;
stereoStreamFormat.mBytesPerFrame = bytesPerSample;
stereoStreamFormat.mChannelsPerFrame = 2; // 2 indicates stereo
stereoStreamFormat.mBitsPerChannel = 8 * bytesPerSample;
stereoStreamFormat.mSampleRate = GRAPH_SAMPLE_RATE;
Is there something I am missing or that I should know that could improve my program? Or am I hitting the CPU limitation of an iPhone 1st gen ?
Pascal
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden