[Nvda-dev] commit r1939 - trunk/source

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Nvda-dev] commit r1939 - trunk/source

NVDA Subversion
Author: mdcurran
Date: Tue Apr 22 09:21:43 2008
New Revision: 1939

Log:
tones: added doc strings

Modified:
   trunk/source/tones.py

Modified: trunk/source/tones.py
==============================================================================
--- trunk/source/tones.py (original)
+++ trunk/source/tones.py Tue Apr 22 09:21:43 2008
@@ -4,6 +4,8 @@
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
 
+"""Utilities to generate and play tones"""
+
 import nvwave
 import struct
 import math
@@ -19,6 +21,16 @@
 player = nvwave.WavePlayer(channels=2, samplesPerSec=int(sampleRate), bitsPerSample=16, outputDeviceNumber=config.conf["speech"]["outputDevice"])
 
 def beep(hz,length,left=50,right=50):
+ """Plays a tone at the given hz, length, and stereo balance.
+ @param hz: pitch in hz of the tone
+ @type hz: float
+ @param length: length of the tone in ms
+ @type length: integer
+ @param left: volume of the left channel (0 to 100)
+ @type left: integer
+ @param right: volume of the right channel (0 to 100)
+ @type right: float
+ """
  globalVars.log.info("Beep at pitch %s, for %s ms, left volume %s, right volume %s"%(hz,length,left,right))
  hz=float(hz)
  player.stop()