I’m writing a program that involves playing back sine waves and combinations of sine waves… it must run on Mac, and I’m looking for a simple API that I can use. I’m open to ObjC, C, C++, Ruby, Python, etc…. I don’t care what language as long as it’s just a few lines of code. But Ruby would be nice 🙂
On Linux you can write to /dev/dsp, /dev/sound etc. but not on mac. I know how to generate a sine wave, but the problem is getting the PCM samples that I create to the audio hardware. I’m aware of the example code in /Developer/Examples/CoreAudio/SimpleSDK/DefaultOutputUnit but it’s several hundred lines of ridiculous Core Audio / AudioUnit code and I want something simple to work with.
one way is to use PyAudio
not very clean code, but it works
PyAudio is not standard, but is available through easy_install (I used python2.5)