Merge pull request #1008 from romanz/master
audio_modem: update plugin to work with latest amodem version.
This commit is contained in:
@@ -15,8 +15,7 @@ import platform
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
import amodem.audio
|
import amodem.audio
|
||||||
import amodem.recv
|
import amodem.main
|
||||||
import amodem.send
|
|
||||||
import amodem.config
|
import amodem.config
|
||||||
print_error('Audio MODEM is available.')
|
print_error('Audio MODEM is available.')
|
||||||
amodem.log.addHandler(amodem.logging.StreamHandler(sys.stderr))
|
amodem.log.addHandler(amodem.logging.StreamHandler(sys.stderr))
|
||||||
@@ -115,7 +114,7 @@ class Plugin(BasePlugin):
|
|||||||
with self._audio_interface() as interface:
|
with self._audio_interface() as interface:
|
||||||
src = BytesIO(blob)
|
src = BytesIO(blob)
|
||||||
dst = interface.player()
|
dst = interface.player()
|
||||||
amodem.send.main(config=self.modem_config, src=src, dst=dst)
|
amodem.main.send(config=self.modem_config, src=src, dst=dst)
|
||||||
except Exception:
|
except Exception:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
@@ -132,7 +131,7 @@ class Plugin(BasePlugin):
|
|||||||
with self._audio_interface() as interface:
|
with self._audio_interface() as interface:
|
||||||
src = interface.recorder()
|
src = interface.recorder()
|
||||||
dst = BytesIO()
|
dst = BytesIO()
|
||||||
amodem.recv.main(config=self.modem_config, src=src, dst=dst)
|
amodem.main.recv(config=self.modem_config, src=src, dst=dst)
|
||||||
return dst.getvalue()
|
return dst.getvalue()
|
||||||
except Exception:
|
except Exception:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|||||||
Reference in New Issue
Block a user