- Projet Remotion 4.0.532 (structure reprise de remotion-test, sans le modifier) - Charte Jobrunner v1.1 : police Chillax, palette beige/sauge/noir, icônes et animations SVG de la charte (logo qui se trace, glisser pour valider, barre de navigation, bouton glissant) - JobrunnerAccroche (9:16), JobrunnerDemoPaiement (9:16, aperçu reconstitué avec données d'exemple), JobrunnerReflexes (3:4, éducatif) - Sans voix off (voix par défaut instable d'une prise à l'autre), musique CC0 - PLAN-ACTION-JOBRUNNER.md, RAPPORT-jobrunner-videos.md, scripts de contrôle Rien n'est publié ni poussé. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lignes
1.8 KiB
Python
41 lignes
1.8 KiB
Python
"""Profil de chaque prise (écrit par Claude, 20/10/2026) : durée, hauteur de voix médiane (F0, autocorrélation simple)
|
|
et énergie par 100 ms. Sert à vérifier qu'on ne mélange pas des prises de timbres trop différents et à repérer les
|
|
bruits parasites en fin de prise. Je ne peux pas écouter : c'est un contrôle indirect, l'écoute reste à faire par Théo.
|
|
Usage : python -I outils-voix/profil.py <dossier> [<dossier> ...] (chaque dossier contient pNN.wav et mots.json)
|
|
"""
|
|
import json, sys, wave
|
|
from pathlib import Path
|
|
import numpy as np
|
|
|
|
|
|
def lire(f):
|
|
with wave.open(str(f)) as w:
|
|
sr, n, sw = w.getframerate(), w.getnframes(), w.getsampwidth()
|
|
a = np.frombuffer(w.readframes(n), dtype=np.int16 if sw == 2 else np.int32).astype(np.float32)
|
|
return a / (32768.0 if sw == 2 else 2147483648.0), sr
|
|
|
|
|
|
def f0(a, sr):
|
|
hop, win, res = sr // 100, sr // 25, []
|
|
for i in range(0, len(a) - win, hop):
|
|
x = a[i:i + win]
|
|
if np.sqrt(np.mean(x ** 2)) < 0.03:
|
|
continue
|
|
x = x - x.mean()
|
|
c = np.correlate(x, x, "full")[win - 1:]
|
|
lo, hi = sr // 400, sr // 70
|
|
k = lo + int(np.argmax(c[lo:hi]))
|
|
if c[k] > 0.4 * c[0]:
|
|
res.append(sr / k)
|
|
return float(np.median(res)) if res else 0.0
|
|
|
|
|
|
for d in map(Path, sys.argv[1:]):
|
|
mots = json.loads((d / "mots.json").read_text(encoding="utf-8"))
|
|
for f in sorted(d.glob("p*.wav")):
|
|
a, sr = lire(f)
|
|
rms = [float(np.sqrt(np.mean(a[i:i + sr // 10] ** 2))) for i in range(0, len(a), sr // 10)]
|
|
ligne = "".join(" " if r < 0.005 else "." if r < 0.02 else ":" if r < 0.06 else "#" for r in rms)
|
|
m = mots.get(f.stem) or [["", 0, 0]]
|
|
print(f"{d.name}/{f.stem} {len(a)/sr:5.2f}s F0={f0(a, sr):5.0f}Hz whisper {m[0][1]:.2f}-{m[-1][2]:.2f} |{ligne}|")
|