#: 16286 S12/OS9/68000 (OSK)
24-Aug-92 15:29:33
Sb: #16216-#MM/1 _ss_play
Fm: Kevin Darling 76703,4227
To: Stephen Seneker 75020,3611 (X)
Stephen,
Yes, you can record (or play) more audio than available memory.
The trick is: the sound driver will buffer up to about 4 (maybe more, I've
forgotten :-) play/record requests. As soon as one is finished, the next
request in line will automagically be started without delay.
So what you do is allocate a couple of buffers. Fill one, then start it
playing and begin filling the other. Then also immediately request a play for
that second buffer (which will be queued up by the driver). This primes your
playing "pump".
Now you can wait for the first buffer to finish playing before starting to load
it up again. Then wait for the second to finish before playing the first. And
continue looping from there.
To sync the waits, pass a signal value in the parameters. For my quick and
dirty demos I just pass an S$Wake signal value... and go to sleep between
buffer-fills. The S$Wake signal keeps me in sync (except when the playing goes
faster than loading can go - then everything stops between buffers. I should
use a fancier method in my play programs).
I usually use about 4-16K buffers, I think. Depends on playback frequency.
Does any of this make sense? best - kevin
There is 1 Reply.
|