Re: CoreAudio rewrite of SndPlayDoubleBuffer
Re: CoreAudio rewrite of SndPlayDoubleBuffer
- Subject: Re: CoreAudio rewrite of SndPlayDoubleBuffer
- From: Jeff Evans <email@hidden>
- Date: Wed, 26 Jun 2002 22:14:22 -0700
You might want to check this link:
http://developer.apple.com/samplecode/Sample_Code/Sound/CarbonSndPlayDB/Carb
onSndPlayDB.c.htm. That's a Carbon substitute for SndPlayDoubleBuffer, and
it works perfectly as near as I can tell.
Yours, Jeff
>
My Cocoa program needs to produce continuous sound whose samples are
>
computed in real time. I am essentially trying to duplicate the
>
behavior of SndPlayDoubleBuffer from the classic MacOS -- or similarly,
>
the effect you can get by sending an endless sequence of 'buffer' and
>
'callback' commands to a SndChannel, ping-ponging in alternation between
>
two buffers of samples.
>
>
I have some rules about the sound: it must be played at 22050 Hz, must
>
be 8-bit, unsigned (128-centered), linear (not logarithmic), and
>
monophonic (not stereo).
>
>
By mimicking code that I found in the Developer/Examples subtree, I am
>
nearly there. Specifically, I refer you to the file
>
'UsingDefaultNoAC.cpp', way down in the CoreAudio example projects, in
>
which file lies code that computes and plays a sine wave in real time.
>
I've understood most of this code, but a few questions remain despite my
>
scouring through the documentation. (CoreAudio, it seems, has really
>
meager online documentation. Apologies though if I've somehow missed
>
it.)
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.