tone generation for motherboard and sound card speakers?

A

Alex Hall

Hi all,
I am wondering if there is a way to generate a tone for the
motherboard speaker, like the call to Beep() in C++?

Also, is there a module to generate tones in Python using the sound
card? A module that can beep at a given frequency for a given time
using the usual sine wave is okay, but the fancier the better
(different waves, sweeping, and so on).

My final question will likely hinge upon the answer to the second
question, but is there a way to play a tone in a given position in the
stereo field? For example, I have a Battleship tactical board (my name
for where the little red and white pins go) which I am trying to
sonify using different tones for each status (not fired on, ship
sighted, ship hit, ship sunk). I want each row to play, from top to
bottom, but each square in each row should start at the left and
continue to the last square playing in the right speaker, giving the
user a better idea of where each square is. Oh, this is for blind
users, in case you were wondering why anyone would want to sonify a
battleship board.
Thanks for any information, and note that I am using Python2.6; unless
there is an easy way to use a module meant for 2.5 or before inside a
2.6 project, I would need a 2.6 module.
 
G

Gregory Ewing

Alex said:
Also, is there a module to generate tones in Python using the sound
card? A module that can beep at a given frequency for a given time
using the usual sine wave is okay, but the fancier the better
(different waves, sweeping, and so on).

My final question will likely hinge upon the answer to the second
question, but is there a way to play a tone in a given position in the
stereo field?

The mixer module of pygame will do all of this, I think:

http://www.pygame.org/

You may find the rest of pygame useful for implementing your
battleship game as well, if you haven't already chosen a library
for that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top