projects
/
naja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d5b40eb
)
rename constant
author
Neil
<neil@dip.sun.ac.za>
Thu, 15 May 2014 19:00:45 +0000
(21:00 +0200)
committer
Neil
<neil@dip.sun.ac.za>
Thu, 15 May 2014 19:00:45 +0000
(21:00 +0200)
tools/gen_sound.py
patch
|
blob
|
history
diff --git
a/tools/gen_sound.py
b/tools/gen_sound.py
index bf2c10d0b728612269777913e5aaa533fe6f299a..be544283d657687a460063feb78d22945ada0817 100644
(file)
--- a/
tools/gen_sound.py
+++ b/
tools/gen_sound.py
@@
-11,7
+11,7
@@
import math
import struct
OUTPUT_RATE = 8125
import struct
OUTPUT_RATE = 8125
-
MAX
= 95
+
DEFAULT_VOL
= 95
def gen_sine(freq, secs, volume):
filename = 'beep%s.pcm' % freq
def gen_sine(freq, secs, volume):
filename = 'beep%s.pcm' % freq
@@
-36,7
+36,7
@@
def usage():
print 'Usage gen_sound <freq> [<length>] [<volume>]'
print ' where <freq> is the frequency in Hz (int)'
print ' [<length>] is the time in seconds (float) - default 0.25'
print 'Usage gen_sound <freq> [<length>] [<volume>]'
print ' where <freq> is the frequency in Hz (int)'
print ' [<length>] is the time in seconds (float) - default 0.25'
- print ' and [<volume>] is the volume (integer between 0 and 127) - default %s' %
MAX
+ print ' and [<volume>] is the volume (integer between 0 and 127) - default %s' %
DEFAULT_VOL
if __name__ == "__main__":
if __name__ == "__main__":
@@
-49,7
+49,7
@@
if __name__ == "__main__":
if len(sys.argv) > 3:
volume = int(sys.argv[3])
else:
if len(sys.argv) > 3:
volume = int(sys.argv[3])
else:
- volume =
MAX
+ volume =
DEFAULT_VOL
except Exception, exc:
usage()
print 'Error was', exc
except Exception, exc:
usage()
print 'Error was', exc