Lied 1: Stimmen auf −16 LUFS, Musik beim Sprechen leiser (Sprache war kaum lauter als die Musik)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
966623c079
commit
ec680008e5
2 changed files with 8 additions and 1 deletions
|
|
@ -365,7 +365,7 @@ const OUTRO_START = DAUER - OUTRO.dauer;
|
|||
// Startzeit je Aufnahme und Musik leiser, solange gesprochen wird
|
||||
const ZEIT = {bitte: 'gag', ja: 'ja', frage: 'frage', antwort: 'antwort', schoen: 'schoen'} as const;
|
||||
const SPRECHEN: [number, number][] = (Object.keys(ZEIT) as (keyof typeof ZEIT)[]).map((id) => [s(T[ZEIT[id]]), s(T[ZEIT[id]] + SPRUCH[id].dauer)]);
|
||||
const musikLaut = (f: number) => (SPRECHEN.some(([a, b]) => f >= a - 6 && f < b + 6) ? 0.45 : 1);
|
||||
const musikLaut = (f: number) => (SPRECHEN.some(([a, b]) => f >= a - 6 && f < b + 6) ? 0.3 : 1);
|
||||
|
||||
export const Lied01: React.FC = () => (
|
||||
<AbsoluteFill style={{background: '#f4ead8'}}>
|
||||
|
|
|
|||
|
|
@ -52,6 +52,12 @@ const stimmeVon = (wer: string): string | undefined => {
|
|||
if (!v) return undefined;
|
||||
return v in cfg.stimmen ? stimmeVon(v) : v;
|
||||
};
|
||||
// Sprache auf −16 LUFS: deutlich vor der Suno-Musik (−14 LUFS, beim Sprechen leiser gestellt)
|
||||
export const lautheit = (pfad: string) => {
|
||||
const tmp = pfad.replace(/\.mp3$/, '.tmp.mp3');
|
||||
spawnSync('ffmpeg', ['-v', 'error', '-y', '-i', pfad, '-af', 'loudnorm=I=-16:TP=-1.5:LRA=11', '-ar', '44100', '-b:a', '128k', tmp]);
|
||||
fs.renameSync(tmp, pfad);
|
||||
};
|
||||
const laenge = (datei: string) => {
|
||||
const r = spawnSync('ffprobe', ['-v', 'error', '-show_entries', 'format=duration', '-of', 'csv=p=0', datei], {encoding: 'utf8'});
|
||||
return Math.round(parseFloat(r.stdout.trim()) * 100) / 100;
|
||||
|
|
@ -79,6 +85,7 @@ for (const z of GESPROCHEN[sprache]) {
|
|||
const teile: Buffer[] = [];
|
||||
for await (const t of Readable.fromWeb(audio as never)) teile.push(Buffer.from(t));
|
||||
fs.writeFileSync(pfad, Buffer.concat(teile));
|
||||
lautheit(pfad);
|
||||
aufnahmen[z.id] = {datei: `stimmen/lieder/${lied}/${sprache}/${datei}`, dauer: laenge(pfad), text: z.text};
|
||||
fs.writeFileSync(jsonDatei, JSON.stringify(aufnahmen, null, '\t') + '\n');
|
||||
erzeugt++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue