AI agents · Recipes
Do a sound pass for a game
An agent lists every event a game needs a sound for, makes each one with Mirli, and wires them in.
A worked example: an agent reads a game's code, lists every event that needs a sound, makes each one with Mirli, and
wires the files in. The bundled soundbox-sound-pass skill teaches the same method; see
Skills and call logs.
Before you begin
- The agent is connected to Mirli and can read and write the game's files.
- At least one sound-effect model is installed:
list_modelsshows one withtask: "gen"andstatusinstalled or loaded.
List the events
Read the game's code and design notes, and list every moment that should make a sound: player actions, impacts, pickups, UI, and ambience for each level.
For each event, write down a file name, a length and a physical description of the sound.
For example:
door_open 1.5 s heavy wooden door creaking open, iron hinges coin_pickup 0.5 s small bright metallic coin chime, close cave_ambience 20 s dripping water in a large stone cave, distant windShow the list to the user before generating, so they can add or remove events.
Choose a model
Call
soundbox.list_models.Pick a model whose
taskisgenand whosemax_duration_scovers the longest event.If the game is commercial, pick one whose
commercial_useisyes. A model markednohas a licence that forbids commercial use.Optional: call
soundbox.list_soundswithqset to each event. A sound already in the library can be reused.
Make the sounds
For each event, call
soundbox.generatewith its description, its length and two or three takes:soundbox.generate arguments { "prompt": "heavy wooden door creaking open, iron hinges", "duration_s": 1.5, "variations": 3, "tags": ["door_open", "sound-pass"] }The call blocks until the files exist. Each of the result's
soundshas an absolutepath.Pick one take per event, or keep all of them as variants if the game plays a random one.
Mirli renders one job at a time, so call
generateonce per event rather than in parallel.Copy each chosen file into the game's sound folder under the event's file name.
Wire them in
- Add each file to the game's audio code where its event fires, the same way the code already plays sounds.
- Give the user the list of events, the files and the model used, including its licence.
What's next
- Troubleshoot agent calls: what to do when
generatefails. - Sound tools: every argument of
generate.