AIdeazz Blog About Portfolio

The audio was broken for a month, and the tool in the middle kept fixing it

· by

A field note from the AIdeazz AI Lab — a real incident on a live production system, written up from the logs. September 4, 2026.

A voice reply was built by concatenating 24 kHz speech with 44.1 kHz silence. The transcoder silently repaired the malformed result, so every check downstream passed — valid container, clean decode, real audio, carrier reporting delivered — while users could not open the file.

What it looked like from outside

A language-tutor bot replies on a messaging platform with a spoken version of its answer. In tutor mode the voice note arrived but could not be opened at all — the platform offered a download control instead of a player, and tapping it produced "something is wrong with the audio file". In translate mode, on the same bot, the same account, minutes apart, voice replies played perfectly. The failure had been present for roughly a month. Nothing in the application logs recorded an error: the file was generated, uploaded, fetched by the carrier with HTTP 200, and reported back as delivered and read with a null error code. Every observable said success except the one that mattered, which was a person pressing play.

What was actually happening

The tutor reply is long, so it is assembled from several text-to-speech segments with generated silence between them, and the assembly was a byte-level concatenation of MP3 files. The speech segments came from the TTS vendor at 24000 Hz. The silence was generated separately at 44100 Hz. An MP3 stream whose sample rate changes partway through is malformed — frame headers stop agreeing with the stream, and timestamps derived from them run backwards. The decoder said so plainly on the way in with "Header missing", "Queue input is backward in time" and "Non-monotonic DTS". Translate mode was never affected because it produces one short utterance from a single voice with no pauses to splice, so it never mixed two sample rates. The defect needed BOTH conditions — a multi-segment reply and a rate mismatch — which is exactly why one mode was broken and the other was not.

The fix

Silence is now generated at 24000 Hz and the same bitrate as the speech, so the pieces agree by construction. Concatenation was moved off byte-appending and onto the transcoder's concat demuxer WITH a re-encode, so that any future mismatch — a vendor changing its output rate, a new segment source — is normalised rather than propagated. Two earlier diagnoses were wrong and are recorded because they cost the most time: a genuine bug where the generator returned an MP3 under an .ogg filename was found and fixed, but that path is not reachable from the broken mode, so fixing it changed nothing; and byte-concatenation was separately suspected on its own, then cleared by test — when every segment shares a format the byte-appended output is byte-identical to a properly muxed one.

How I know it worked

Proven at the boundary rather than on the finished file. Before the fix, running the producing pipeline with decoder warnings enabled printed the header and timestamp errors and showed the transcoder correcting timestamps as it went. The two candidate causes were falsified individually: the mislabelled-file bug was shown unreachable by tracing the mode's actual call path, and byte-concatenation was shown harmless by concatenating format-matched segments both ways and comparing checksums, which were identical. After the fix the same pipeline ran with no decoder warnings, and the operator confirmed playback in the previously broken mode on a real device. The isolation that made the diagnosis possible came from the operator, not from the logs — "translate mode works, tutor mode does not" converted an open-ended hunt into a difference between two artifacts from the same system.

The rule this earned

A tolerant component in the middle of a pipeline erases the evidence of a fault upstream of it. The transcoder here accepted a malformed stream, repaired the timestamps, and emitted a technically perfect file — so probing that file proved only that the repair had worked. Valid container, clean decode, plausible waveform, correct content type and a carrier reporting delivery were all true and all irrelevant, because every one of them was measured after the damage had been cleaned up. Inspect the INPUT to the tolerant step, not its output, and run the producing pipeline at a verbosity that shows what the consumer complained about. This generalises well past audio: a retry wrapper that swallows the first failure, a parser that accepts malformed input, a type coercion that quietly succeeds. And when one mode of a system works and another does not, that pair is worth more than any amount of reasoning about the broken one alone — it turns an unfalsifiable question into a diff.

The named concepts behind it

Naming a failure mode is what makes it possible to recognise the same shape somewhere new, before it costs another weekend.

Tolerance erases evidence

A component that repairs bad input destroys the proof that something upstream is broken.

Robustness is usually a virtue: be liberal in what you accept. The cost nobody mentions is that a component which accepts and repairs malformed input also deletes the only signal that the input was malformed.

The fault is real, upstream, and reproducible. But it never reaches an alert, because the tolerant component in the middle cleans up after it and hands the next stage something perfectly well-formed. Everything downstream then reports health — truthfully. You are measuring the repair, not the original.

This is what makes it worse than an ordinary [[silent-failure]]. There, nothing happened and nobody said so. Here, something did happen — a component detected damage and corrected it — and that detection was thrown away instead of raised.

The tell is that your evidence all comes from after the tolerant step. A file that decodes cleanly, a record that validates, a response that parses, a status that says delivered. All true. None of them can distinguish "the input was fine" from "the input was broken and got fixed on the way through", because the tolerant component has made those two cases produce identical output. Testing harder at that point cannot work; you are inspecting the wrong artifact.

Common forgiving middles:

The defence is three moves:

The related trap is diagnostic, not architectural: when one mode of a system works and another does not, that pair is worth more than any amount of reasoning about the broken one. It converts an unfalsifiable question — "why is this wrong?" — into a diff between two artifacts produced by the same code, which is a question with an answer.

Silent failure

The system did something reasonable, and told nobody.

The most expensive bug class there is, because the clock keeps running while everyone assumes things are fine.

A silent failure is not a crash. A crash is loud and gets fixed. A silent failure is a component making a defensible local decision -- drop this message, skip this record, return an empty string -- that nobody downstream is told about. From the outside, a system that is working perfectly and a system that is completely dead can produce the identical observation: nothing happened.

The defence is not "add more logging". It is to make the healthy state provable, so that "nothing happened" can be distinguished from "nothing was supposed to happen". Two things do that:

Verify from logs, not config

Configuration tells you what somebody intended. Logs tell you what happened.

A setting, an environment variable or a present API key is a statement of intent. It is evidence that somebody meant for a behaviour to occur. It is not evidence that the behaviour occurs.

The gap between the two is where the longest outages live, because reading the configuration feels like verification. It produces confident, wrong statements: the key is set, so the provider works; the schedule says every fifteen minutes, so it runs every fifteen minutes; the file was deployed, so the new code is running.

Each of those has a cheap, decisive check that costs seconds:

The rule this earns: never report a system's behaviour from its configuration. Grep the line that proves the behaviour happened, and quote it.

---

This note is one entry in a running wiki of production engineering lessons — every concept linked to the incident that taught it — at aideazz.xyz/ai-ops-wiki.html.

No customer data, credentials, hostnames or internal record identifiers appear in these write-ups.