X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=tools%2Fgen_sound.py;h=be544283d657687a460063feb78d22945ada0817;hb=9683b3476bd856646688de2729009fec8af76460;hp=bf2c10d0b728612269777913e5aaa533fe6f299a;hpb=d5b40ebebac451779deb4631972d3076b2b02d45;p=naja.git diff --git a/tools/gen_sound.py b/tools/gen_sound.py index bf2c10d..be54428 100644 --- a/tools/gen_sound.py +++ b/tools/gen_sound.py @@ -11,7 +11,7 @@ import math import struct OUTPUT_RATE = 8125 -MAX = 95 +DEFAULT_VOL = 95 def gen_sine(freq, secs, volume): filename = 'beep%s.pcm' % freq @@ -36,7 +36,7 @@ def usage(): print 'Usage gen_sound [] []' print ' where is the frequency in Hz (int)' print ' [] is the time in seconds (float) - default 0.25' - print ' and [] is the volume (integer between 0 and 127) - default %s' % MAX + print ' and [] is the volume (integer between 0 and 127) - default %s' % DEFAULT_VOL if __name__ == "__main__": @@ -49,7 +49,7 @@ if __name__ == "__main__": if len(sys.argv) > 3: volume = int(sys.argv[3]) else: - volume = MAX + volume = DEFAULT_VOL except Exception, exc: usage() print 'Error was', exc