In the latest release of the Chirp Python SDK [v3.4.2], we are proud to announce that it now comes with full support for Windows!
The Python SDK is one of the easiest ways to start experimenting with Chirp, with added command line tools that enable you to send and receive data over sound within minutes.
Installing the SDK is as simple as
pip install chirpsdk
Actually not quite — the SDK relies on having PortAudio installed. You could install this from source, but the preferred method is to install the precompiled sounddevice package from the awesome library maintained by Christoph Gohlke.
Download the appropriate sounddevice binary for your version of Python and Windows from here.
Now you should be able to start sending and receiving data over sound.
from chirpsdk import ChirpConnect, CallbackSet class Callbacks(CallbackSet): def on_received(self, payload, channel): print(str(list(payload))) sdk = ChirpConnect(app_key, app_secret) sdk.set_callbacks(Callbacks()) sdk.start() payload = sdk.new_payload([0, 1, 2, 3]) sdk.send(payload)
One thing to note is that Windows tends to have many different variants of audio drivers, so you may find that you have to set the input/output audio device like so
sdk.audio.query_devices() sdk.audio.input_device = 2 sdk.audio.output_device = 4
If you would like to get set up with Chirp on the command line, you will need to instruct Python to open the scripts with python.exe. There are a couple of ways to achieve this.
- Set the PATHEXT environment variable to include .py files. You can open cmd.exe as an administrator and run
setx PATHEXT %PATHEXT%;.PY
2. Alternatively, when you are prompted with the ‘How do you want to open this file’ popup, you can just select python.exe. On my machine this was located at
On Windows it is also common for the system to run audio processing on the input signal. You may need to turn this off for Chirp to be able to access the full spectrum. Go to your Recording device properties, and disable any audio enhancements.
For further documentation on the Python SDK and running Chirp on the command line, head over to developers.chirp.io.