← All posts

The prototype: can a phone record a story without losing anything?

· 3 min read · Przeczytaj po polsku

We spent the first two days of coding on the hardest questions. How do you keep a recording when the app is killed? Which microphone sounds better? Can the preview sound exactly like the export?

Diagram of a recording split into one-second blocks. Six blocks saved with a checksum, the seventh in progress, then a crash. After the restart the app recovers 6 seconds.
Recording in one-second blocks. After a crash you lose at most the last, unfinished second.

The third post in the series about how Tellavio is being built.

The plan gave the technical prototype three to four weeks. The first working test screen appeared on 5 October, and measurements on real phones followed on 6 October. The prototype was not pretty. It had one job: to find out whether we could build recording you can trust.

A recording that survives a crash

A phone is not a studio. It can ring, the system can close the app in the background, the battery can run out. That is why Tellavio does not keep a take in memory until the end. It writes it as it goes, in short blocks, and every block gets a checksum in a log. After a restart the app checks the log and rebuilds every valid block.

How long should a block be? We measured it on a Galaxy S21 Ultra by killing the app mid-recording. With two-second blocks we lost 0.73 s on average and 1.52 s at most. We chose one-second blocks: the loss is halved, and the cost is one small write per second.

An important rule: the app does not promise to recover every sample. It says honestly how much it recovered, for example “Recovered 00:31”.

Mock-up of the interrupted session recovery screen: the message “The recording was interrupted”, the recovered time, a play button and a choice to keep, record again or move to the bin.
Mock-up of the interrupted session recovery screen (T21), in Polish.

We also tested an incoming call during a take. The app stopped recording and, after the call, recovered 38.26 s out of 38.5 s. In a test with the screen off, a take of more than two minutes had no gaps in the sound.

Which microphone?

Android offers several microphone “sources”. You would think the raw, unprocessed one is best. The measurement said otherwise. On the Galaxy S21 Ultra, with the same text at the same distance, the voice from the regular source was 48 dB above the background, and from the raw source only 23 dB. The raw recording was so quiet that it could not be raised sensibly. The cheaper Galaxy A16 gave the same result.

We also decided that the app does not record through Bluetooth headset microphones. Headsets then send your voice like a phone call, usually at 16 kHz and heavily compressed. The phone’s built-in microphone records at 48 kHz. Bluetooth headphones are for listening only, and a wired USB-C microphone gives even better sound.

The preview sounds like the export

In many programs the preview and the export are two different calculations that drift apart over time. Tellavio has one. The same code mixes voice and music, ducks the music under the voice, levels loudness to −16 LUFS (a typical podcast level) and keeps peaks in check. A test compares, sample by sample, what you hear in your headphones with what ends up in the file. The difference never exceeds the smallest step of 16-bit audio.

We tried Google’s ready-made solution (Media3). It produced the same sound, but was 4.4 times slower and could neither duck music under the voice nor level loudness. We stayed with our own code.

Decisions after the prototype

By 6 October the first eleven decisions had been made, most of them based on measurements. A few of them:

  • a native Android app (Kotlin), because most of the work is the audio engine, not the interface,
  • finished files in M4A (128 kbps), which browsers, Android and iOS play natively, plus WAV for those who want to keep editing,
  • projects up to 60 minutes, with up to two music beds and two effects at once.

The prototype did its job. The next step was an app you could actually use.