mirror of
https://github.com/romanz/amodem.git
synced 2026-02-24 16:18:12 +08:00
wave: fix filename argument usage
This commit is contained in:
@@ -14,7 +14,7 @@ fmt = 'coherence={:.3f} amplitude={:.3f} phase={:+.1f} peak={:.3f}\n'
|
||||
|
||||
|
||||
def send(wave_play=wave.play):
|
||||
p = wave_play('-', stdin=wave.sp.PIPE, stderr=open('/dev/null'))
|
||||
p = wave_play(stdin=wave.sp.PIPE, stderr=open('/dev/null'))
|
||||
try:
|
||||
while True:
|
||||
try:
|
||||
@@ -26,7 +26,7 @@ def send(wave_play=wave.play):
|
||||
|
||||
|
||||
def recv(wave_record=wave.record, reporter=sys.stdout.write):
|
||||
p = wave_record('-', stdout=wave.sp.PIPE)
|
||||
p = wave_record(stdout=wave.sp.PIPE)
|
||||
try:
|
||||
while True:
|
||||
data = p.stdout.read(len(sig_dump))
|
||||
|
||||
@@ -16,7 +16,7 @@ bytes_per_second = bytes_per_sample * Fs
|
||||
audio_format = 'S{}_LE'.format(bits_per_sample) # PCM signed little endian
|
||||
|
||||
|
||||
def launch(tool, fname, **kwargs):
|
||||
def launch(tool, fname='-', **kwargs):
|
||||
args = [tool, fname, '-q', '-f', audio_format, '-c', '1', '-r', str(Fs)]
|
||||
log.debug('running: %r', args)
|
||||
p = sp.Popen(args=args, **kwargs)
|
||||
|
||||
@@ -21,7 +21,7 @@ player.add_argument(
|
||||
player.set_defaults(func=wave.play)
|
||||
|
||||
args = parser.parse_args()
|
||||
p = args.func(args.filename)
|
||||
p = args.func(fname=args.filename)
|
||||
|
||||
import sys
|
||||
exitcode = 0
|
||||
|
||||
Reference in New Issue
Block a user