Ubuntu 10.04 and Python 2.6

I just want to output a simple tone.
I have searched the Internet and found there are thousands, if not millions of responses to Google, and the this forum's search engine. I read so many my eyes are crossed. But really, does anyone know of a tutorial or something that will allow me to output a simple tone?

Pygame is another option.

def load_sound(name):
class NoneSound:
def play(self): pass
if not pygame.mixer:
return NoneSound()
fullname = os.path.join('data', name)
try:
sound = pygame.mixer.Sound(fullname)
except pygame.error, message:
print 'Cannot load sound:', wav
raise SystemExit, message
return sound

Tutorial at:
http://pygame.org/docs/tut/chimp/ChimpLineByLine.html

For a winsound example of a simple tone.

import winsound, random

winsound.Beep(random.randint(900,2750),100) #plays random tone

Assuming you are using windows.

As the first part of my question clearly states, I am using Ubuntu 10.04. That is, of course, a Linux distribution.Thanks anyway.Thanks to all for answering. I could not get any to work for me.

As saulm mentioned, PyAudiere would benefit. It is crossplatform so it will work on Ubuntu.

import audiere, time
d = audiere.open_device()
t = d.create_tone(1600) 
t.play() 
time.sleep(5)
t.stop()

This should get you started. By the way, a quick trip with Google would have supplied the answer.

This article has been dead for over six months. Start a new discussion instead.