Hi,
I'm trying to use an AUScheduledSoundPlayer, but it is crashing during playback, suggesting a memory access problem with the supplied audio buffer. I have used the same buffer as an input to a mixer render callback successfully, so the data in the buffer should be correct. This makes me think that I've failed to perform some required initialization step.
Could the graph be trying to pull more data than I have in my buffer, based on some AU parameter I might have failed to set? Do I need to provide zero'd data for all time up to the scheduled playback time in the provided audio buffer? Any insight, a pointer to a clear example, or even a few comments about expected use of the AU would be helpful.
Thanks! Andrew.
[...] memset(&mSlice, 0, sizeof(ScheduledAudioSlice)); // mSlice does not currently contain playing data - this code executes once only mSlice.mTimeStamp.mSampleTime = sampleTime; mSlice.mTimeStamp.mFlags = kAudioTimeStampSampleTimeValid; mSlice.mNumberFrames = pBuffer->mNumFrames; mSlice.mBufferList = &pBuffer->mBufferList;
OSStatus err = AudioUnitSetProperty(mUnits[kUnit_ScheduledPlayer], kAudioUnitProperty_ScheduleAudioSlice, kAudioUnitScope_Global, 0, &mSlice, sizeof(ScheduledAudioSlice)); [...] |