Playing diffrents sounds continuosly
Playing diffrents sounds continuosly
- Subject: Playing diffrents sounds continuosly
- From: FILIPPIN LUCA <email@hidden>
- Date: Thu, 18 Nov 2004 13:34:39 +0100
Hi,
I'm engaged in this task: I need to play differents sound each one
starting just at the end of the previous or while the previous is playing.
I have very close constraints (max 5 ms) about start time, so I preload all
the sound into memory and lock the relatives mem pages.
I'm new on coreaudio, so I tried to get inspired from the
"PlayAudioFileLite" sample code. I extended and modified the code so that
for each sound
1) Allocate AudioUnit, AudioConverter, setup callbacks
2) StartAudioUnit at start time
3) StopAudioUnit at expected end time
4) Close Audio Components
This works, but works badly because it requires too much time (about 20 ms)
to perform AudioUnitStop (but also audio components close) and I loose start
time accuracy for next sound. I tried to use AudioUnitReset to stop sound
instead of AudioUnitStop, and to close all audio components after I played
all sounds. This works good for the first n sounds, but then performances
slow down: I suppose this is due to the number of audio unit allocated at
the same time. How can I overcome this problem?
Thanks to all will give me a suggestion,
Luke
_______________________________________________
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