Rework sound effects and add pre-generated Piper narration

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
denis
2026-10-16 12:29:51 +02:00
parent 61eccb2f80
commit 7050cb1ac6
60 changed files with 918 additions and 83 deletions
+28
View File
@@ -0,0 +1,28 @@
"""Vecteurs communs avec tests/js/speech-key.test.mjs : les deux implémentations doivent concorder."""
from __future__ import annotations
import sys
import unittest
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "scripts"))
from voice_key import speech_key, speech_text # noqa: E402
class VoiceKeyTest(unittest.TestCase):
def test_text_is_normalised(self) -> None:
self.assertEqual(speech_text(" Un `print()` affiche\n du texte. "), "Un print() affiche du texte.")
def test_vectors_match_javascript(self) -> None:
self.assertEqual(speech_key("fr", "Un `print()` affiche du texte."), "0933ff041539352b")
self.assertEqual(speech_key("en", "Héllo wörld"), "87e2e25e5123e565")
self.assertEqual(speech_key("fr", ""), "dc8d3218feba4761")
def test_language_changes_key(self) -> None:
self.assertNotEqual(speech_key("fr", "Bonjour"), speech_key("en", "Bonjour"))
if __name__ == "__main__":
unittest.main()