Monday, April 24, 2017

Using rtl_fm with the sox play command on Windows

The documentation for rtl_fm is really good, but the "play" command does not work using the current Windows version of SoX.  To get it to work, do the following:

  • Download and install the latest SoX for Windows, and set it up on your PATH
    • do NOT rename sox.exe, despite what the original rtl_fm documentation states
  • Follow this stackoverflow comment to acquire and install libmad-0.dll and lbmp3lame-0.dll:
  • Get the RTL-SDR API release zip for Windows:
  • Unzip this, open a command prompt, and navigate to this directory's x32 folder.  
  • Plug in your RTL-SDR (assuming you've already installed its driver using Zadig or similar means)
  • Run the following command:

rtl_fm.exe -M fm -s 200k -A fast -r 48k -l 0 -E deemph -f 97.29M | sox -V1 -b 16 -c 1 -e signed-integer -r 48k -t raw - -t waveaudio default

Change "-f 97.29M" to the frequency of a local radio station for testing.  I've tweaked the rates to better work with my NooElec NESDR Mini 2.  

The C source code for rtl_fm can be found here: