Re: CoreAudio playback issue
Re: CoreAudio playback issue
- Subject: Re: CoreAudio playback issue
- From: tahome izwah <email@hidden>
- Date: Mon, 8 Nov 2010 17:00:57 +0100
Hard to tell without knowing more - are you reading directly from the
files inside your callback? You do know you should not use any calls
that can block (malloc, EAF API)? It sounds like this could be your
problem.
--th
2010/11/8 Pascal <email@hidden>:
> 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 ?
> Many thanks.
> 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