Nell Caller boards my night bus in Chapter 4, waiting for her mother to ring. She has two lines and one voice, and she comes back three chapters later. If she ever came back sounding like a different woman, the scene would be dead.
That's the problem this post is about. Last Bus to Bellwick is a first-person horror game made in Godot 4. You drive the last bus of the night, talk to whoever knocks, and decide who boards. It has 50 fares across ten chapters, and every passenger speaks.
The voices are AI-generated with ElevenLabs: 102 clips from 13 voices. Here is how I kept every clip attached to the right passenger.
1. Clip names come from the script, not from me
Nobody names a file by hand. A clip's path is computed from where the line sits in the story:
static func clip(ch: int, slot: int, turn: int) -> String: var key: String = content.DRIVERS[ch] if turn == 1 else "%s_%d" % [fare(ch, slot)[6], turn] return "res://art/voice/campaign/" + key + ".mp3" Each fare carries an audio prefix such as c6_2, so c6_2_0.mp3 is that rider's opening line and c6_2_2.mp3 is their reply. Turn 1 is always the driver's question, which belongs to the chapter, not the rider. The last five chapters ask the same question, so they share one recording.
Because subtitles are read from the same table, the text on screen and the audio can't drift apart. A passenger who returns in a later chapter keeps their original prefix, so they keep their original voice.
2. Casting lives in one file
casting.json has two parts. The first lists the 13 voices with a gender and an age group. The second maps every rider to a performer:
"cast": { "Ada Bell": "Beatrice", "Al Cook": "Roger", "Bea Reed": "Lily" } When a voice didn't suit a character, I changed one line here and re-recorded only that rider.
3. The recorder never overwrites a take
The recording script walks the same story table the game reads and asks for each line, but only when the file doesn't exist yet:
def record(job): name, voice, text = job p = out / (name + '.mp3') if not p.exists(): p.write_bytes(request('/v1/text-to-speech/' + voice, {'text': text, 'model_id': 'eleven_multilingual_v2'})) Text-to-speech gives a slightly different read every time. Skipping existing files means a take I've approved stays the take that ships, and adding a chapter only pays for the new lines.
4. A headless test plays every fare and checks the audio
This is the part I'd recommend to anyone shipping generated audio. A manifest records, for each clip, the rider it belongs to, the performer and a SHA-256 of the file. A headless Godot test then plays through all 50 fares and checks whichever clip the game actually loads:
func verify_rider_voice(stream: AudioStreamMP3, rider: String) -> void: var key := stream.resource_path.trim_prefix("res://art/voice/").trim_suffix(".mp3") var recording: Dictionary = RECORDINGS.data[key] assert(recording.rider == rider and recording.performer == CASTING.data.cast[rider]) var digest := HashingContext.new() digest.start(HashingContext.HASH_SHA256) digest.update(stream.data) assert(digest.finish().hex_encode() == recording.sha256) It fails if a line plays another rider's clip, if the clip was recorded by the wrong performer, or if a file changed after I approved it. It runs with godot --headless --script tests/check_campaign.gd, so I can run it before every export.
What I'd keep for the next project
- Derive asset names from data. A file you named by hand is a file you will eventually mismatch.
- Keep casting in one small file you can read in a minute.
- Make regeneration additive, so approved takes are never replaced by accident.
- Hash generated assets and test the path the game really takes, not the folder contents.
Try it
Chapter 1 is a free download for Windows and macOS. The full game has all ten chapters.
Disclosure: the passenger voices and some of the game's artwork are AI-generated, I built the game with AI coding agents, and this post was written by an AI agent from the project's source code.

