top of page

Raspberry Pi as Audio Streaming Client

  • Writer: Jacek Jarmulak
    Jacek Jarmulak
  • Apr 16, 2019
  • 2 min read

Updated: May 31, 2019


Raspberry Pi 3 B+ Motherboard
Raspberry Pi 3 B+ Motherboard

You can stream audio for VoiceGain transcription API from any computer, but sometimes it is handy to have a dedicated inexpensive device just for this task. Below we relay experiences of one of our customers in using a Raspbery Pi to stream audio for real time transcription. It replaced a Mac Mini which was initially used for that purpose. Using Pi had two benefits: a) obviously the cost, and b) it is less likely than Mac Mini to be "hijacked" for other other purposes.


Hardware

VoiceGain Audio Streaming Daemon requires very little as far as computing resources, so in even a Raspberry Pi Zero is sufficient ; however, we recommend using Raspberry Pi 3 B+ mainly because it has on-board 1Gbps wired Ethernet port. WiFi connections are more likely to have problems with streaming using UDP protocol.


Here is a list of all hardware used in the project (with current amazon prices):

  • Element14 Raspberry Pi 3 B+ Motherboard - $37.78

  • Miuzei Raspberry Pi 3 b+ Screen, 3.5 Inch - $23.99

  • Miuzei 3.5 Inch Screen Case for 3.5 LCD - $9.99

  • iPazzPort Wireless Mini Handheld Keyboard - $13.99

  • UGREEN USB Audio Adapter - $8.99

  • SanDisk Ultra 32GB microSDHC UHS-I card - $7.23

  • plus some existing USB 5V power supply was use.

All the components added up to a total of $101.97. The reason why a mini monitor and a mini keyboard were included is that they make it more convenient to control the device while it is in the audio rack. For example, the alsa audio mixer can be easily adjusted this way, while at the same time monitoring the level of the audio via headphones.



Raspberry PI running AudioDaemon
Raspberry PI running AudioDaemon


Software

The device is running standard Raspbian which can easily be installed from an image using e.g. balenaEtcher. After install little else was needed to get things running:

  • enable ssh access

  • change default audio device to USB sound card (Raspbian comes default with alsa and basic USB sound drivers)

  • installing driver for the display (otherwise output is too tiny and not readable)

  • installing OpenJDK

  • downloading VoiceGain AudioDaemon jar file and sample JSON config

  • tweaking the AudioDaemon config (setting JWT authentication and websocket name) and launching the daemon

Observations

Here are some lessons learned from using this setup over the past 6 months:

  • While streaming the CPU use stays under 10%

  • Raspberry Pi turned out to be very reliable - we have not had a single issue with the hardware nor with the Raspbian OS

  • Cheap USB audio card delivers very good sound quality (for speech recognition at least)

  • Very cheap USB power supplies should be avoided - sometimes they cause a hum in the audio (but that also depends on what audio device is being connected).


Comentários


bottom of page