One way: CoreAudio DefaultOutputUnit.
You can configure it with parameters such as output sample rate, resolution, and output sample format. You can then programmatically create a raw sound wave and provide it to the output device.
Take a look at this example on your computer at / Developer / Examples / CoreAudio / SimpleSDK / DefaultOutputUnit /
. , .
/Developer/Examples/CoreAudio/ .