AppStars

Bacardi, 2006

B-Live Radio for Bacardi: the world's first radio streaming app for mobile phones.

In 2006 we built B-Live Radio for Bacardi, the world's first radio streaming application for mobile phones. It played live internet radio on Motorola, Sony Ericsson and Nokia Series 60 handsets, in English and German, using a hand-written Shoutcast client, a threaded buffer and two media players taking turns.

Client
Bacardi
Industry
Media & brands
Services
Mobile apps, streaming audio, branded apps
Platforms
Java ME (CLDC 1.1, MIDP 2.0, MMAPI) on Motorola, Sony Ericsson and Nokia Series 60; built on our MIAD SDK
Our role
We designed and built the app, its streaming engine and the per-handset builds.

The challenge

Phones of 2006 could play a ringtone. Bacardi wanted a branded app that played a radio station that never ends. Most handsets were on GPRS, with 3G only starting to appear: bandwidth was low, latency high, and connections could stall for seconds. Users paid for every kilobyte, so the stream had to be low bit-rate and the app couldn't waste a byte.

The Mobile Media API on Java phones was built for clips. It expected a complete, finite stream: a sound file or a ringtone. Hand it a live socket and most phones either refused or waited forever for the end. Each manufacturer's implementation buffered, started and reported events in its own way, and a few hundred kilobytes of heap had to hold the app, its screens and the audio in flight.

Our approach

  • Build on MIAD. B-Live used MIAD, our server-driven UI SDK. The radio player was one more widget, and the main radio page came from our server, so settings could change without a new jar.
  • Never give the media API a live stream. Give it a series of small, finished streams instead, and hide the joins.
  • Put the tuning where it can change. Buffer sizes and timeouts lived in the page, not in code.
  • Test on real devices. Emulators couldn't show how a handset behaved on a real network; only real phones told us which settings each family needed.
  • Every failure gets a message. No connection, no stream headers, no metadata: each had a clear message or fallback instead of a silent hang.

What we built

A hand-written Shoutcast client

Shoutcast stations spoke ICY, a close cousin of HTTP. Java ME's HTTP support was too inconsistent to trust with a stream that never ends, so we opened a raw socket and wrote the request ourselves, identifying as a desktop player because that's what stations expected. The client read the headers, checked for a successful response, and picked out the station name and the metadata interval. If a station offered no metadata, it reconnected without asking for it and played the audio anyway.

"Now playing" from the stream

With metadata on, the server interleaves a small text block into the MP3 every so many bytes. Leave it in and the player hears noise; take it out and you have the current song. The network thread counted audio bytes, split any read that contained a metadata block, passed the audio on and pulled out the title, updating the screen only when it changed. The German builds showed "Jetzt spielend".

A bounded buffer between network and audio

Between the network and the player sat a classic bounded producer–consumer buffer. The network thread waited when it was full; the player side waited until a full piece was ready. Two settings did the tuning: a maximum buffer of 60,000 bytes by default capped memory, and a minimum play size of 23,000 bytes by default set how much audio each piece carried. Bigger pieces rode out longer stalls but started slower and used more heap.

Two players taking turns

Each piece became its own small, finished MP3 with its own player. As soon as one player started, the other was created, realised and prefetched with the next piece; when one reached its end, the other started. Preparing the next player while the current one played is what made continuous playback possible. Old players were explicitly closed before replacement, because on a tiny heap a leaked player soon became a crash.

Per-handset tuning, 18 builds

Phone families handled the hand-over differently, so buffer size, piece size and both timeouts were attributes on the widget in the page. A family could be retuned by changing a page on the server, not by redistributing jars. B-Live shipped as 18 jars: six handset groups, each in English, German and a rest-of-world build, between 84 KB and 93 KB each.

Architecture

A live stream turned into a series of finished ones.

  1. Radio stationShoutcast MP3 with metadata blocks
  2. ICY clientRaw socket, hand-written request
  3. Metadata splitSong title to the screen, audio onward
  4. Bounded bufferNetwork and audio at their own speeds
  5. Player A and Player BTaking turns, one always prefetched

Buffer and timeout settings came from the server-side page.

Results

Under the hood

Gapless radio on a phone built for ringtones.

Why it matters now

There was no AI in B-Live Radio. What carried forward is the plumbing. AI that listens, such as speech recognition on a phone or on smart glasses, depends on the same things: audio arriving at an unpredictable rate, a bounded buffer that protects memory, pieces sized for the model and a pipeline that keeps going when the network hiccups. Our wearables and edge AI work streams audio and camera frames from glasses to a paired device, and our computer vision and speech work runs on the same discipline.

Streaming over poor networks on constrained devices is still everyday work: field crews in patchy coverage and apps on cheap phones. That's how we build mobile and field apps. The Mobstar Games story has more from the era.

Lessons for today

  • Buffer deliberately. Every streaming system trades start-up time against resilience against memory. Make that trade explicit and adjustable, not an accident of defaults.
  • Prepare the next step before you need it. Prefetching the next player is the same idea as warming the next model or preloading the next screen: hide latency by doing work early.
  • Keep tuning in configuration. Device-specific fixes belong in data you can change remotely, so a fix for one phone can't break another.
  • Own the resource lifecycle. On constrained devices, release what you create, explicitly and promptly. Leaks become crashes faster than you think.
  • Work with the brand, build for the user. The brand cared about its experience on a phone; the listener cared that the music didn't stop. Good work satisfies both.

Questions

What was B-Live Radio?

A branded app we built for Bacardi in 2006: the world's first radio streaming application for mobile phones, playing live internet radio in English and German.

How did it stream on phones built for short clips?

It cut the live stream into small, finished MP3 pieces and played them with two media players taking turns, preparing the next piece while the current one played.

Which phones did it run on?

Motorola, Sony Ericsson and Nokia Series 60 handsets, in 18 builds across six handset groups.

How was it tuned for each phone?

Buffer size, piece size and timeouts were settings in a page served from our server, so a phone family could be retuned without a new download.

Related

The services behind this work, and more stories like it.

Services

Case studies

Bring us the hard problem.

A 45-minute discovery call with the engineer who'll build it.