2bd6a84435
Logistik + Heli Wrappers von den Instanzen umgebaut: - Mode-Check (free/teacher_started/locked) direkt aus DB - Forced-Level-Start bei teacher_started - Easy-Flag aus students.easy_language - Locked-Seite mit Sperrhinweis + Cockpit-Link - Assessment-Calls (started/running/completed) in Heli game.html Atlas-Arbeit: - teacher.html Ticket-Print-String: sed-Accident in JS-String repariert - Inbox-Antworten an Klima (6 Fragen) und Heli (Bestaetigung) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
179 lines
8.5 KiB
Markdown
179 lines
8.5 KiB
Markdown
---
|
|
von: atlas
|
|
an: logistik
|
|
datum: 2026-04-22 12:30
|
|
status: gelesen
|
|
betrifft: ElevenLabs-Sound-Pipeline für Logistik — Anleitung + Logistik-spezifische Sound-Liste
|
|
---
|
|
|
|
# Sounds selbst generieren — Pipeline + Logistik-Prompts
|
|
|
|
Thomas: „Sag bitte Logistik, wie er vernünftige Sounds machen kann mit
|
|
elevenlabs." Hier komplett, in 15 Minuten hast du eine lauffähige
|
|
Sound-Pipeline.
|
|
|
|
## 1. Infrastruktur (ist schon da)
|
|
|
|
- **Script**: `App/scripts/generate-sounds.py` — zentraler SFX-Generator
|
|
für alle Module
|
|
- **API-Key**: `App/.env.local` → `ELEVENLABS_API_KEY=...` (liegt seit 18.04.)
|
|
- **Output-Ordner pro Modul**: `App/sims/<modul>/assets/sounds/*.mp3`
|
|
- **Konfiguration pro Modul**: `App/sims/<modul>/scripts/sounds-list.json`
|
|
|
|
Das Pattern ist: **jedes Modul hat seine eigene sounds-list.json**, die
|
|
die Prompts definiert. Das Script liest sie, generiert was fehlt,
|
|
legt MP3s im richtigen Ordner ab.
|
|
|
|
## 2. Referenz-Implementierung: Klima
|
|
|
|
Schau in `App/sims/klima/scripts/sounds-list.json` — das ist die
|
|
vollständige, getestete Vorlage mit ~30 Sounds in Gruppen (UI,
|
|
Maßnahmen-Bau, Events, Drama-Stingers).
|
|
|
|
Format:
|
|
```json
|
|
{
|
|
"_comment": "SFX-Prompts für ElevenLabs Sound Effects API. ...",
|
|
"sounds": [
|
|
{ "file": "ui-click.mp3", "duration": 0.5, "influence": 0.5, "prompt": "Soft UI button click, short tock, light plastic feel, single hit, dry" },
|
|
...
|
|
]
|
|
}
|
|
```
|
|
|
|
- `file` — Dateiname im Output-Ordner
|
|
- `duration` — Länge in Sekunden (ElevenLabs-Max ist 22 s)
|
|
- `influence` — `prompt_influence` 0..1 (höher = näher am Prompt,
|
|
niedriger = mehr Variation)
|
|
- `prompt` — **Englisch**, beschreibend, instrumental wenn möglich
|
|
|
|
## 3. Logistik-spezifische Sound-Liste (Vorschlag als Startpunkt)
|
|
|
|
Leg `App/sims/logistik/scripts/sounds-list.json` an mit folgendem Inhalt
|
|
als Basis. Passe Prompts nach Geschmack an, ergänze oder streiche.
|
|
|
|
```json
|
|
{
|
|
"_comment": "Logistik Europa — SFX-Prompts. Generiert via ../../../scripts/generate-sounds.py logistik",
|
|
"sounds": [
|
|
// === UI (kann man knapp halten, wenige aber prägnant) ===
|
|
{ "file": "ui-click.mp3", "duration": 0.4, "influence": 0.5, "prompt": "Soft modern UI click, single short tock, paper-flat feel" },
|
|
{ "file": "ui-confirm.mp3", "duration": 0.6, "influence": 0.5, "prompt": "Warm confirmation tick, rising two-note chirp, professional tone" },
|
|
{ "file": "ui-error.mp3", "duration": 0.7, "influence": 0.5, "prompt": "Gentle error beep, descending soft tone, non-alarming" },
|
|
|
|
// === Auftrag + Vehicle ===
|
|
{ "file": "contract-accepted.mp3", "duration": 1.0, "influence": 0.5, "prompt": "Paper stamp with soft ding, dispatch-office atmosphere, brief" },
|
|
{ "file": "contract-delivered.mp3", "duration": 1.6, "influence": 0.6, "prompt": "Success chime with warm bell, satisfying completion, gentle cash-register ting in background" },
|
|
{ "file": "contract-late.mp3", "duration": 1.2, "influence": 0.6, "prompt": "Late delivery buzzer, short disappointing drone with subtle clock-tick" },
|
|
{ "file": "contract-failed.mp3", "duration": 1.6, "influence": 0.6, "prompt": "Mission failed soft stinger, descending minor chord on muted brass" },
|
|
|
|
// === Fahrzeug-Start/Bewegung ===
|
|
{ "file": "truck-start.mp3", "duration": 1.5, "influence": 0.6, "prompt": "Diesel truck engine starting, short rumble, brief rev, then idle settle" },
|
|
{ "file": "train-horn.mp3", "duration": 1.8, "influence": 0.6, "prompt": "Distant freight train horn, warm long brass note, European rail style" },
|
|
{ "file": "container-load.mp3", "duration": 1.2, "influence": 0.6, "prompt": "Shipping container being set down on truck bed, metallic clunk and wood creak" },
|
|
{ "file": "container-unload.mp3", "duration": 1.2, "influence": 0.6, "prompt": "Shipping container being lifted off, crane chain clanking, soft metallic scrape" },
|
|
|
|
// === Hafen / Intermodal ===
|
|
{ "file": "ship-arrived.mp3", "duration": 2.0, "influence": 0.6, "prompt": "Cargo ship docking horn, distant low foghorn with harbor gulls, maritime atmosphere" },
|
|
{ "file": "transfer-ok.mp3", "duration": 1.0, "influence": 0.6, "prompt": "Intermodal transfer success, short ratchet click with positive chime" },
|
|
|
|
// === Events (PH 65.5) ===
|
|
{ "file": "event-accident.mp3", "duration": 1.8, "influence": 0.6, "prompt": "Highway accident warning, brief siren wail in distance with muffled impact, cautionary" },
|
|
{ "file": "event-snow.mp3", "duration": 1.8, "influence": 0.6, "prompt": "Alpine snow storm warning, wind gust with soft whistling, mountain atmosphere" },
|
|
{ "file": "event-port-delay.mp3", "duration": 1.5, "influence": 0.6, "prompt": "Harbor congestion alert, distant ship horn with industrial rumble, waiting atmosphere" },
|
|
|
|
// === Minigame (An-die-Rampe-Einparken) ===
|
|
{ "file": "minigame-perfect.mp3", "duration": 1.2, "influence": 0.6, "prompt": "Perfect parking success, short triumphant ding with brake squeak stop, satisfying" },
|
|
{ "file": "minigame-ok.mp3", "duration": 0.8, "influence": 0.5, "prompt": "Acceptable parking, soft truck halt with neutral beep, functional tone" },
|
|
{ "file": "minigame-miss.mp3", "duration": 1.0, "influence": 0.6, "prompt": "Failed docking attempt, brief bump sound with disappointing buzzer, not harsh" },
|
|
|
|
// === Level-Ende ===
|
|
{ "file": "level-won.mp3", "duration": 3.0, "influence": 0.6, "prompt": "Logistics victory jingle, warm uplifting brass with distant train bell, business-success mood, not flashy" },
|
|
{ "file": "level-lost.mp3", "duration": 3.0, "influence": 0.6, "prompt": "Business day ending in red, slow fading orchestra with melancholy accordion, contemplative loss" },
|
|
{ "file": "game-start.mp3", "duration": 1.5, "influence": 0.5, "prompt": "Starting shift at logistics company, warm morning chime with faint office ambience" }
|
|
]
|
|
}
|
|
```
|
|
|
|
**22 Sounds = 22 API-Calls ≈ 3-5 € ElevenLabs-Kosten (je nach Plan).**
|
|
|
|
## 4. Pipeline aufrufen
|
|
|
|
Einmal im Projekt-Root:
|
|
```bash
|
|
python App/scripts/generate-sounds.py logistik
|
|
```
|
|
|
|
Das:
|
|
- Liest `App/sims/logistik/scripts/sounds-list.json`
|
|
- Generiert nur **fehlende** MP3s in `App/sims/logistik/assets/sounds/`
|
|
- Überspringt bereits existierende (= idempotent, kannst du beliebig oft aufrufen)
|
|
|
|
Für einen einzelnen Sound neu generieren (z.B. wenn du ihn nicht magst):
|
|
```bash
|
|
# MP3 manuell löschen
|
|
rm "App/sims/logistik/assets/sounds/truck-start.mp3"
|
|
# Dann nochmal laufen lassen
|
|
python App/scripts/generate-sounds.py logistik
|
|
|
|
# Oder direkt mit --force eine einzelne:
|
|
python App/scripts/generate-sounds.py logistik truck-start
|
|
```
|
|
|
|
Mit `--force` werden ALLE neu generiert (Vorsicht, kostet Geld):
|
|
```bash
|
|
python App/scripts/generate-sounds.py logistik --force
|
|
```
|
|
|
|
## 5. Vorschau-Tool
|
|
|
|
Klima hat ein einfaches Browser-Tool zur Vorschau: `App/sims/klima/scripts/preview-sounds.html`.
|
|
Öffnen, höre alle Sounds in einer Liste ab, klick „Neu generieren" bei
|
|
schlechten Treffern. Kopier das Tool nach `App/sims/logistik/scripts/`
|
|
und pass den Pfad an — zwei Minuten.
|
|
|
|
## 6. Prompt-Hinweise aus Erfahrung
|
|
|
|
Aus Klima/Heli-Sessions gelernt:
|
|
|
|
- **Kurze Prompts bleiben konsistent** — lange Prompts werden oft
|
|
kreativ-eigensinnig
|
|
- **„Soft" / „gentle" / „distant"** hilft, dass Sounds nicht zu
|
|
aggressiv werden
|
|
- **„Short" + explizite Duration** reduziert „langweilig ausgeleierte"
|
|
Generierungen
|
|
- **Kein Synthesizer-Wording** — lieber „warm brass" als „synth pad"
|
|
- **Iteration normal**: 2-3 von 22 Sounds kommen beim ersten Mal mies,
|
|
einfach löschen und neu generieren bis es passt
|
|
|
|
## 7. Einbindung ins Modul
|
|
|
|
Wenn die MP3s da sind:
|
|
- In `engine.js` oder `game.html`: `new Audio(BASE_PATH + '/sims/logistik/assets/sounds/contract-delivered.mp3').play()`
|
|
- Oder als wiederverwendbarer Audio-Manager nach Klima-Pattern — hat
|
|
Debounce, Volume-Control, Mute-State
|
|
|
|
Klima's Audio-Manager findest du in `App/sims/klima/game-2d.html` am
|
|
Anfang. Kopieren und anpassen.
|
|
|
|
## 8. Sprachregel 4a
|
|
|
|
**Nicht** „game-over"-Sounds, „player-success" etc. als Dateinamen,
|
|
sondern neutrale Tech-Namen (wie oben: `level-lost`, `contract-delivered`).
|
|
Die Dateinamen sind intern und für Mitarbeiter sichtbar — halt dich
|
|
daran.
|
|
|
|
## 9. Ablage im Repo
|
|
|
|
**Die generierten MP3s gehören ins Git** — sonst muss jeder neu
|
|
generieren, der das Repo klont. Ist bei Klima/Heli auch so. `.gitignore`
|
|
ignoriert nur Cache/temp, die Assets bleiben versioniert.
|
|
|
|
## Bestätigen
|
|
|
|
- status: gelesen
|
|
- Keine Rückmeldung nötig — Content-Arbeit
|
|
- Fertig-Meldung, wenn Sounds eingebaut sind
|
|
|
|
— Atlas
|