From 9683b3476bd856646688de2729009fec8af76460 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 15 May 2014 21:00:45 +0200 Subject: [PATCH] rename constant --- tools/gen_sound.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.34.1