How to use the amodem.main.recv function in amodem

To help you get started, we’ve selected a few amodem examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github romanz / amodem / tests / test_transfer.py View on Github external
if chan is not None:
        data = chan(data)
    if df:
        sampler = sampling.Sampler(data, sampling.Interpolator())
        sampler.freq += df
        data = sampler.take(len(data))

    data = common.dumps(data)
    rx_audio = BytesIO(data)
    rx_data = BytesIO()
    dump = BytesIO()

    if reader:
        rx_audio = reader(rx_audio)
    try:
        result = main.recv(config=cfg, src=rx_audio, dst=rx_data,
                           dump_audio=dump, pylab=None)
    finally:
        rx_audio.close()

    rx_data = rx_data.getvalue()
    assert data.startswith(dump.getvalue())

    assert result == success
    if success:
        assert rx_data == tx_data
github AXErunners / electrum-axe / electrum_axe / plugins / audio_modem / qt.py View on Github external
def receiver_thread():
            with self._audio_interface() as interface:
                src = interface.recorder()
                dst = BytesIO()
                amodem.main.recv(config=self.modem_config, src=src, dst=dst)
                return dst.getvalue()
github etotheipi / BitcoinArmory / samplemodules / AudioTransferPlugin.py View on Github external
def receiveAudio():
         with AUDIO_INTERFACE:
            s = AUDIO_INTERFACE.recorder()
            src = async.AsyncReader(stream=s, bufsize=s.bufsize)
            dst = StringIO.StringIO()
            mainAudio.recv(CONFIG, src=src, dst=dst)
            self.debugWindow.setText(dst.getvalue())
github qtumproject / qtum-electrum / qtum_electrum / plugins / audio_modem / qt.py View on Github external
def receiver_thread():
            with self._audio_interface() as interface:
                src = interface.recorder()
                dst = BytesIO()
                amodem.main.recv(config=self.modem_config, src=src, dst=dst)
                return dst.getvalue()
github romanz / amodem / amodem / __main__.py View on Github external
        main=lambda config, args: main.recv(
            config, src=args.src, dst=wrap(Decompressor, args.dst, args.zlib),
            pylab=args.pylab, dump_audio=args.dump
        ),