casebeer / afsk

AFSK – Bell 202 Audio Frequency Shift Keying encoder and APRS client
BSD 2-Clause "Simplified" License
83 stars 22 forks source link

Choppy Audio #4

Open ampledata opened 7 years ago

ampledata commented 7 years ago

Opening this to track the issue, with more details to come, but:

On my specific setup, whenever I try to pass audio directly to the sound card, the output is choppy (i.e. incremental delays in audio playback).

Outputting to a wav file, and playing back (using aplay) through the same sound card is OK.

I've found that replacing the following line in afsk.py:encode() eliminates the problem:

        #multiply(modulate(framed_data), constant(0.5)),
        modulate(framed_data),

To Reproduce:

$ ALSA_CARD=Device aprs -c W2GMD "Test"

Versions:

Python 2.7.9

afsk==0.0.3 audiogen==0.1.2 bitarray==0.8.1 PyAudio==0.2.10

portaudio19-dev 19+svn20140130-1 libportaudio2:armhf 19+svn20140130-1

Linux latrans 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linux

Distributor ID: Raspbian Description: Raspbian GNU/Linux 8.0 (jessie) Release: 8.0 Codename: jessie

Audio Output:

card 1: Device [C-Media USB Audio Device], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0