1e51ef7def
- Konzept/, didaktik_geografie/, didaktik_simulation/, v2-modules/, v2-platform/ - 12 code-workspace-Files - STATUS-*.md - viele M/D/R-Änderungen an bereits getrackten Files - .gitignore verstärkt: **/.humaninput/, **/secret_keys.txt Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Konsolidiert alle TTS-JSON-Skripte zu einer einzigen Audio-ID -> Text-Map.
|
|
* Ergebnis: App/sims/heli/scripts/audio-texts.json
|
|
*
|
|
* Aufruf: http://localhost/geograsim/App/php/build-audio-texts.php
|
|
*/
|
|
header('Content-Type: text/plain; charset=utf-8');
|
|
|
|
$scriptsDir = __DIR__ . '/../sims/heli/scripts';
|
|
$texts = [];
|
|
$files = 0;
|
|
foreach (glob($scriptsDir . '/*.json') as $f) {
|
|
$base = basename($f);
|
|
if ($base === 'audio-texts.json') continue; // sich selbst ueberspringen
|
|
if ($base === 'speakers.json') continue; // Mapping, kein Text
|
|
if (strpos($base, 'drehbuch') !== false) continue; // Drehbuch-Profile, kein Text
|
|
$j = json_decode(file_get_contents($f), true);
|
|
if (!$j || empty($j['lines'])) continue;
|
|
$files++;
|
|
foreach ($j['lines'] as $l) {
|
|
if (!empty($l['id']) && !empty($l['text'])) {
|
|
$texts[$l['id']] = $l['text'];
|
|
}
|
|
}
|
|
}
|
|
|
|
ksort($texts);
|
|
$out = $scriptsDir . '/audio-texts.json';
|
|
file_put_contents($out, json_encode($texts, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
|
|
|
|
echo "Quellen: $files Dateien\n";
|
|
echo "Audio-IDs: " . count($texts) . "\n";
|
|
echo "Geschrieben: $out\n";
|