I also had to figure this out, and I would also suggest using the Phonon framework for this. It uses Windows Media Player as a host on Windows, QuickTime on Mac, and some KDE stuff on Linux. Thus, it is quite platform independent.
If you need lower functionality, you should take a look at an open source project called portaudio. It is very easy to use, and you can manipulate or even fill buffers from code. I used it to create a generator.
Hope this helps!
Best
guitarflow
source
share