Modern Apps git

← Modern-Apps.git

speech: pin Piper VITS voice bundle SHA-256 and fix espeak batching

Commit
fb124a742b548faa7b39ed31d520b885aaae6a32
Author
Vayun Mathur <[email protected]>
When
2026-08-02 16:37 UTC (4 months ago)
Parents
cc4c41d

Diff

scripts/speech/generate_piper_dict.py
diff --git a/scripts/speech/generate_piper_dict.py b/scripts/speech/generate_piper_dict.pyindex e5b1e9ad08..854a79bd09 100755--- a/scripts/speech/generate_piper_dict.py+++ b/scripts/speech/generate_piper_dict.py@@ -70,7 +70,7 @@ def phonemize(words: list, voice: str) -> list:     for start in range(0, len(words), BATCH):         chunk = words[start:start + BATCH]         proc = subprocess.run(-            ["espeak-ng", "-q", "-v", voice, "--ipa", "--stdin"],+            ["espeak-ng", "-q", "-v", voice, "--ipa"],             input="\n".join(chunk),             capture_output=True,             text=True,
speech/src/main/java/com/vayunmathur/speech/util/PiperModel.kt
diff --git a/speech/src/main/java/com/vayunmathur/speech/util/PiperModel.kt b/speech/src/main/java/com/vayunmathur/speech/util/PiperModel.ktindex d10bd3f263..e9cd737c1b 100644--- a/speech/src/main/java/com/vayunmathur/speech/util/PiperModel.kt+++ b/speech/src/main/java/com/vayunmathur/speech/util/PiperModel.kt@@ -44,9 +44,14 @@ object PiperModel {     private const val BASE = "https://data.vayunmathur.com/models/piper/"     private const val ARCHIVE = "$DIR/voice.zip" -    /** The single downloadable archive (extracted app-side into [voiceDir]). */+    /** The single downloadable archive (extracted app-side into [voiceDir]), SHA-256 pinned. */     val FILES: List<ModelDownloadItem> = listOf(-        ModelDownloadItem("${BASE}voice.zip", ARCHIVE, "Piper voice (TTS)"),+        ModelDownloadItem(+            "${BASE}voice.zip",+            ARCHIVE,+            "Piper voice (TTS)",+            "ca20be58bda0514d57cb8ce6c0cf84b40aae8427a6f48739472f99e9bcdd8fa6",+        ),     )      private fun rootDir(context: Context): File? {