From: Alex Hall on
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.

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap(a)gmail.com; http://www.facebook.com/mehgcap
From: Gregory Ewing on
Alex Hall wrote:

> 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.

--
Greg