PDA

View Full Version : Program Sounds?



CoffeeRain
October 26th, 2011, 12:56 AM
How do you program sounds? Is there a way to use midi codes, or frequency or something to do this? Maybe a python or c module? Any other way would work too. I was thinking something like this...

www.intel-assembler.it/portale/5/make-sound-from-the-speaker-in-assembly/8255-8255-8284-asm-program-example.asp

...but I was told this wasn't possible with modern computers. :confused:

Zugzwang
October 26th, 2011, 11:03 AM
The simple answer is to use a library that provides the functionality that you need. The library does the communication with a sound device driver for you. Popular choices are "gstreamer", "libSDL", or if you program using the QT framework anyway, the QT framework.

If you want to circumvent binary dependencies, you can also just call some external command line audio player from your program, although this is less efficient and a bit prone to security bugs.

11jmb
October 26th, 2011, 03:23 PM
Perhaps this can be a good starting point on your question about Python modules

http://wiki.python.org/moin/Audio