[rescue] Pro audio on Sun
Joshua D Boyd
jdboyd at cs.millersville.edu
Tue Jun 11 15:43:06 CDT 2002
On Tue, Jun 11, 2002 at 03:30:42PM -0500, Shawn Wallbridge wrote:
> I thought that Audio on MacOS X was _really_ good. I was talking with an
> audio guy and he said Apple put a lot of work into Darwin to get the latency
> really low specifically for audio.
>
> One of my clients is a professional studio and about 90% of their machines
> are Macs. They even had a TiBook with a fancy Firewire audio breakout box.
> They loved it, they could do really good recordings anywhere.
Yeah, but using a fancy API isn't as easy as doing something like
#include <releventstuff.h>
void main () {
FILE fp;
char a [4096]
fp = open("/dev/dsp", 'r');
int f = AFMT_S16_LE;
ioctl(fp, SNDCTL_DSP_SETFMT, &f);
ioctl(fp, SNDCTL_DSP_CHANNELS, 2);
int s = 44100;
ioctl(fp, SNDCTL_DSP_SPEED, &s);
while (read(fp, a, 4096)==-1) {
//process audio in a
}
close(fp);
}
Of course, you need to add a few more ioctls if you want any sort of
sync, and you will need to do some fiddling to account for latency,
and I do leave out all the safety checks, but it is darn simple.
--
Joshua D. Boyd
More information about the rescue
mailing list