A brief history of two-way audio
In previous years, we have used a few methods to do two-way audio. Initially we had a speech to text and back again system to transmit data. Needless to say, this was quite limiting and not particularly… well, good.
This was replaced in 2018 with Mumble, a basic VoIP / chatroom server and client.
Ideally we were looking for a CLI VoIP server to put on the robot and a GUI client for the control panel but we couldn’t really find any decent command-line VoIP servers, so we chose Mumble as it was pretty simple and free.
We did also experiment with some actual VoIP software (specifically Linphone) but all we had was issue after issue. We settled on Mumble, despite the lack of a CLI server, and I implemented it in an afternoon, a couple weeks before the competition.
There wasn’t (and perhaps still isn’t) a Mumble command-line server that I know of, so we ran the GUI server within a very hacky virtual X11 server onboard the robot. The control panel then ran the Mumble desktop client which connected to the server. This solution was very problematic, we couldn’t see any errors or anything on the GUI since the server didn’t include a CLI version we could use instead.
So I can very loudly declare: It’s time for a proper solution.
The proposed solution
A while back I discovered Roc. It’s a general-purpose C API and command-line tool which provides real-time audio streaming over a network. I’ve had this bookmarked for like a year, it’s time to give it a shot.
Check out some of the features (I’ve emboldened features that I think are especially important to us):
– real-time streaming with guaranteed latency;
– restoring lost packets using Forward Erasure Correction codes;
– converting between the sender and receiver clock domains;
– CD-quality audio;
– multiple profiles for different CPU and latency requirements;
– relying on open, standard protocols;
– detecting and restarting broken streams;
– mixing simultaneous streams from multiple senders on the receiver;
– binding receiver to multiple ports with different protocols;
Also have a look at this page of the docs which explains how to use the included command-line tools which sound almost perfect for our use already. Also while we’re at it, this is a very comprehensive tutorial on using Roc.
At the moment, I plan on using this since it seems perfect for our use case, but of course, if it turns out to not be suitable then we’ll have a look at other options.
But at the very least, I can leave you with this lovely blog post.
Let’s see how it goes.