Module tones
[hide private]

Module tones

source code

Utilities to generate and play tones

Functions [hide private]
 
_cleanup() source code
 
beep(hz, length, left=50, right=50)
Plays a tone at the given hz, length, and stereo balance.
source code
Variables [hide private]
  SAMPLE_RATE = 44100
  player = None
hash(x)
  __package__ = None
hash(x)
Function Details [hide private]

_cleanup()

source code 
Decorators:
  • @atexit.register

beep(hz, length, left=50, right=50)

source code 

Plays a tone at the given hz, length, and stereo balance.

Parameters:
  • hz (float) - pitch in hz of the tone
  • length (integer) - length of the tone in ms
  • left (integer) - volume of the left channel (0 to 100)
  • right (integer) - volume of the right channel (0 to 100)