echogarden 2.10.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (496) hide show
  1. package/LICENSE.MIT.md +7 -0
  2. package/README.md +9 -1
  3. package/data/lexicons/heteronyms.en.json +44 -10
  4. package/data/lexicons/words.en.json +726 -22
  5. package/data/schemas/options.json +91 -153
  6. package/dist/alignment/DTWMfccSequenceAlignment.js.map +1 -1
  7. package/dist/alignment/SemanticTextAlignment.d.ts +4 -2
  8. package/dist/alignment/SemanticTextAlignment.d.ts.map +1 -1
  9. package/dist/alignment/SemanticTextAlignment.js +7 -7
  10. package/dist/alignment/SemanticTextAlignment.js.map +1 -1
  11. package/dist/alignment/SpeechAlignment.d.ts +9 -10
  12. package/dist/alignment/SpeechAlignment.d.ts.map +1 -1
  13. package/dist/alignment/SpeechAlignment.js +23 -96
  14. package/dist/alignment/SpeechAlignment.js.map +1 -1
  15. package/dist/api/APIOptions.d.ts +1 -1
  16. package/dist/api/APIOptions.d.ts.map +1 -1
  17. package/dist/api/Alignment.d.ts +8 -6
  18. package/dist/api/Alignment.d.ts.map +1 -1
  19. package/dist/api/Alignment.js +31 -40
  20. package/dist/api/Alignment.js.map +1 -1
  21. package/dist/api/Common.d.ts +7 -0
  22. package/dist/api/Common.d.ts.map +1 -1
  23. package/dist/api/Common.js.map +1 -1
  24. package/dist/api/Denoising.d.ts +5 -2
  25. package/dist/api/Denoising.d.ts.map +1 -1
  26. package/dist/api/Denoising.js +15 -15
  27. package/dist/api/Denoising.js.map +1 -1
  28. package/dist/api/GlobalOptions.d.ts +2 -8
  29. package/dist/api/GlobalOptions.d.ts.map +1 -1
  30. package/dist/api/GlobalOptions.js +2 -13
  31. package/dist/api/GlobalOptions.js.map +1 -1
  32. package/dist/api/Recognition.d.ts +11 -12
  33. package/dist/api/Recognition.d.ts.map +1 -1
  34. package/dist/api/Recognition.js +32 -82
  35. package/dist/api/Recognition.js.map +1 -1
  36. package/dist/api/SourceSeparation.d.ts +7 -2
  37. package/dist/api/SourceSeparation.d.ts.map +1 -1
  38. package/dist/api/SourceSeparation.js +12 -10
  39. package/dist/api/SourceSeparation.js.map +1 -1
  40. package/dist/api/SpeechLanguageDetection.d.ts +11 -7
  41. package/dist/api/SpeechLanguageDetection.d.ts.map +1 -1
  42. package/dist/api/SpeechLanguageDetection.js +37 -30
  43. package/dist/api/SpeechLanguageDetection.js.map +1 -1
  44. package/dist/api/SpeechSearch.d.ts +4 -1
  45. package/dist/api/SpeechSearch.d.ts.map +1 -1
  46. package/dist/api/SpeechSearch.js.map +1 -1
  47. package/dist/api/SpeechTranslation.d.ts +10 -6
  48. package/dist/api/SpeechTranslation.d.ts.map +1 -1
  49. package/dist/api/SpeechTranslation.js +28 -26
  50. package/dist/api/SpeechTranslation.js.map +1 -1
  51. package/dist/api/Synthesis.d.ts +13 -8
  52. package/dist/api/Synthesis.d.ts.map +1 -1
  53. package/dist/api/Synthesis.js +67 -89
  54. package/dist/api/Synthesis.js.map +1 -1
  55. package/dist/api/TextLanguageDetection.d.ts +4 -2
  56. package/dist/api/TextLanguageDetection.d.ts.map +1 -1
  57. package/dist/api/TextLanguageDetection.js +4 -7
  58. package/dist/api/TextLanguageDetection.js.map +1 -1
  59. package/dist/api/TextTranslation.d.ts +4 -2
  60. package/dist/api/TextTranslation.d.ts.map +1 -1
  61. package/dist/api/TextTranslation.js +13 -24
  62. package/dist/api/TextTranslation.js.map +1 -1
  63. package/dist/api/TimelineTranslationAlignment.d.ts +6 -3
  64. package/dist/api/TimelineTranslationAlignment.d.ts.map +1 -1
  65. package/dist/api/TimelineTranslationAlignment.js +20 -11
  66. package/dist/api/TimelineTranslationAlignment.js.map +1 -1
  67. package/dist/api/TranscriptAndTranslationAlignment.d.ts +6 -4
  68. package/dist/api/TranscriptAndTranslationAlignment.d.ts.map +1 -1
  69. package/dist/api/TranscriptAndTranslationAlignment.js +11 -12
  70. package/dist/api/TranscriptAndTranslationAlignment.js.map +1 -1
  71. package/dist/api/TranslationAlignment.d.ts +6 -4
  72. package/dist/api/TranslationAlignment.d.ts.map +1 -1
  73. package/dist/api/TranslationAlignment.js +20 -21
  74. package/dist/api/TranslationAlignment.js.map +1 -1
  75. package/dist/api/VoiceActivityDetection.d.ts +9 -8
  76. package/dist/api/VoiceActivityDetection.d.ts.map +1 -1
  77. package/dist/api/VoiceActivityDetection.js +20 -43
  78. package/dist/api/VoiceActivityDetection.js.map +1 -1
  79. package/dist/audio/AudioBufferConversion.js.map +1 -1
  80. package/dist/audio/AudioPlayer.d.ts +1 -3
  81. package/dist/audio/AudioPlayer.d.ts.map +1 -1
  82. package/dist/audio/AudioPlayer.js +3 -188
  83. package/dist/audio/AudioPlayer.js.map +1 -1
  84. package/dist/audio/AudioUtilities.d.ts +2 -1
  85. package/dist/audio/AudioUtilities.d.ts.map +1 -1
  86. package/dist/audio/AudioUtilities.js +2 -2
  87. package/dist/audio/AudioUtilities.js.map +1 -1
  88. package/dist/build-tools/MakeTarballsForInstalledPackages.js +3 -3
  89. package/dist/build-tools/MakeTarballsForInstalledPackages.js.map +1 -1
  90. package/dist/cli/CLI.d.ts.map +1 -1
  91. package/dist/cli/CLI.js +139 -92
  92. package/dist/cli/CLI.js.map +1 -1
  93. package/dist/codecs/FFMpegTranscoder.d.ts +4 -3
  94. package/dist/codecs/FFMpegTranscoder.d.ts.map +1 -1
  95. package/dist/codecs/FFMpegTranscoder.js +16 -14
  96. package/dist/codecs/FFMpegTranscoder.js.map +1 -1
  97. package/dist/codecs/TIMITCodec.d.ts.map +1 -1
  98. package/dist/data-structures/DynamicTypedArray.d.ts.map +1 -1
  99. package/dist/data-structures/DynamicTypedArray.js.map +1 -1
  100. package/dist/data-structures/Queue.d.ts.map +1 -1
  101. package/dist/data-structures/WindowedList.d.ts.map +1 -1
  102. package/dist/data-structures/WindowedList.js.map +1 -1
  103. package/dist/denoising/NSNet2.d.ts +3 -2
  104. package/dist/denoising/NSNet2.d.ts.map +1 -1
  105. package/dist/denoising/NSNet2.js +4 -4
  106. package/dist/denoising/NSNet2.js.map +1 -1
  107. package/dist/denoising/RNNoise.d.ts +2 -1
  108. package/dist/denoising/RNNoise.d.ts.map +1 -1
  109. package/dist/denoising/RNNoise.js +10 -6
  110. package/dist/denoising/RNNoise.js.map +1 -1
  111. package/dist/dsp/BiquadFilter.d.ts.map +1 -1
  112. package/dist/dsp/DecayingPeakEstimator.d.ts.map +1 -1
  113. package/dist/dsp/DecayingPeakEstimator.js.map +1 -1
  114. package/dist/dsp/FFT.d.ts.map +1 -1
  115. package/dist/dsp/FFT.js +2 -1
  116. package/dist/dsp/FFT.js.map +1 -1
  117. package/dist/dsp/KWeightingFilter.d.ts.map +1 -1
  118. package/dist/dsp/KWeightingFilter.js.map +1 -1
  119. package/dist/dsp/LoudnessEstimator.d.ts.map +1 -1
  120. package/dist/dsp/LoudnessEstimator.js.map +1 -1
  121. package/dist/dsp/MFCC.d.ts +3 -2
  122. package/dist/dsp/MFCC.d.ts.map +1 -1
  123. package/dist/dsp/MFCC.js +4 -4
  124. package/dist/dsp/MFCC.js.map +1 -1
  125. package/dist/dsp/MelSpectrogram.d.ts +10 -8
  126. package/dist/dsp/MelSpectrogram.d.ts.map +1 -1
  127. package/dist/dsp/MelSpectrogram.js +31 -34
  128. package/dist/dsp/MelSpectrogram.js.map +1 -1
  129. package/dist/dsp/Rubberband.d.ts.map +1 -1
  130. package/dist/dsp/Rubberband.js +8 -3
  131. package/dist/dsp/Rubberband.js.map +1 -1
  132. package/dist/dsp/Sonic.d.ts.map +1 -1
  133. package/dist/dsp/Sonic.js +1 -1
  134. package/dist/dsp/Sonic.js.map +1 -1
  135. package/dist/dsp/SpeexResampler.d.ts.map +1 -1
  136. package/dist/dsp/SpeexResampler.js +1 -1
  137. package/dist/dsp/SpeexResampler.js.map +1 -1
  138. package/dist/encodings/Ascii.d.ts +1 -1
  139. package/dist/encodings/Ascii.d.ts.map +1 -1
  140. package/dist/encodings/Base64.js.map +1 -1
  141. package/dist/encodings/Utf16.d.ts.map +1 -1
  142. package/dist/encodings/Utf8.d.ts.map +1 -1
  143. package/dist/math/VectorMath.d.ts +1 -0
  144. package/dist/math/VectorMath.d.ts.map +1 -1
  145. package/dist/math/VectorMath.js +9 -5
  146. package/dist/math/VectorMath.js.map +1 -1
  147. package/dist/nlp/ChineseSegmentation.d.ts +1 -1
  148. package/dist/nlp/ChineseSegmentation.d.ts.map +1 -1
  149. package/dist/nlp/EspeakPhonemizer.d.ts +1 -1
  150. package/dist/nlp/EspeakPhonemizer.d.ts.map +1 -1
  151. package/dist/nlp/EspeakPhonemizer.js +2 -2
  152. package/dist/nlp/EspeakPhonemizer.js.map +1 -1
  153. package/dist/nlp/IPA.d.ts +2 -2
  154. package/dist/nlp/Segmentation.d.ts +1 -1
  155. package/dist/nlp/Segmentation.d.ts.map +1 -1
  156. package/dist/nlp/Segmentation.js +8 -4
  157. package/dist/nlp/Segmentation.js.map +1 -1
  158. package/dist/recognition/AmazonTranscribeSTT.d.ts +2 -1
  159. package/dist/recognition/AmazonTranscribeSTT.d.ts.map +1 -1
  160. package/dist/recognition/AmazonTranscribeSTT.js +3 -3
  161. package/dist/recognition/AmazonTranscribeSTT.js.map +1 -1
  162. package/dist/recognition/AzureCognitiveServicesSTT.d.ts +2 -1
  163. package/dist/recognition/AzureCognitiveServicesSTT.d.ts.map +1 -1
  164. package/dist/recognition/AzureCognitiveServicesSTT.js +4 -4
  165. package/dist/recognition/AzureCognitiveServicesSTT.js.map +1 -1
  166. package/dist/recognition/DeepgramSTT.d.ts +2 -1
  167. package/dist/recognition/DeepgramSTT.d.ts.map +1 -1
  168. package/dist/recognition/DeepgramSTT.js +12 -13
  169. package/dist/recognition/DeepgramSTT.js.map +1 -1
  170. package/dist/recognition/GoogleCloudSTT.d.ts +2 -1
  171. package/dist/recognition/GoogleCloudSTT.d.ts.map +1 -1
  172. package/dist/recognition/GoogleCloudSTT.js +11 -10
  173. package/dist/recognition/GoogleCloudSTT.js.map +1 -1
  174. package/dist/recognition/OpenAICloudSTT.d.ts +2 -1
  175. package/dist/recognition/OpenAICloudSTT.d.ts.map +1 -1
  176. package/dist/recognition/OpenAICloudSTT.js +6 -6
  177. package/dist/recognition/OpenAICloudSTT.js.map +1 -1
  178. package/dist/recognition/WhisperCommon.d.ts +9 -0
  179. package/dist/recognition/WhisperCommon.d.ts.map +1 -0
  180. package/dist/recognition/WhisperCommon.js +52 -0
  181. package/dist/recognition/WhisperCommon.js.map +1 -0
  182. package/dist/recognition/{WhisperCppSTT.d.ts → WhisperCppCliSTT.d.ts} +14 -16
  183. package/dist/recognition/WhisperCppCliSTT.d.ts.map +1 -0
  184. package/dist/recognition/{WhisperCppSTT.js → WhisperCppCliSTT.js} +55 -84
  185. package/dist/recognition/WhisperCppCliSTT.js.map +1 -0
  186. package/dist/recognition/WhisperSTT.d.ts +72 -85
  187. package/dist/recognition/WhisperSTT.d.ts.map +1 -1
  188. package/dist/recognition/WhisperSTT.js +384 -519
  189. package/dist/recognition/WhisperSTT.js.map +1 -1
  190. package/dist/server/Client.d.ts +2 -2
  191. package/dist/server/Client.d.ts.map +1 -1
  192. package/dist/server/Client.js.map +1 -1
  193. package/dist/server/Worker.d.ts +6 -7
  194. package/dist/server/Worker.d.ts.map +1 -1
  195. package/dist/server/Worker.js +42 -44
  196. package/dist/server/Worker.js.map +1 -1
  197. package/dist/source-separation/MDXNetSourceSeparation.d.ts +3 -2
  198. package/dist/source-separation/MDXNetSourceSeparation.d.ts.map +1 -1
  199. package/dist/source-separation/MDXNetSourceSeparation.js +10 -8
  200. package/dist/source-separation/MDXNetSourceSeparation.js.map +1 -1
  201. package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.d.ts +3 -2
  202. package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.d.ts.map +1 -1
  203. package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.js +5 -5
  204. package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.js.map +1 -1
  205. package/dist/speech-language-detection/SileroLanguageDetection.d.ts +5 -3
  206. package/dist/speech-language-detection/SileroLanguageDetection.d.ts.map +1 -1
  207. package/dist/speech-language-detection/SileroLanguageDetection.js +8 -8
  208. package/dist/speech-language-detection/SileroLanguageDetection.js.map +1 -1
  209. package/dist/speech-search/DTWSpeechSearch.d.ts +2 -1
  210. package/dist/speech-search/DTWSpeechSearch.d.ts.map +1 -1
  211. package/dist/speech-search/DTWSpeechSearch.js +4 -4
  212. package/dist/speech-search/DTWSpeechSearch.js.map +1 -1
  213. package/dist/subtitles/Subtitles.d.ts +13 -1
  214. package/dist/subtitles/Subtitles.d.ts.map +1 -1
  215. package/dist/subtitles/Subtitles.js +22 -22
  216. package/dist/subtitles/Subtitles.js.map +1 -1
  217. package/dist/synthesis/AwsPollyTTS.d.ts +3 -2
  218. package/dist/synthesis/AwsPollyTTS.d.ts.map +1 -1
  219. package/dist/synthesis/AwsPollyTTS.js +5 -5
  220. package/dist/synthesis/AwsPollyTTS.js.map +1 -1
  221. package/dist/synthesis/AzureCognitiveServicesTTS.d.ts +2 -1
  222. package/dist/synthesis/AzureCognitiveServicesTTS.d.ts.map +1 -1
  223. package/dist/synthesis/AzureCognitiveServicesTTS.js +3 -3
  224. package/dist/synthesis/AzureCognitiveServicesTTS.js.map +1 -1
  225. package/dist/synthesis/CoquiServerTTS.d.ts +2 -1
  226. package/dist/synthesis/CoquiServerTTS.d.ts.map +1 -1
  227. package/dist/synthesis/CoquiServerTTS.js +7 -8
  228. package/dist/synthesis/CoquiServerTTS.js.map +1 -1
  229. package/dist/synthesis/DeepgramTTS.d.ts +2 -2
  230. package/dist/synthesis/DeepgramTTS.d.ts.map +1 -1
  231. package/dist/synthesis/DeepgramTTS.js +13 -13
  232. package/dist/synthesis/DeepgramTTS.js.map +1 -1
  233. package/dist/synthesis/ElevenLabsTTS.d.ts +3 -3
  234. package/dist/synthesis/ElevenLabsTTS.d.ts.map +1 -1
  235. package/dist/synthesis/ElevenLabsTTS.js +22 -21
  236. package/dist/synthesis/ElevenLabsTTS.js.map +1 -1
  237. package/dist/synthesis/EspeakTTS.d.ts +11 -9
  238. package/dist/synthesis/EspeakTTS.d.ts.map +1 -1
  239. package/dist/synthesis/EspeakTTS.js +118 -68
  240. package/dist/synthesis/EspeakTTS.js.map +1 -1
  241. package/dist/synthesis/FliteTTS.d.ts +2 -2
  242. package/dist/synthesis/FliteTTS.d.ts.map +1 -1
  243. package/dist/synthesis/FliteTTS.js +2 -2
  244. package/dist/synthesis/FliteTTS.js.map +1 -1
  245. package/dist/synthesis/GnuSpeechTTS.d.ts +2 -2
  246. package/dist/synthesis/GnuSpeechTTS.d.ts.map +1 -1
  247. package/dist/synthesis/GnuSpeechTTS.js +1 -1
  248. package/dist/synthesis/GnuSpeechTTS.js.map +1 -1
  249. package/dist/synthesis/GoogleCloudTTS.d.ts +3 -2
  250. package/dist/synthesis/GoogleCloudTTS.d.ts.map +1 -1
  251. package/dist/synthesis/GoogleCloudTTS.js +15 -14
  252. package/dist/synthesis/GoogleCloudTTS.js.map +1 -1
  253. package/dist/synthesis/GoogleTranslateTTS.d.ts +3 -2
  254. package/dist/synthesis/GoogleTranslateTTS.d.ts.map +1 -1
  255. package/dist/synthesis/GoogleTranslateTTS.js +11 -11
  256. package/dist/synthesis/GoogleTranslateTTS.js.map +1 -1
  257. package/dist/synthesis/KokoroTTS.d.ts +4 -4
  258. package/dist/synthesis/KokoroTTS.d.ts.map +1 -1
  259. package/dist/synthesis/KokoroTTS.js +11 -10
  260. package/dist/synthesis/KokoroTTS.js.map +1 -1
  261. package/dist/synthesis/MicrosoftEdgeTTS.d.ts +4 -3
  262. package/dist/synthesis/MicrosoftEdgeTTS.d.ts.map +1 -1
  263. package/dist/synthesis/MicrosoftEdgeTTS.js +41 -20
  264. package/dist/synthesis/MicrosoftEdgeTTS.js.map +1 -1
  265. package/dist/synthesis/OpenAICloudTTS.d.ts +2 -2
  266. package/dist/synthesis/OpenAICloudTTS.d.ts.map +1 -1
  267. package/dist/synthesis/OpenAICloudTTS.js +6 -5
  268. package/dist/synthesis/OpenAICloudTTS.js.map +1 -1
  269. package/dist/synthesis/SamTTS.d.ts +2 -1
  270. package/dist/synthesis/SamTTS.d.ts.map +1 -1
  271. package/dist/synthesis/SamTTS.js +2 -2
  272. package/dist/synthesis/SamTTS.js.map +1 -1
  273. package/dist/synthesis/SapiTTS.d.ts +2 -2
  274. package/dist/synthesis/SapiTTS.d.ts.map +1 -1
  275. package/dist/synthesis/SapiTTS.js +2 -2
  276. package/dist/synthesis/SapiTTS.js.map +1 -1
  277. package/dist/synthesis/SvoxPicoTTS.d.ts +2 -2
  278. package/dist/synthesis/SvoxPicoTTS.d.ts.map +1 -1
  279. package/dist/synthesis/SvoxPicoTTS.js +3 -3
  280. package/dist/synthesis/SvoxPicoTTS.js.map +1 -1
  281. package/dist/synthesis/VitsTTS.d.ts +3 -3
  282. package/dist/synthesis/VitsTTS.d.ts.map +1 -1
  283. package/dist/synthesis/VitsTTS.js +14 -11
  284. package/dist/synthesis/VitsTTS.js.map +1 -1
  285. package/dist/text-translation/DeepLTextTranslation.d.ts +2 -2
  286. package/dist/text-translation/DeepLTextTranslation.d.ts.map +1 -1
  287. package/dist/text-translation/DeepLTextTranslation.js +10 -9
  288. package/dist/text-translation/DeepLTextTranslation.js.map +1 -1
  289. package/dist/text-translation/GoogleTranslateTextTranslation.d.ts +4 -4
  290. package/dist/text-translation/GoogleTranslateTextTranslation.d.ts.map +1 -1
  291. package/dist/text-translation/GoogleTranslateTextTranslation.js +20 -18
  292. package/dist/text-translation/GoogleTranslateTextTranslation.js.map +1 -1
  293. package/dist/text-translation/NLLBTextTranslation.d.ts +2 -2
  294. package/dist/text-translation/NLLBTextTranslation.d.ts.map +1 -1
  295. package/dist/text-translation/NLLBTextTranslation.js +4 -6
  296. package/dist/text-translation/NLLBTextTranslation.js.map +1 -1
  297. package/dist/typings/TypedArray.d.ts.map +1 -1
  298. package/dist/utilities/Compression.d.ts +4 -3
  299. package/dist/utilities/Compression.d.ts.map +1 -1
  300. package/dist/utilities/Compression.js +9 -9
  301. package/dist/utilities/Compression.js.map +1 -1
  302. package/dist/utilities/FileDownloader.d.ts +6 -3
  303. package/dist/utilities/FileDownloader.d.ts.map +1 -1
  304. package/dist/utilities/FileDownloader.js +25 -21
  305. package/dist/utilities/FileDownloader.js.map +1 -1
  306. package/dist/utilities/FileReader.d.ts.map +1 -1
  307. package/dist/utilities/FileReader.js.map +1 -1
  308. package/dist/utilities/FileSystem.js +1 -1
  309. package/dist/utilities/FileSystem.js.map +1 -1
  310. package/dist/utilities/FileWriter.d.ts.map +1 -1
  311. package/dist/utilities/FileWriter.js.map +1 -1
  312. package/dist/utilities/Hashing.d.ts.map +1 -1
  313. package/dist/utilities/Hashing.js.map +1 -1
  314. package/dist/utilities/Locale.js.map +1 -1
  315. package/dist/utilities/Logger.d.ts +17 -9
  316. package/dist/utilities/Logger.d.ts.map +1 -1
  317. package/dist/utilities/Logger.js +50 -35
  318. package/dist/utilities/Logger.js.map +1 -1
  319. package/dist/utilities/NpmUtilities.d.ts.map +1 -1
  320. package/dist/utilities/NpmUtilities.js +4 -5
  321. package/dist/utilities/NpmUtilities.js.map +1 -1
  322. package/dist/utilities/ObjectUtilities.js.map +1 -1
  323. package/dist/utilities/OpenPromise.d.ts.map +1 -1
  324. package/dist/utilities/OpenPromise.js.map +1 -1
  325. package/dist/utilities/PackageManager.d.ts +4 -1
  326. package/dist/utilities/PackageManager.d.ts.map +1 -1
  327. package/dist/utilities/PackageManager.js +37 -22
  328. package/dist/utilities/PackageManager.js.map +1 -1
  329. package/dist/utilities/PathUtilities.d.ts +2 -0
  330. package/dist/utilities/PathUtilities.d.ts.map +1 -1
  331. package/dist/utilities/PathUtilities.js +5 -2
  332. package/dist/utilities/PathUtilities.js.map +1 -1
  333. package/dist/utilities/RandomGenerator.d.ts.map +1 -1
  334. package/dist/utilities/SignalChannel.d.ts.map +1 -1
  335. package/dist/utilities/SmoothEstimator.d.ts.map +1 -1
  336. package/dist/utilities/SmoothEstimator.js.map +1 -1
  337. package/dist/utilities/StringBuilder.d.ts.map +1 -1
  338. package/dist/utilities/TarballMaker.d.ts +4 -3
  339. package/dist/utilities/TarballMaker.d.ts.map +1 -1
  340. package/dist/utilities/TarballMaker.js +6 -6
  341. package/dist/utilities/TarballMaker.js.map +1 -1
  342. package/dist/utilities/Timeline.js.map +1 -1
  343. package/dist/utilities/Timer.d.ts.map +1 -1
  344. package/dist/utilities/Utilities.d.ts +9 -7
  345. package/dist/utilities/Utilities.d.ts.map +1 -1
  346. package/dist/utilities/Utilities.js +49 -33
  347. package/dist/utilities/Utilities.js.map +1 -1
  348. package/dist/utilities/VirtualFileReadStream.d.ts.map +1 -1
  349. package/dist/utilities/WebReader.d.ts +2 -1
  350. package/dist/utilities/WebReader.d.ts.map +1 -1
  351. package/dist/utilities/WebReader.js +7 -6
  352. package/dist/utilities/WebReader.js.map +1 -1
  353. package/dist/utilities/WikipediaReader.d.ts +2 -1
  354. package/dist/utilities/WikipediaReader.d.ts.map +1 -1
  355. package/dist/utilities/WikipediaReader.js +1 -5
  356. package/dist/utilities/WikipediaReader.js.map +1 -1
  357. package/dist/voice-activity-detection/AdaptiveGateVAD.d.ts +2 -1
  358. package/dist/voice-activity-detection/AdaptiveGateVAD.d.ts.map +1 -1
  359. package/dist/voice-activity-detection/AdaptiveGateVAD.js +1 -1
  360. package/dist/voice-activity-detection/AdaptiveGateVAD.js.map +1 -1
  361. package/dist/voice-activity-detection/SileroVAD.d.ts.map +1 -1
  362. package/dist/voice-activity-detection/SileroVAD.js.map +1 -1
  363. package/dist/voice-activity-detection/WebRtcVAD.d.ts.map +1 -1
  364. package/dist/voice-activity-detection/WebRtcVAD.js +1 -1
  365. package/dist/voice-activity-detection/WebRtcVAD.js.map +1 -1
  366. package/docs/API.md +62 -17
  367. package/docs/CUDA.md +4 -3
  368. package/docs/Engines.md +8 -7
  369. package/docs/Licenses.md +0 -3
  370. package/docs/Options.md +27 -31
  371. package/docs/Server.md +1 -0
  372. package/docs/Tasklist.md +2 -1
  373. package/docs/Technical.md +2 -2
  374. package/package.json +45 -35
  375. package/src/alignment/SemanticTextAlignment.ts +14 -7
  376. package/src/alignment/SpeechAlignment.ts +47 -150
  377. package/src/api/APIOptions.ts +1 -1
  378. package/src/api/Alignment.ts +95 -61
  379. package/src/api/Common.ts +11 -0
  380. package/src/api/Denoising.ts +22 -17
  381. package/src/api/GlobalOptions.ts +4 -20
  382. package/src/api/Recognition.ts +106 -123
  383. package/src/api/SourceSeparation.ts +39 -21
  384. package/src/api/SpeechLanguageDetection.ts +77 -37
  385. package/src/api/SpeechSearch.ts +6 -1
  386. package/src/api/SpeechTranslation.ts +75 -38
  387. package/src/api/Synthesis.ts +220 -116
  388. package/src/api/TextLanguageDetection.ts +10 -12
  389. package/src/api/TextTranslation.ts +43 -26
  390. package/src/api/TimelineTranslationAlignment.ts +41 -13
  391. package/src/api/TranscriptAndTranslationAlignment.ts +28 -15
  392. package/src/api/TranslationAlignment.ts +53 -24
  393. package/src/api/VoiceActivityDetection.ts +33 -68
  394. package/src/audio/AudioPlayer.ts +4 -232
  395. package/src/audio/AudioUtilities.ts +9 -2
  396. package/src/build-tools/MakeTarballsForInstalledPackages.ts +4 -3
  397. package/src/cli/CLI.ts +209 -101
  398. package/src/codecs/FFMpegTranscoder.ts +18 -16
  399. package/src/denoising/NSNet2.ts +5 -4
  400. package/src/denoising/RNNoise.ts +14 -6
  401. package/src/dsp/FFT.ts +2 -1
  402. package/src/dsp/MFCC.ts +7 -5
  403. package/src/dsp/MelSpectrogram.ts +56 -36
  404. package/src/dsp/Rubberband.ts +10 -3
  405. package/src/dsp/Sonic.ts +2 -1
  406. package/src/dsp/SpeexResampler.ts +2 -1
  407. package/src/encodings/Ascii.ts +1 -1
  408. package/src/encodings/Base64.ts +1 -1
  409. package/src/math/VectorMath.ts +10 -6
  410. package/src/nlp/EspeakPhonemizer.ts +2 -2
  411. package/src/nlp/Segmentation.ts +9 -4
  412. package/src/recognition/AmazonTranscribeSTT.ts +4 -3
  413. package/src/recognition/AzureCognitiveServicesSTT.ts +5 -4
  414. package/src/recognition/DeepgramSTT.ts +16 -16
  415. package/src/recognition/GoogleCloudSTT.ts +14 -12
  416. package/src/recognition/OpenAICloudSTT.ts +12 -6
  417. package/src/recognition/WhisperCommon.ts +130 -0
  418. package/src/recognition/{WhisperCppSTT.ts → WhisperCppCliSTT.ts} +73 -133
  419. package/src/recognition/WhisperSTT.ts +569 -718
  420. package/src/server/Client.ts +4 -4
  421. package/src/server/Worker.ts +59 -59
  422. package/src/source-separation/MDXNetSourceSeparation.ts +15 -10
  423. package/src/speech-embeddings/WavToVec2BertFeatureEmbeddings.ts +7 -5
  424. package/src/speech-language-detection/SileroLanguageDetection.ts +18 -9
  425. package/src/speech-search/DTWSpeechSearch.ts +6 -5
  426. package/src/subtitles/Subtitles.ts +22 -22
  427. package/src/synthesis/AwsPollyTTS.ts +12 -5
  428. package/src/synthesis/AzureCognitiveServicesTTS.ts +11 -3
  429. package/src/synthesis/CoquiServerTTS.ts +8 -7
  430. package/src/synthesis/DeepgramTTS.ts +21 -15
  431. package/src/synthesis/ElevenLabsTTS.ts +33 -23
  432. package/src/synthesis/EspeakTTS.ts +145 -69
  433. package/src/synthesis/FliteTTS.ts +3 -3
  434. package/src/synthesis/GnuSpeechTTS.ts +2 -2
  435. package/src/synthesis/GoogleCloudTTS.ts +23 -14
  436. package/src/synthesis/GoogleTranslateTTS.ts +19 -11
  437. package/src/synthesis/KokoroTTS.ts +37 -14
  438. package/src/synthesis/MicrosoftEdgeTTS.ts +71 -23
  439. package/src/synthesis/OpenAICloudTTS.ts +7 -6
  440. package/src/synthesis/SamTTS.ts +3 -2
  441. package/src/synthesis/SapiTTS.ts +3 -3
  442. package/src/synthesis/SvoxPicoTTS.ts +4 -5
  443. package/src/synthesis/VitsTTS.ts +43 -15
  444. package/src/text-translation/DeepLTextTranslation.ts +12 -10
  445. package/src/text-translation/GoogleTranslateTextTranslation.ts +35 -21
  446. package/src/text-translation/NLLBTextTranslation.ts +5 -9
  447. package/src/typings/Fillers.d.ts +0 -60
  448. package/src/typings/TypedArray.ts +12 -1
  449. package/src/utilities/Compression.ts +10 -9
  450. package/src/utilities/FileDownloader.ts +38 -23
  451. package/src/utilities/FileSystem.ts +1 -1
  452. package/src/utilities/Logger.ts +59 -42
  453. package/src/utilities/NpmUtilities.ts +4 -6
  454. package/src/utilities/OpenPromise.ts +1 -2
  455. package/src/utilities/PackageManager.ts +53 -26
  456. package/src/utilities/PathUtilities.ts +6 -2
  457. package/src/utilities/TarballMaker.ts +7 -7
  458. package/src/utilities/Utilities.ts +58 -41
  459. package/src/utilities/WebReader.ts +11 -6
  460. package/src/utilities/WikipediaReader.ts +2 -8
  461. package/src/voice-activity-detection/AdaptiveGateVAD.ts +13 -8
  462. package/src/voice-activity-detection/WebRtcVAD.ts +1 -2
  463. package/tsconfig.json +53 -54
  464. package/dist/audio/AudioRecorder.d.ts +0 -4
  465. package/dist/audio/AudioRecorder.d.ts.map +0 -1
  466. package/dist/audio/AudioRecorder.js +0 -68
  467. package/dist/audio/AudioRecorder.js.map +0 -1
  468. package/dist/audio/SoxPath.d.ts +0 -2
  469. package/dist/audio/SoxPath.d.ts.map +0 -1
  470. package/dist/audio/SoxPath.js +0 -24
  471. package/dist/audio/SoxPath.js.map +0 -1
  472. package/dist/recognition/SileroSTT.d.ts +0 -30
  473. package/dist/recognition/SileroSTT.d.ts.map +0 -1
  474. package/dist/recognition/SileroSTT.js +0 -152
  475. package/dist/recognition/SileroSTT.js.map +0 -1
  476. package/dist/recognition/VoskSTT.d.ts +0 -11
  477. package/dist/recognition/VoskSTT.d.ts.map +0 -1
  478. package/dist/recognition/VoskSTT.js +0 -72
  479. package/dist/recognition/VoskSTT.js.map +0 -1
  480. package/dist/recognition/WhisperCppSTT.d.ts.map +0 -1
  481. package/dist/recognition/WhisperCppSTT.js.map +0 -1
  482. package/dist/synthesis/StreamlabsPollyTTS.d.ts +0 -12
  483. package/dist/synthesis/StreamlabsPollyTTS.d.ts.map +0 -1
  484. package/dist/synthesis/StreamlabsPollyTTS.js +0 -88
  485. package/dist/synthesis/StreamlabsPollyTTS.js.map +0 -1
  486. package/dist/utilities/BinaryUtilities.d.ts +0 -14
  487. package/dist/utilities/BinaryUtilities.d.ts.map +0 -1
  488. package/dist/utilities/BinaryUtilities.js +0 -113
  489. package/dist/utilities/BinaryUtilities.js.map +0 -1
  490. package/src/audio/AudioRecorder.ts +0 -91
  491. package/src/audio/SoxPath.ts +0 -31
  492. package/src/recognition/SileroSTT.ts +0 -222
  493. package/src/recognition/VoskSTT.ts +0 -112
  494. package/src/synthesis/StreamlabsPollyTTS.ts +0 -114
  495. package/src/utilities/BinaryUtilities.ts +0 -138
  496. /package/{LICENSE.md → LICENSE.GPLv3.md} +0 -0
package/docs/Engines.md CHANGED
@@ -16,7 +16,6 @@
16
16
  **Offline, Windows only**:
17
17
 
18
18
  * [SAPI](https://en.wikipedia.org/wiki/Microsoft_Speech_API) (`sapi`): Microsoft Speech API. Supports the system's language voices, as well as legacy voices produced by third-party vendors, like Ivona, NeoSpeech, Acapela, Cepstral, CereProc, Nuance, AT&T, Loquendo, ScanSoft and others (note that only 64-bit SAPI voices are supported, which makes it incompatible with a significant portion of older voices)
19
-
20
19
  * [Microsoft Speech Platform](https://www.microsoft.com/en-us/download/details.aspx?id=27225) (`msspeech`): Microsoft Server Speech API. Requires [installing a runtime (2.6MB)](https://www.microsoft.com/en-us/download/details.aspx?id=27225). Supports 28 dialects, which can be individually downloaded via [freely available installers](https://www.microsoft.com/en-us/download/details.aspx?id=27224), or, for convenience, bundled as [a single 358MB zip file](https://drive.google.com/u/0/uc?id=1uQdFNxLzUxpaEwVVKhMawys8cIh3F21T&export=download). Has voices for English (US, UK, AU, CA), Spanish (ES, MX), Portuguese (BR, PT), German, French (FR, CA), Italian, Norwegian, Dutch, Russian, Swedish, Danish, Catalan, Finnish, Japanese, Korean and Chinese (ZH, HK, TW). All voices are female
21
20
 
22
21
  **Note**: both these engines require manually installing the [`winax` npm package](https://www.npmjs.com/package/winax) by running `npm install winax -g`.
@@ -44,15 +43,13 @@ These cloud-based engines connect to public cloud APIs that are not officially p
44
43
 
45
44
  * Google Translate (`google-translate`): used by the [Google Translate web UI](https://translate.google.com/) to speak written text in any one of its supported languages. Offers a single voice for each language (usually female)
46
45
  * Microsoft Edge (`microsoft-edge`): subset of the Azure Cognitive Services cloud TTS API used by the Microsoft Edge browser as part of its support for the [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API) and its [Read Aloud](https://www.microsoft.com/en-us/edge/features/read-aloud?form=MT00D8) feature. Using this engine requires a special token, which should be passed via the `microsoftEdge.trustedClientToken` option
47
- * Streamlabs Polly (`streamlabs-polly`): a public REST API by Streamlabs, primarily intended for generating speech for TTS donations. It includes a few English (US, UK, AU, IN) voices, which are similar to some of the non-neural (Ivona-based) voices offered by Amazon Polly (**Note**: as of April 2024, the public Streamlabs Polly REST API doesn't seem to be accessible anymore)
48
46
 
49
47
  ## Speech-to-text
50
48
 
51
49
  **Offline**:
52
- * [OpenAI Whisper](https://github.com/openai/whisper) (`whisper`): high-accuracy transformer-based speech recognition architecture. TypeScript implementation, with inference done via the [ONNX runtime](https://onnxruntime.ai/). Supports [98 languages](https://platform.openai.com/docs/guides/speech-to-text/supported-languages). There are several models of different sizes, some are multilingual, and some are English only: `tiny`, `tiny.en`, `base`, `base.en`, `small`, `small.en`, `medium`, `medium.en`, `large-v3-turbo`. **Note**: Unquantized large models are not currently supported by `onnxruntime-node` due to model size restrictions
53
- * [Whisper.cpp](https://github.com/ggerganov/whisper.cpp) (`whisper.cpp`): a C++ port of the Whisper architecture by Georgi Gerganov. Supports all Whisper models, including several quantized ones (see full model list in the [options reference](docs/Options.md)). Has various builds, including CUDA and OpenCL for GPU support
54
- * [Vosk](https://github.com/alphacep/vosk-api) (`vosk`): models available for 25+ languages. **Note**: the Vosk package is not included in the default installation, but you can add support for it using `npm install @echogarden/vosk -g`. Then, you'll need to manually [download a model](https://alphacephei.com/vosk/models) and specify its directory path via the `vosk.modelPath` option
55
- * [Silero](https://github.com/snakers4/silero-models) (`silero`): models available for English, Spanish, German and Ukrainian. For [non-commercial use only](https://github.com/snakers4/silero-models/blob/master/LICENSE)
50
+
51
+ * [OpenAI Whisper](https://github.com/openai/whisper) (`whisper`): high-accuracy transformer-based speech recognition architecture. TypeScript implementation. Since `v3.0.0`, it internally uses a minimal NAPI binding to a small set of `whisper.cpp` operations via its C API (before `v3.0.0` it used a much slower ONNX-based implementation)
52
+ * [Whisper.cpp](https://github.com/ggerganov/whisper.cpp) (`whisper.cpp`): uses the CLI (command line interface) of `whisper.cpp`, a C++ port of the Whisper architecture by Georgi Gerganov
56
53
 
57
54
  **Cloud services**:
58
55
 
@@ -75,10 +72,12 @@ These engines' goal is to match (or "align") a given spoken recording with a giv
75
72
  ## Speech-to-text translation
76
73
 
77
74
  **Offline**:
75
+
78
76
  * [Whisper](https://github.com/openai/whisper) (`whisper`): the Whisper model can recognize speech in any one of its supported languages and output a transcript directly translated to English. Other languages are not supported as targets
79
- * [Whisper.cpp](https://github.com/ggerganov/whisper.cpp) (`whisper.cpp`): supports translation to English
77
+ * [Whisper.cpp](https://github.com/ggerganov/whisper.cpp) (`whisper.cpp`): uses `whisper.cpp` CLI. Supports translation to English only
80
78
 
81
79
  **Cloud services**:
80
+
82
81
  * [OpenAI Cloud Platform](https://platform.openai.com/) (`openai-cloud`): runs the `large-v2` Whisper model on the cloud. Only supports English as target
83
82
 
84
83
  ## Text-to-text translation
@@ -121,10 +120,12 @@ Another use case it to take a timeline produced as part of synthesized or recogn
121
120
  ## Language detection
122
121
 
123
122
  **Spoken language detection**:
123
+
124
124
  * [Whisper](https://github.com/openai/whisper) (`whisper`): uses the language token produced by the `whisper` speech recognition model to generate a set of probabilities for the [98 languages](https://platform.openai.com/docs/guides/speech-to-text/supported-languages) it has been trained on
125
125
  * [Silero Language Classifier](https://github.com/snakers4/silero-vad/wiki/Other-Models) (`silero`): a speech language classification model by Silero
126
126
 
127
127
  **Text language detection**:
128
+
128
129
  * [TinyLD](https://www.npmjs.com/package/tinyld) (`tinyld`): a simple language detection library
129
130
  * [FastText](https://github.com/facebookresearch/fastText) (`fasttext`): a library for word representations and sentence classification by Facebook research
130
131
 
package/docs/Licenses.md CHANGED
@@ -8,7 +8,6 @@
8
8
  * `pico`: [Apache License 2.0](https://github.com/gmn/nanotts/blob/master/LICENSE)
9
9
  * `gnuspeech`: [GNU GPL v3](https://github.com/mym-br/gnuspeech_sa/blob/master/COPYING.txt)
10
10
  * `sam`: [Abandonware / fair-use / unknown](https://github.com/discordier/sam#license)
11
- * `vosk` [Apache License 2.0](https://github.com/alphacep/vosk-api/blob/master/COPYING)
12
11
  * `tinyld` [MIT License](https://github.com/komodojp/tinyld/blob/develop/license)
13
12
  * `fasttext`: [MIT License](https://github.com/loretoparisi/fasttext.js/blob/master/LICENSE)
14
13
  * `fvad` [BSD-3-Clause](https://github.com/cpuimage/WebRTC_VAD/blob/master/LICENSE)
@@ -31,7 +30,6 @@ All are freely distributable, with varying licenses:
31
30
  * Flite voices (`flite-`): [BSD License](https://github.com/festvox/flite/blob/master/COPYING)
32
31
  * SVOX Pico resources (`pico-`): [Apache License 2.0](https://github.com/gmn/nanotts/blob/master/LICENSE)
33
32
  * Silero VAD (`silero-vad`) and Silero language classifier (`silero-lang-classifier-95`): [MIT License](https://github.com/snakers4/silero-vad/blob/master/LICENSE)
34
- * Silero speech recognition models (`silero-en-`, `silero-de-`, `silero-es-`, `silero-ua-`): [BY-NC-SA](https://github.com/snakers4/silero-models/blob/master/LICENSE)
35
33
  * VITS pre-trained models (`vits-`): licensed under various creative commons licenses: [CC0](https://creativecommons.org/share-your-work/public-domain/cc0/), [CC-BY](https://creativecommons.org/licenses/by/4.0/) and [BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/), and few are public domain. You can view the individual license for each model in the model cards on the [Piper samples page](https://rhasspy.github.io/piper-samples/)
36
34
  * Whisper pre-trained models (`whisper-`): [MIT License](https://github.com/openai/whisper/blob/main/LICENSE)
37
35
  * MDX-NET source separation models (`mdxnet-`): [MIT License](https://github.com/kuielab/mdx-net/blob/main/LICENSE)
@@ -39,5 +37,4 @@ All are freely distributable, with varying licenses:
39
37
 
40
38
  Tool binary distributions
41
39
  * FFmpeg: [LGPL, GPL v2 and GPL v3 Licenses](https://github.com/FFmpeg/FFmpeg)
42
- * SoX: [GPL v2 License](https://github.com/chirlu/sox/blob/master/LICENSE.GPL)
43
40
  * whisper.cpp: [MIT License](https://github.com/ggerganov/whisper.cpp/blob/master/LICENSE)
package/docs/Options.md CHANGED
@@ -12,7 +12,7 @@ Here's a detailed reference for all the options accepted by the Echogarden CLI a
12
12
  Applies to CLI operations: `speak`, `speak-file`, `speak-url`, `speak-wikipedia`, API method: `synthesize`
13
13
 
14
14
  **General**:
15
- * `engine`: identifier of the synthesis engine to use. Can be `kokoro`, `vits`, `pico`, `flite`, `gnuspeech`, `espeak`, `sam`, `sapi`, `msspeech`, `coqui-server`, `google-cloud`, `microsoft-azure`, `amazon-polly`, `openai-cloud`, `elevenlabs`, `google-translate`, `microsoft-edge` or `streamlabs-polly` (see [the engines documentation page](Engines.md) for more detailed information about each engine). Auto-selected if not set
15
+ * `engine`: identifier of the synthesis engine to use. Can be `kokoro`, `vits`, `pico`, `flite`, `gnuspeech`, `espeak`, `sam`, `sapi`, `msspeech`, `coqui-server`, `google-cloud`, `microsoft-azure`, `amazon-polly`, `openai-cloud`, `elevenlabs`, `google-translate` or `microsoft-edge` (see [the engines documentation page](Engines.md) for more detailed information about each engine). Auto-selected if not set
16
16
  * `language`: language code, can be ([ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)), like `en`, `fr`, `en-US`, `pt-BR`, etc. [ISO 639-3](https://en.wikipedia.org/wiki/ISO_639-3), or a plain language name like `french`. Auto-detected if not set
17
17
  * `voice`: name of the voice to use. Can be a search string. Auto-selected if not set
18
18
  * `voiceGender`: gender of the voice to use. Optional
@@ -146,7 +146,7 @@ Also accepted are the following engine-specific options that may be required in
146
146
  Applies to CLI operation: `transcribe`, API method: `recognize`
147
147
 
148
148
  **General**:
149
- * `engine`: identifier of the recognition engine to use, can be `whisper`, `whisper.cpp`, `vosk` or `silero` (see [the full engine list](Engines.md) for more detailed information)
149
+ * `engine`: identifier of the recognition engine to use, can be `whisper`, `whisper.cpp`, `google-cloud`, `microsoft-azure`, `amazon-transcribe`, `openai-cloud`, `deepgram` (see [the full engine list](Engines.md) for more detailed information)
150
150
  * `language`: language code ([ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)) for the audio, like `en`, `fr`, `de`. Auto-detected if not set
151
151
  * `crop`: crop to active parts using voice activity detection before starting recognition. Defaults to `true`
152
152
  * `isolate`: apply source separation to isolate voice before starting recognition. Defaults to `false`
@@ -157,7 +157,10 @@ Applies to CLI operation: `transcribe`, API method: `recognize`
157
157
  * `sourceSeparation`: prefix to provide options for source separation when `isolate` is set to `true`. Options detailed in section for source separation
158
158
 
159
159
  **Whisper**:
160
- * `whisper.model`: selects which Whisper model to use. Can be `tiny`, `tiny.en`, `base`, `base.en`, `small`, `small.en`, `medium`, `medium.en` or `large-v3-turbo`. Defaults to `tiny` or `tiny.en`
160
+ * `whisper.model`: selects which Whisper model to use. Can be `tiny`, `tiny.en`, `base`, `base.en`, `small`, `small.en`, `medium`, `medium.en`, `large` (same as `large-v2`), `large-v1`, `large-v2`, `large-v3`, `large-v3-turbo`. The following quantized models are also supported: `tiny-q5_1`,`tiny-q8_0`, `tiny.en-q5_1`, `tiny.en-q8_0`,`base-q5_1`, `base-q8_0`, `base.en-q5_1`, `base.en-q8_0`,`small-q5_1`, `small.en-q5_1`, `small.en-q8_0`,`medium-q5_0`, `medium.en-q5_0`, `medium.en-q8_0`, `large-v2-q5_0`, `large-v2-q8_0`, `large-v3-q5_0`, `large-v3-turbo-q5_0`, `large-v3-turbo-q8_0`. Defaults to `base` or `base.en` for English
161
+ * `whisper.enableGPU`: enable GPU processing. Setting to `true` will try to use a CUDA build, if available for your architecture (currently CUDA 12.4 builds are available for Windows x64 and Linux x64).
162
+ * `whisper.threadCount`: number of threads to use, defaults to `4`
163
+ * `whisper.gpuDeviceIndex`: GPU device index (if GPU is enabled), defaults to `0`
161
164
  * `whisper.temperature`: temperature setting for the text decoder. Impacts the amount of randomization for token selection. It is recommended to leave at `0.1` (close to no randomization - almost always chooses the top ranked token) or choose a relatively low value (`0.25` or lower) for best results. Defaults to `0.1`
162
165
  * `whisper.prompt`: initial text to give the Whisper model. Can be a vocabulary, or example text of some sort. Note that if the prompt is very similar to the transcript, the model may intentionally avoid producing the transcript tokens as it may assume that they have already been transcribed. Optional
163
166
  * `whisper.topCandidateCount`: the number of top candidate tokens to consider. Defaults to `5`
@@ -168,17 +171,15 @@ Applies to CLI operation: `transcribe`, API method: `recognize`
168
171
  * `whisper.repetitionThreshold`: minimal repetition / compressibility score to cause a part not to be auto-prompted to the next part. Defaults to `2.4`
169
172
  * `whisper.decodeTimestampTokens`: enable/disable decoding of timestamp tokens. Setting to `false` can reduce the occurrence of hallucinations and token repetition loops, possibly due to the overall reduction in the number of tokens decoded. This has no impact on the accuracy of timestamps, since they are derived independently using cross-attention weights. However, there are cases where this can cause the model to end a part prematurely, especially in singing and less speech-like voice segments, or when there are multiple speakers. Defaults to `true`
170
173
  * `whisper.timestampAccuracy`: timestamp accuracy. can be `medium` or `high`. `medium` uses a reduced subset of attention heads for alignment, `high` uses all attention heads and is thus more accurate at the word level, but slower for larger models. Defaults to `high` for the `tiny` and `base` models, and `medium` for the larger models
171
- * `whisper.encoderProvider`: identifier for the ONNX execution provider to use with the encoder model. Can be `cpu`, `dml` (Windows only, uses [DirectML](https://microsoft.github.io/DirectML/)-based GPU acceleration), or `cuda` (Linux only, requires system-wide installation of CUDA and cuDNN SDKs, see [this guide](./CUDA.md) for more detailed information). In general, GPU-based encoding should be significantly faster. Defaults to `cpu`, or `dml` if available
172
- * `whisper.decoderProvider`: identifier for the ONNX execution provider to use with the decoder model. Can be `cpu`, `dml` (Windows only, uses [DirectML](https://microsoft.github.io/DirectML/)-based GPU acceleration), or `cuda` (Linux only, requires system-wide installation of CUDA and cuDNN SDKs, see [this guide](./CUDA.md) for more detailed information).. Using GPU acceleration for the decoder may be faster than CPU, especially for larger models, but that depends on your particular combination of CPU and GPU. Defaults to `cpu`, and on Windows, `dml` if available, for larger models (`small`, `medium`, `large`)
173
174
  * `whisper.seed`: provide a custom random seed for token selection when temperature is greater than 0. Uses a constant seed by default to ensure reproducibility
174
175
 
175
- **Whisper.cpp**:
176
- * `whisperCpp.model`: selects which `whisper.cpp` model to use. Can be `tiny`, `tiny.en`, `base`, `base.en`, `small`, `small.en`, `medium`, `medium.en`, `large` (same as `large-v2`), `large-v1`, `large-v2`, `large-v3`, `large-v3-turbo`. The following quantized models are also supported: `tiny-q5_1`, `tiny.en-q5_1`, `tiny.en-q8_0`,`base-q5_1`, `base.en-q5_1`, `small-q5_1`, `small.en-q5_1`, `medium-q5_0`, `medium.en-q5_0`, `large-v2-q5_0`, `large-v3-q5_0`, `large-v3-turbo-q5_0`. Defaults to `base` or `base.en`
176
+ **Whisper.cpp CLI**:
177
+ * `whisperCpp.model`: selects which `whisper.cpp` model to use. Model identifiers and defaults are identical to those in the `whisper` engine
177
178
  * `whisperCpp.executablePath`: a path to a custom `whisper.cpp` `whisper-cli` executable (currently required for macOS)
178
179
  * `whisperCpp.build`: type of `whisper.cpp` build to use. Can be set to `cpu`, `cublas-12.4.0` or `custom`. By default, builds are auto-selected and downloaded for Windows x64 and Linux x64 (for both `cpu` and `cublas-12.4.0`). The Linux CUDA build requires a [system-wide installation of CUDA Toolkit 12.4+](https://developer.nvidia.com/cuda-downloads), available on path. Using other builds requires providing a custom `executablePath`, which will automatically set this option to `custom`
180
+ * `whisperCpp.enableGPU`: enable GPU processing. Setting to `true` will try to use a CUDA build, if available for your system. Defaults to `true` when a CUDA-enabled build is selected via `whisperCpp.build`, otherwise `false`. If a custom build is used, it will enable or disable GPU for that build
179
181
  * `whisperCpp.threadCount`: number of threads to use, defaults to `4`
180
182
  * `whisperCpp.splitCount`: number of splits of the audio data to process in parallel (called `--processors` in the `whisper.cpp` CLI). A value greater than `1` can increase memory use significantly, reduce timing accuracy, and slow down execution in some cases. Defaults to `1` (highly recommended)
181
- * `whisperCpp.enableGPU`: enable GPU processing. Setting to `true` will try to use a CUDA build, if available for your system. Defaults to `true` when a CUDA-enabled build is selected via `whisperCpp.build`, otherwise `false`. If a custom build is used, it will enable or disable GPU for that build
182
183
  * `whisperCpp.topCandidateCount`: the number of top candidate tokens to consider. Defaults to `5`
183
184
  * `whisperCpp.beamCount`: the number of decoding paths to use during beam search. Defaults to `5`
184
185
  * `whisperCpp.temperature`: set temperature. Defaults to `0.0`
@@ -189,13 +190,6 @@ Applies to CLI operation: `transcribe`, API method: `recognize`
189
190
  * `whisperCpp.enableFlashAttention`: enable flash attention. Can significantly increase performance for some configurations (**Note**: setting this to `true` will cause `enableDTW` to always be set to `false` since it's not compatible with flash attention). Defaults to `false`
190
191
  * `whisperCpp.verbose`: show all CLI messages during execution. Defaults to `false`
191
192
 
192
- **Vosk**:
193
- * `vosk.modelPath`: path to the Vosk model to be used
194
-
195
- **Silero**:
196
- * `silero.modelPath`: path to a Silero model. Note that latest `en`, `de`, `fr` and `uk` models are automatically installed when needed based on the selected language. This should only be used to manually specify a different model, otherwise specify `language` instead
197
- * `silero.provider`: ONNX execution provider to use. Can be `cpu`, `dml` (Windows only, uses [DirectML](https://microsoft.github.io/DirectML/)-based GPU acceleration), or `cuda` (Linux only, requires system-wide installation of CUDA and cuDNN SDKs, see [this guide](./CUDA.md) for more detailed information). Defaults to `cpu`, or `dml` if available
198
-
199
193
  **Google Cloud**:
200
194
  * `googleCloud.apiKey`: Google Cloud API key (required)
201
195
  * `googleCloud.alternativeLanguageCodes`: An array of alternative language codes. Optional
@@ -258,19 +252,20 @@ Applies to CLI operation: `align`, API method: `align`
258
252
 
259
253
  Applies to the `whisper` engine only. To provide Whisper options for `dtw-ra`, use `recognition.whisper` instead.
260
254
 
261
- * `whisper.model`: Whisper model to use. Defaults to `tiny` or `tiny.en`
255
+ * `whisper.model`: Whisper model to use. Defaults to `base` or `base.en`
256
+ * `whisper.enableGPU`: enable whisper GPU build. See details in recognition section above
257
+ * `whisper.threadCount`: number of threads to use, defaults to `4`
258
+ * `whisper.gpuDeviceIndex`: GPU device index (if GPU is enabled), defaults to `0`
262
259
  * `whisper.endTokenThreshold`: minimal probability to accept an end token for a recognized part. The probability is measured via the softmax between the end token's logit and the second highest logit. You can try to adjust this threshold in cases the model is ending a part with too few, or many tokens decoded. Defaults to `0.9`. On the last audio part, it is always effectively set to `Infinity`, to ensure the remaining transcript tokens are decoded in full
263
260
  * `whisper.maxTokensPerPart`: maximum number of tokens to decode per part. Should help avoid edge cases where the model never reaches an end token for the part, which otherwise may cause the model to decode too many tokens and eventually crash. Defaults to `220` (highest possible)
264
261
  * `whisper.timestampAccuracy`: timestamp accuracy. can be `medium` or `high`. `medium` uses a reduced subset of attention heads for alignment, `high` uses all attention heads and is thus more accurate at the word level, but slower for larger models. Defaults to `high` for the `tiny` and `base` models, and `medium` for the larger models. Note: setting `high` for model `large-v3-turbo` reverts to `medium`, due to poor results with the `high` setting for that model (possibly related to the 16-bit quantization).
265
- * `whisper.encoderProvider`: encoder ONNX provider. See details in recognition section above
266
- * `whisper.decoderProvider`: decoder ONNX provider. See details in recognition section above
267
262
 
268
263
  ## Speech-to-text translation
269
264
 
270
265
  Applies to CLI operation: `translate-speech`, API method: `translateSpeech`
271
266
 
272
267
  **General**:
273
- * `engine`: only `whisper` supported
268
+ * `engine`: Can be `whisper`, `whisper.cpp` or `openai-cloud`. Defaults to `whisper`
274
269
  * `sourceLanguage`: the source language code for the input speech. Auto-detected if not set
275
270
  * `targetLanguage`: the target language code for the output speech. Only `en` (English) supported by the `whisper` engine. Optional
276
271
  * `crop`: crop to active parts using voice activity detection before starting. Defaults to `true`
@@ -283,9 +278,9 @@ Applies to CLI operation: `translate-speech`, API method: `translateSpeech`
283
278
 
284
279
  * `whisper`: prefix to provide options for the Whisper model. Same options as detailed in the recognition section above
285
280
 
286
- **Whisper.cpp**:
281
+ **Whisper.cpp CLI**:
287
282
 
288
- * `whisper.cpp`: prefix to provide options for the Whisper.cpp model. Same options as detailed in the recognition section above
283
+ * `whisperCpp`: prefix to provide options for the Whisper.cpp model. Same options as detailed in the recognition section above
289
284
 
290
285
  **OpenAI Cloud**:
291
286
 
@@ -321,10 +316,11 @@ Applies to CLI operation: `align-translation`, API method: `alignTranslation`
321
316
  * `sourceSeparation`: prefix to provide options for source separation when `isolate` is set to `true`. Options detailed in section for source separation
322
317
 
323
318
  **Whisper**:
324
- * `whisper.model`: Whisper model to use. Only multilingual models can be used. Defaults to `tiny`
319
+ * `whisper.model`: Whisper model to use. Only multilingual models can be used. Defaults to `base`
320
+ * `whisper.enableGPU`: enable whisper GPU build. See details in recognition section above
321
+ * `whisper.threadCount`: number of threads to use, defaults to `4`
322
+ * `whisper.gpuDeviceIndex`: GPU device index (if GPU is enabled), defaults to `0`
325
323
  * `whisper.endTokenThreshold`: see details in the alignment section above
326
- * `whisper.encoderProvider`: encoder ONNX execution provider. See details in recognition section above
327
- * `whisper.decoderProvider`: decoder ONNX execution provider. See details in recognition section above
328
324
 
329
325
  ## Speech-to-transcript-and-translation alignment
330
326
 
@@ -371,10 +367,11 @@ Applies to CLI operation: `detect-speech-langauge`, API method: `detectSpeechLan
371
367
  * `vad`: prefix to provide options for voice activity detection when `crop` is set to `true`. Options detailed in section for voice activity detection
372
368
 
373
369
  **Whisper**:
374
- * `whisper.model`: Whisper model to use. See model list in the recognition section
370
+ * `whisper.model`: Whisper model to use. See model list in the recognition section. Defaults to `tiny`
371
+ * `whisper.enableGPU`: enable whisper GPU build. See details in recognition section above
372
+ * `whisper.threadCount`: number of threads to use, defaults to `4`
373
+ * `whisper.gpuDeviceIndex`: GPU device index (if GPU is enabled), defaults to `0`
375
374
  * `whisper.temperature`: impacts the distribution of candidate languages when applying the softmax function to compute language probabilities over the model output. Higher temperature causes the distribution to be more uniform, while lower temperature causes it to be more strongly weighted towards the best scoring candidates. Defaults to `1.0`
376
- * `whisper.encoderProvider`: encoder ONNX execution provider. See details in recognition section above
377
- * `whisper.decoderProvider`: decoder ONNX execution provider. See details in recognition section above
378
375
 
379
376
  **Silero**:
380
377
  * `silero.provider`: ONNX execution provider to use. Can be `cpu`, `dml` (Windows only, uses [DirectML](https://microsoft.github.io/DirectML/)-based GPU acceleration), or `cuda` (Linux only, requires system-wide installation of CUDA and cuDNN SDKs, see [this guide](./CUDA.md) for more detailed information). Using GPU may be faster, but the initialization overhead is larger. **Note**: `dml` provider seems to be unstable at the moment for this model. Defaults to `cpu`
@@ -455,9 +452,8 @@ These are shared between text-to-speech, speech-to-text and alignment operations
455
452
  On the CLI, global options can be used with any operation. To set global options via the API, use the `setGlobalOption(key, value)` method (see the [API reference](API.md) for more details).
456
453
 
457
454
  * `ffmpegPath`: sets a custom path for the FFmpeg executable
458
- * `soxPath`: sets a custom path for the SoX executable
459
455
  * `packageBaseURL`: sets a custom base URL for the remote package repository used to download missing packages. Default is `https://huggingface.co/echogarden/echogarden-packages/resolve/main/`. If `huggingface.co` isn't accessible in your location, you can set to use a mirror by changing `huggingface.co` to an alternative domain like `hf-mirror.com`
460
- * `logLevel`: adjusts the quantity of log messages shown during processing. Possible values: `silent`, `output`, `error`, `warning`, `info`, `trace`. Defaults to `info`
456
+ * `logLevel`: adjusts the default amount of log messages shown during processing. Possible values: `silent`, `output`, `error`, `warning`, `info`, `trace`. Defaults to `info`
461
457
 
462
458
 
463
459
  ## CLI options
@@ -465,10 +461,10 @@ On the CLI, global options can be used with any operation. To set global options
465
461
  These options are for the CLI only.
466
462
 
467
463
  * `--play`, `--no-play`: enable/disable audio playback. Defaults to play if there is no output file specified
468
- * `--player`: audio player to use. Can be `audio-io` (uses the [`audio-io` package](https://github.com/echogarden-project/audio-io) to directly output to native OS audio buffers) or `sox` (requires `sox` to be available on path on macOS, auto-downloaded on other platforms). Defaults to `audio-io`
464
+ * `--player`: audio player to use. Can only be `audio-io` (uses the [`audio-io` package](https://github.com/echogarden-project/audio-io) to directly output to native OS audio buffers). Defaults to `audio-io`
469
465
  * `--overwrite`, `--no-overwrite`: overwrite/keep existing files. Doesn't overwrite by default
470
466
  * `--debug`, `--no-debug`: show/hide the full details of JavaScript errors, if they occur. Disabled by default
471
- * `--config=...`: path to configuration file to use. Defaults to `echogarden.config` or `echogarden.config.json`, if found at the current directory
467
+ * `--config=...`: path to configuration file to use. Defaults to `echogarden.config` or `echogarden.config.json` or `echogarden.config.json5`, if found at the current directory
472
468
 
473
469
  ## Using a configuration file
474
470
 
package/docs/Server.md CHANGED
@@ -11,6 +11,7 @@ echogarden serve [options]
11
11
  ```
12
12
 
13
13
  **Options** (all optional):
14
+
14
15
  * `port`: Port number. Defaults to `45054`
15
16
  * `secure`: Start a secure server? Defaults to `false`
16
17
  * `certPath`: Path to a certificate file, required when `secure = true`
package/docs/Tasklist.md CHANGED
@@ -127,6 +127,7 @@
127
127
  * Add SAPI pronunciation to lexicons (you already have the pronunciations for `en_US` and `en_GB`)
128
128
  * Try to use entity recognition to detect years, dates, currencies etc., which would disambiguate cases where it is not clear, like "in 1993" in "She was born in 1993" and "It searched in 1993 websites"
129
129
  * Option to add POS tags to timeline, if available
130
+ * `≈` symbol as a word character
130
131
 
131
132
  ### Synthesis / VITS
132
133
  * Consider adding `⦁︎` (when surrounded by whitespace) as phrase separator
@@ -144,6 +145,7 @@
144
145
  * Currently, when input is set to be SSML, it is wrapped in a `<speak>` tag. Handle the case where the user made their own SSML document wrapped with a `<speak>` tag as well. Currently, it may send invalid input to Azure
145
146
 
146
147
  ### Recognition
148
+ * Add token UTF-8 bytes in token entries on timeline. Some tokens are only a part of a codepoint, so this will allow to know exactly what they contain - the string representation is would be a Unicode error symbol in that case
147
149
  * Show alternatives when playing in the CLI. Clear current line and rewrite already printed text for alternatives during the speech recognition process
148
150
 
149
151
  ### Recognition / Whisper
@@ -244,7 +246,6 @@
244
246
  * Live input / microphone recognition
245
247
  * Implement beam search for Whisper decoder
246
248
  * Implement beam search for Silero decoder
247
- * Live Vosk alternatives events
248
249
  * Investigate exporting Whisper models to 16-bit quantized ONNX or a mix of 16-bit and 32-bit
249
250
 
250
251
  ### Alignment
package/docs/Technical.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  * Echogarden is written in TypeScript and targets the Node.js platform.
4
4
  * It uses ESM modules and latest ECMAScript and TypeScript features.
5
- * It does not depend on essential binary executables. Instead, all of its engines either use pure JavaScript, WebAssembly, WASI, or the ONNX runtime, with some exceptions: the CLI does invoke a command line `ffmpeg` tool, auto-downloaded using its internal package system.
5
+ * It does not depend on essential binary executables. Instead, all of its engines either use pure JavaScript, WebAssembly, WASI, or the ONNX runtime, with some exceptions: the CLI does invoke a command line `ffmpeg` tool, auto-downloaded using its internal package system. Since `v3.0.0` it uses a native NAPI binding to `whisper.cpp` in the `whisper` engine
6
6
  * It does not depend on essential native node.js modules requiring install-time compilation with `node-gyp`. This greatly simplifies the installation experience for end-users (the ONNX runtime bundles precompiled NAPI modules for all supported platforms - it doesn't require any compilation during its installation).
7
7
 
8
8
  ## Package system
@@ -12,6 +12,7 @@ Echogarden uses its own package system to download and install various component
12
12
  Packages are downloaded as `.tar.gz` files, and are extracted to `[data-folder]/packages/[package-id-string]`. Each package has its own subdirectory.
13
13
 
14
14
  `[data-folder]` is located at:
15
+
15
16
  * `%AppData%\Local\echogarden` on Windows
16
17
  * `Users/User/Library/Application Support/echogarden` on macOS
17
18
  * `/home/user/.local/share/echogarden` on Linux
@@ -33,7 +34,6 @@ Currently, the largest contributors to the size are:
33
34
 
34
35
  * `onnxruntime-node` (core inference runtime, NAPI): 180MB
35
36
  * `kuromoji` (Japanese tokenizer, JavaScript) 40MB
36
- * `espeak-ng-emscripten` (core synthesis and phonemization engine, WASM): 23MB
37
37
  * `tiktoken` (tokenizer library, WASM): 22MB
38
38
  * `flite-wasi` (synthesis engine, WASI): 20MB
39
39
  * `jieba-wasm` (Chinese tokenizer, WASM): 14MB
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "echogarden",
3
- "version": "2.10.2",
3
+ "version": "3.0.0",
4
4
  "description": "An easy-to-use speech toolset. Includes tools for synthesis, recognition, alignment, speech translation, language detection, source separation and more.",
5
5
  "author": "Rotem Dan",
6
- "license": "GPL-3.0",
6
+ "license": "MIT AND GPL-3.0",
7
7
  "keywords": [
8
8
  "speech",
9
9
  "text-to-speech",
@@ -52,57 +52,59 @@
52
52
  "echogarden": "./dist/cli/CLILauncher.js"
53
53
  },
54
54
  "dependencies": {
55
- "@aws-sdk/client-polly": "~3.817.0",
56
- "@aws-sdk/client-transcribe-streaming": "~3.817.0",
55
+ "@aws-sdk/client-polly": "~3.1095.0",
56
+ "@aws-sdk/client-transcribe-streaming": "~3.1095.0",
57
57
  "@echogarden/audio-io": "~0.4.2",
58
- "@echogarden/espeak-ng-emscripten": "~0.3.5",
59
58
  "@echogarden/fasttext-wasm": "~0.1.0",
60
59
  "@echogarden/flite-wasi": "~0.1.1",
61
60
  "@echogarden/fvad-wasm": "~0.2.0",
62
- "@echogarden/gnuspeech-wasm": "~0.2.1",
63
- "@echogarden/icu-segmentation-wasm": "~0.2.2",
61
+ "@echogarden/icu-segmentation-wasm": "~0.4.0",
64
62
  "@echogarden/pffft-wasm": "~0.4.2",
65
63
  "@echogarden/rnnoise-wasm": "~0.2.0",
66
- "@echogarden/rubberband-wasm": "~0.2.0",
67
64
  "@echogarden/sonic-wasm": "~0.2.0",
68
65
  "@echogarden/speex-resampler-wasm": "~0.3.0",
69
66
  "@echogarden/svoxpico-wasm": "~0.2.0",
70
- "@echogarden/text-segmentation": "~0.4.1",
67
+ "@echogarden/text-segmentation": "~0.7.0",
71
68
  "@echogarden/transformers-nodejs-lite": "~2.17.1-lite.4",
72
- "@echogarden/wave-codec": "~0.3.3",
69
+ "@echogarden/wave-codec": "~0.4.0",
70
+ "@echogarden/whisper.cpp-binding": "~0.2.1",
73
71
  "@mozilla/readability": "~0.6.0",
74
- "chalk": "~5.4.1",
72
+ "chalk": "~5.6.2",
75
73
  "command-exists": "~1.2.9",
76
- "fs-extra": "~11.3.0",
77
- "gaxios": "~6.7.1",
74
+ "fs-extra": "~11.4.0",
78
75
  "graceful-fs": "~4.2.11",
79
- "html-to-text": "~9.0.5",
80
- "import-meta-resolve": "~4.1.0",
81
- "jieba-wasm": "~2.2.0",
82
- "jsdom": "~26.1.0",
83
- "json5": "~2.2.3",
76
+ "html-to-text": "~10.0.0",
77
+ "import-meta-resolve": "~4.2.0",
78
+ "jieba-wasm": "~2.4.0",
79
+ "jsdom": "~29.1.1",
84
80
  "kuromoji": "~0.1.2",
85
- "microsoft-cognitiveservices-speech-sdk": "~1.44.0",
81
+ "microsoft-cognitiveservices-speech-sdk": "~1.51.0",
86
82
  "msgpack-lite": "~0.1.26",
87
83
  "onnxruntime-node": "~1.21.1",
88
- "openai": "~4.103.0",
84
+ "openai": "~6.49.0",
85
+ "quick-json5": "~0.4.3",
86
+ "easier-http-request": "~0.1.0",
89
87
  "regexp-composer": "~0.3.0",
90
88
  "sam-js": "~0.3.1",
91
- "strip-ansi": "~7.1.0",
92
- "tar": "~7.4.3",
93
- "tiktoken": "~1.0.21",
89
+ "strip-ansi": "~7.2.0",
90
+ "tar": "~7.5.22",
91
+ "tiktoken": "~1.0.22",
94
92
  "tinyld": "~1.3.4",
95
93
  "wasm-feature-detect": "~1.8.0",
96
- "wasm-heap-manager": "~0.2.2",
97
- "ws": "~8.18.2",
98
- "wtf_wikipedia": "~10.4.0"
94
+ "wasm-heap-manager": "~0.4.0",
95
+ "ws": "~8.21.1",
96
+ "wtf_wikipedia": "~10.4.2"
99
97
  },
100
98
  "peerDependencies": {
101
- "@echogarden/vosk": "~0.3.39-patched.1",
99
+ "@echogarden/gnuspeech-wasm": "~0.2.1",
100
+ "@echogarden/rubberband-wasm": "~0.2.0",
102
101
  "winax": "~3.4.2"
103
102
  },
104
103
  "peerDependenciesMeta": {
105
- "@echogarden/vosk": {
104
+ "@echogarden/gnuspeech-wasm": {
105
+ "optional": true
106
+ },
107
+ "@echogarden/rubberband-wasm": {
106
108
  "optional": true
107
109
  },
108
110
  "winax": {
@@ -110,17 +112,25 @@
110
112
  }
111
113
  },
112
114
  "devDependencies": {
115
+ "@echogarden/gnuspeech-wasm": "~0.3.0",
113
116
  "@types/fs-extra": "~11.0.4",
114
117
  "@types/graceful-fs": "~4.1.9",
115
- "@types/jsdom": "~21.1.7",
116
- "@types/msgpack-lite": "~0.1.11",
117
- "@types/node": "~22.15.23",
118
- "@types/tar": "~6.1.13",
118
+ "@types/jsdom": "~28.0.3",
119
+ "@types/msgpack-lite": "~0.1.12",
120
+ "@types/node": "~26.1.1",
119
121
  "@types/ws": "~8.18.1",
120
- "ts-json-schema-generator": "~2.4.0",
121
- "typescript": "~5.8.3"
122
+ "ts-json-schema-generator": "~2.9.0",
123
+ "typescript": "~7.0.2"
122
124
  },
123
125
  "overrides": {
124
- "whatwg-url": "~14.0.0"
126
+ "whatwg-url": "~14.0.0",
127
+ "adm-zip": "~0.6.0",
128
+ "uuid": "~11.1.1",
129
+ "brace-expansion": "~5.0.8",
130
+ "undici": "~7.28.0"
131
+ },
132
+ "allowScripts": {
133
+ "onnxruntime-node": true,
134
+ "wtf_wikipedia": true
125
135
  }
126
136
  }
@@ -5,9 +5,11 @@ import { alignDTWWindowed } from './DTWSequenceAlignmentWindowed.js'
5
5
  import { cosineDistance } from '../math/VectorMath.js'
6
6
  import { includesPunctuation, isWord, parseText } from '../nlp/Segmentation.js'
7
7
  import { Timeline, extractEntries } from '../utilities/Timeline.js'
8
+ import { TimelineTranslationAlignmentCallbacks } from '../api/TimelineTranslationAlignment.js'
9
+ import { OperationCallbacks } from '../api/Common.js'
8
10
 
9
- export async function alignTimelineToTextSemantically(timeline: Timeline, text: string, textLangCode: string) {
10
- const logger = new Logger()
11
+ export async function alignTimelineToTextSemantically(timeline: Timeline, text: string, textLangCode: string, callbacks: TimelineTranslationAlignmentCallbacks) {
12
+ const logger = new Logger(callbacks.logLevel)
11
13
 
12
14
  logger.start(`Prepare text for semantic alignment`)
13
15
 
@@ -40,7 +42,12 @@ export async function alignTimelineToTextSemantically(timeline: Timeline, text:
40
42
 
41
43
  logger.end()
42
44
 
43
- const wordMappingEntries = await alignWordsToWordsSemantically(timelineWordGroups, textWordGroups)
45
+ const wordMappingEntries = await alignWordsToWordsSemantically(
46
+ timelineWordGroups,
47
+ textWordGroups,
48
+ undefined,
49
+ callbacks
50
+ )
44
51
 
45
52
  logger.start(`Build timeline for translation`)
46
53
 
@@ -117,11 +124,11 @@ export async function alignTimelineToTextSemantically(timeline: Timeline, text:
117
124
  return resultTimeline
118
125
  }
119
126
 
120
- export async function alignWordsToWordsSemantically(wordsGroups1: string[][], wordsGroups2: string[][], windowTokenCount = 20000) {
121
- const logger = new Logger()
127
+ export async function alignWordsToWordsSemantically(wordsGroups1: string[][], wordsGroups2: string[][], windowTokenCount = 20000, callbacks: OperationCallbacks) {
128
+ const logger = new Logger(callbacks.logLevel)
122
129
 
123
130
  // Load embedding model
124
- const modelPath = await loadPackage(`xenova-multilingual-e5-small-fp16`)
131
+ const modelPath = await loadPackage(`xenova-multilingual-e5-small-fp16`, callbacks)
125
132
 
126
133
  const embeddingModel = new E5TextEmbedding(modelPath)
127
134
 
@@ -129,7 +136,7 @@ export async function alignWordsToWordsSemantically(wordsGroups1: string[][], wo
129
136
  await embeddingModel.initializeIfNeeded()
130
137
 
131
138
  async function extractEmbeddingsFromWordGroups(wordGroups: string[][]) {
132
- const logger = new Logger()
139
+ const logger = new Logger(callbacks.logLevel, 'trace')
133
140
 
134
141
  const maxTokensPerFragment = 512
135
142
  const { Tensor } = await import('@echogarden/transformers-nodejs-lite')