Tuesday, March 29, 2011

sound

I did something in Matlab that I really want to try in C. Basically it's just a "if condition is true play a click on the speaker". Matlab has a sound command that's reasonably fast and you just pass it an array to perform D/A on. x = [0 1 0] is good enough for a click sound. The default sampling rate is ~8 kHz or something but bumping it up to 30 kHz is fine and improves the accuracy.

I'll do some casual searching for a way to output sound in C. Maybe SDL? Allegro? Certainly some game programming library has something nice and easy.

EDIT: or maybe Windows has a native way of doing it?

1 comment:

  1. I've been meaning to play with CSound: http://www.csounds.com/docs

    You might give that a read to see if it fits your goals.

    ReplyDelete