|
a/samplescripts/Analog-Input |
|
b/samplescripts/Analog-Input |
|
... |
|
... |
139 |
|
139 |
|
140 |
signal.signal(signal.SIGINT, sighandler)
|
140 |
signal.signal(signal.SIGINT, sighandler)
|
141 |
signal.signal(signal.SIGTERM, sighandler)
|
141 |
signal.signal(signal.SIGTERM, sighandler)
|
142 |
|
142 |
|
143 |
|
143 |
|
144 |
# Execute pre-script if it is set
|
144 |
# Execute pre-script if it is set. We read and discard its stdout (else if
|
|
|
145 |
# would confuse upmpdcli which expects informations on the first output line).
|
145 |
if prescript:
|
146 |
if prescript:
|
146 |
subprocess.check_call(prescript)
|
147 |
subprocess.check_output(prescript)
|
147 |
|
148 |
|
148 |
# -f S16_LE -c 2 -r 44100
|
149 |
# -f S16_LE -c 2 -r 44100
|
149 |
try:
|
150 |
try:
|
150 |
recordproc = subprocess.Popen(('arecord', '-D', device,
|
151 |
recordproc = subprocess.Popen(('arecord', '-D', device,
|
151 |
'-f', 'cd', '-t', 'raw', '-'),
|
152 |
'-f', 'cd', '-t', 'raw', '-'),
|