mirror of
https://github.com/romanz/amodem.git
synced 2026-03-07 07:29:42 +08:00
stream: move defaults to class variables
This commit is contained in:
@@ -64,7 +64,7 @@ def main(config, src, dst, pylab=None):
|
||||
training_duration = sender.offset
|
||||
log.info('Sending %.3f seconds of training audio', training_duration / Fs)
|
||||
|
||||
reader = stream.Reader(src, bufsize=(64 << 10), eof=True)
|
||||
reader = stream.Reader(src, eof=True)
|
||||
data = itertools.chain.from_iterable(reader)
|
||||
bits = framing.encode(data)
|
||||
log.info('Starting modulation')
|
||||
|
||||
@@ -3,14 +3,14 @@ import time
|
||||
|
||||
class Reader(object):
|
||||
|
||||
def __init__(self, fd, data_type=None, bufsize=4096,
|
||||
eof=False, timeout=2.0, wait=0.2):
|
||||
wait = 0.2
|
||||
timeout = 2.0
|
||||
bufsize = 4096
|
||||
|
||||
def __init__(self, fd, data_type=None, eof=False):
|
||||
self.fd = fd
|
||||
self.data_type = data_type if (data_type is not None) else lambda x: x
|
||||
self.bufsize = bufsize
|
||||
self.eof = eof
|
||||
self.timeout = timeout
|
||||
self.wait = wait
|
||||
self.total = 0
|
||||
|
||||
def __iter__(self):
|
||||
|
||||
Reference in New Issue
Block a user