mirror of
https://github.com/romanz/amodem.git
synced 2026-03-27 05:19:04 +08:00
better aplay/arecord command logging
This commit is contained in:
5
wave.py
5
wave.py
@@ -1,6 +1,9 @@
|
||||
import os
|
||||
import signal
|
||||
import subprocess as sp
|
||||
import logging
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
from common import Fs
|
||||
|
||||
@@ -11,7 +14,7 @@ def record(fname, **kwargs):
|
||||
return launch('arecord', fname, '-q', '-f', 'S16_LE', '-c', '1', '-r', str(int(Fs)), **kwargs)
|
||||
|
||||
def launch(*args, **kwargs):
|
||||
print args
|
||||
log.debug('$ %s', ' '.join(args))
|
||||
p = sp.Popen(args=args, **kwargs)
|
||||
p.stop = lambda: os.kill(p.pid, signal.SIGINT)
|
||||
return p
|
||||
|
||||
Reference in New Issue
Block a user