KiwiSDR Sound Client

Based on the kiwiclient python script, this will connect to a local or remote KiwiSDR, and stream the audio to a virtual audio device on your computer in real time, so you can route it to a decoding program, such as for SSTV, FAX, RTTY, and so on.

First a warning, this code is not a piece of art. It was quickly thrown together so I could route audio to decoding apps. It certainly needs some work :)

The original kiwiclient is available here: https://github.com/jks-prv/kiwiclient

You will want to download that first.

If you don't have pip installed, you need it: sudo easy_install pip

You also need to make sure you have the python sounddevice library installed, if not, install it: python -m pip install sounddevice --user

And you need numpy if you don't have it already: python -c "import numpy"

On Windows I used: pip install numpy

The script requires the device number of the sound device to route audio to, this can be done with python -m sounddevice

$ python -m sounddevice
   0 Built-in Microphone, Core Audio (2 in, 0 out)
<  1 Built-in Output, Core Audio (0 in, 2 out)
   2 HDMI, Core Audio (0 in, 2 out)
   3 USB Audio Device, Core Audio (1 in, 2 out)
   4 iMic USB audio adapter, Core Audio (0 in, 2 out)
   5 iMic USB audio adapter, Core Audio (2 in, 0 out)
>  6 Soundflower (2ch), Core Audio (2 in, 2 out)
   7 Soundflower (64ch), Core Audio (64 in, 64 out)
   8 Aggregate Device, Core Audio (6 in, 2 out)
   9 Aggregate Device2, Core Audio (4 in, 0 out)
  10 Multi-Output Device, Core Audio (0 in, 2 out)
In this case, my virtual audio device, SoundFlower, is device number 6.

Here's an example, streaming audio from my KiwiSDR tuned to 14230 USB for decoding SSTV: python kiwisound.py -s sdr.hfunderpants.com -p 8073 -f 14230.0 -m usb -L 700 -H 3000 --out-device 6 --ncomp --resample 12000 --echo

Let's break down the arguments:

-s sdr.hfunderpants.com The url of the KiwiSDR
-p 8073 The port number
-m usb The mode, USB in this case
-L 700  The lower IF filter frequency
-H 3000 The upper IF filter frequency, we're using 700-3000 Hz to get just the SSTV audio
--out-device 6 The number of the sound device to route audio to
--ncomp No compression
--resample 12000 Resample the audio to 12000 Hz
--echo Echo the sound to the default sound output device, in addition to the specified output device

Download a copy of kiwisound.py: https://www.blackcatsystems.com/download/kiwisound.py.zip (September 15, 2019)

In order to get the good quality resampling, the script should use libsamplerate, install it with:

pip install samplerate

Thanks to Jeffrey Randow (N5SNT) who let me know that this line needs to be added due to S_meter support added to the most recent version of kiwiclient, at line 33:

options.S_meter = False
(This addition is in the current version of kiwisound on this page, I am mentioning this for anyone who has an older copy)

And another change... well a few... to deal with the changes made to kiwiclient around September 5, 2019:

Change lines 11 and 12 from:

from kiwiclient import KiwiSDRStream
from kiwiworker import KiwiWorker
to
from kiwi import KiwiSDRStream, KiwiWorker
and you need to add this as well around line 34
options.ADC_OV = False

Now maybe you need some apps to decode SSTV, FAX, or other modes?? Look on the left side of your browser window, I have lots to choose from :)


Email your comments and questions to info@blackcatsystems.com

Last modified September 18, 2019