commit 8646ce4d6edb13655d64eadb6cc865bba26361ae
parent 46217e670560561c07474b702c6d1216ee9c6e87
Author: umhau <umhau@alum.gcc.edu>
Date: Wed, 14 Jun 2017 23:44:39 -0400
cleaned.
Diffstat:
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/lib/getaudio.py b/lib/getaudio.py
@@ -2,23 +2,23 @@
#
# DESCRIPTION
#
-# getaudio is used to sequentially prompt the user for dictations of displayed sentences.
+# getaudio is used to sequentially prompt the user for dictations of
+# displayed sentences.
#
-# DEPENDENCIES
-#
-# python3-pyaudio, python3
+# DEPENDENCIES: python3-pyaudio, python3
#
# USAGE
#
-# python3 getaudio.py sentence-file /output/folder recording-repetitions model-name
+# python3 getaudio.py sentence-file \
+# /output/folder \
+# recording-repetitions \
+# model-name
#
-# LIBRARY IMPORTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# LIBRARY IMPORTS -------------------------------------------------------------
import sys, os, _thread, pyaudio, wave, contextlib
-# VARIABLE DEFINITIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-pronunciation_dictionary="cmudict-en-us.dict"
+# VARIABLE DEFINITIONS --------------------------------------------------------
chunk = 1024
FORMAT = pyaudio.paInt16
@@ -26,14 +26,10 @@ CHANNELS = 1
RATE = 16000
sentence_file = sys.argv[1]
-
output_folder = sys.argv[2].rstrip(os.sep)
-
reps = int(sys.argv[3])
-
model_name = sys.argv[4]
-
# FUNCTION DEFINITIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ignore sdterr messages: as from pyaudio