Audiobus’ Self-Repairing Audio Stream

Audiobus signal repair algorithm demonstration

I’m just finishing up working on Audiobus’s new stream self-repair code, which will automatically regenerate missing audio caused by an overloaded device or excessive network loss.

Audiobus already contains a mechanism to automatically recover audio packets that go missing in-transit, but if the app you are using uses Audiobus’s low-latency mode (instead of the normal, lossless ‘production-quality’ mode suitable for high-quality recording), this will not be used, as it creates too much delay in the signal.

When an audio packet gets lost, you get a hole in the audio, which causes a noticeable click. Audiobus’s new self-repair mechanism automatically recognises and patches these holes with a new chunk of audio that’s derived from the surrounding context. It won’t be exact, but it’s usually pretty damn good. Plus, it’s all built using the speedy Accelerate vector DSP framework, so it’s very light.

This is a recording of the same audio segment played twice - one version with a hole due to a lost packet, and one version after running Audiobus’s self-repair algorithm. Click: gone!

// Michael

Tags: DSP audio
Fun with automatic signal repair, in the event of overloaded devices or high network loss (extreme example).

Fun with automatic signal repair, in the event of overloaded devices or high network loss (extreme example).

Tags: audio DSP

SoundPrism on an iPhone 4 + Loopy HD on an iPad + Audiobus over WiFi, now with network latency compensation.

This is unbelievably good fun.

The first piece of music to be created using Audiobus! This was made on an iPad using Loopy HD by streaming audio with Audiobus from a synth demo app running on an iPhone.

Sebastian explains how Audiobus is going to be launched.

Multiplexing

Wanna see how the sausage gets made? No? Too bad, I’m showing you anyway.

When I first built the prototype for Audiobus, it was receiving from only one source at a time, which made it pretty simple to handle - just buffer the audio coming in over the communications system and pump it out the other end as needed.

For the Real Deal, we wanna have multiplexed sources, though, which can be saved to a multichannel recording - one channel per source. For developers, it’s gotta be really easy - you’ll be able to specify whether you want the audio coming in as multi-channel, or all mixed together into one stereo stream. Plus, it’s gotta work in live mode - preferring low latency to perfect data integrity - and in recording mode, preferring perfect data integrity over latency.

It took a bit of pondering and circles-and-arrows drawing, but I think I’ve got it nailed, using audio timestamps to figure out where in the global timeline each piece of audio needs to be placed while recording.

The upshot of all this is that it’ll seamlessly record multiple sources in sync, negating any latency or jitter problems.  Whew!

// Michael