echogarden 2.0.13 → 2.1.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 (40) hide show
  1. package/README.md +1 -1
  2. package/data/lexicons/heteronyms.en.json +45 -3
  3. package/data/schemas/options.json +64 -0
  4. package/dist/api/Synthesis.d.ts +10 -1
  5. package/dist/api/Synthesis.js +76 -9
  6. package/dist/api/Synthesis.js.map +1 -1
  7. package/dist/recognition/WhisperSTT.js +7 -4
  8. package/dist/recognition/WhisperSTT.js.map +1 -1
  9. package/dist/synthesis/GnuSpeechTTS.d.ts +12 -0
  10. package/dist/synthesis/GnuSpeechTTS.js +36 -0
  11. package/dist/synthesis/GnuSpeechTTS.js.map +1 -0
  12. package/dist/synthesis/KokoroTTS.d.ts +22 -0
  13. package/dist/synthesis/KokoroTTS.js +595 -0
  14. package/dist/synthesis/KokoroTTS.js.map +1 -0
  15. package/dist/synthesis/OpenAICloudTTS.js +15 -0
  16. package/dist/synthesis/OpenAICloudTTS.js.map +1 -1
  17. package/dist/synthesis/VitsTTS.js +6 -1
  18. package/dist/synthesis/VitsTTS.js.map +1 -1
  19. package/dist/utilities/FileReader.js +1 -1
  20. package/dist/utilities/PackageManager.js +4 -0
  21. package/dist/utilities/PackageManager.js.map +1 -1
  22. package/dist/utilities/Utilities.d.ts +1 -0
  23. package/dist/utilities/Utilities.js +8 -0
  24. package/dist/utilities/Utilities.js.map +1 -1
  25. package/dist/utilities/WasmMemoryManager.d.ts +1 -1
  26. package/docs/Development.md +1 -1
  27. package/docs/Engines.md +4 -1
  28. package/docs/Licenses.md +2 -1
  29. package/docs/Options.md +9 -5
  30. package/docs/Tasklist.md +1 -1
  31. package/package.json +14 -13
  32. package/src/api/Synthesis.ts +132 -10
  33. package/src/recognition/WhisperSTT.ts +8 -4
  34. package/src/synthesis/GnuSpeechTTS.ts +40 -0
  35. package/src/synthesis/KokoroTTS.ts +693 -0
  36. package/src/synthesis/OpenAICloudTTS.ts +15 -0
  37. package/src/synthesis/VitsTTS.ts +6 -1
  38. package/src/utilities/FileReader.ts +1 -1
  39. package/src/utilities/PackageManager.ts +5 -0
  40. package/src/utilities/Utilities.ts +10 -0
@@ -156,7 +156,12 @@ export class VitsTTS {
156
156
  const scalesTensor = new Onnx.Tensor('float32', [metadata.inference.noise_scale, lengthScale, metadata.inference.noise_w], [3])
157
157
  const speakerIdTensor = new Onnx.Tensor('int64', new BigInt64Array([BigInt(speakerId)]), [1])
158
158
 
159
- const modelInputs = { input: inputTensor, input_lengths: inputLengthsTensor, scales: scalesTensor, sid: speakerIdTensor }
159
+ const modelInputs = {
160
+ input: inputTensor,
161
+ input_lengths: inputLengthsTensor,
162
+ scales: scalesTensor,
163
+ sid: speakerIdTensor
164
+ }
160
165
 
161
166
  const modelResults = await this.session!.run(modelInputs)
162
167
  const modelOutput = modelResults['output']
@@ -48,7 +48,7 @@ export class FileReader {
48
48
 
49
49
  private async openIfNeeded() {
50
50
  if (this.isDisposed) {
51
- throw new Error(`FileWriter has been disposed`)
51
+ throw new Error(`FileReader has been disposed`)
52
52
  }
53
53
 
54
54
  if (this.isOpened) {
@@ -126,6 +126,11 @@ const packageVersionTagResolutionLookup: { [packageName: string]: string } = {
126
126
  'vits-en_GB-cori-medium': '20241001',
127
127
  'vits-cy_GB-gwryw_gogleddol-medium': '20241001',
128
128
 
129
+ // Kokoro models
130
+ 'kokoro-82m-v1.0-fp32': '20250209',
131
+ 'kokoro-82m-v1.0-quantized': '20250209',
132
+ 'kokoro-82m-v1.0-voices': '20250209',
133
+
129
134
  // Whisper (integrated engine) models
130
135
  'whisper-tiny': '20231126',
131
136
  'whisper-tiny.en': '20231126',
@@ -495,3 +495,13 @@ export async function isWasmSimdSupported() {
495
495
 
496
496
  return wasmFeatureDetect.simd()
497
497
  }
498
+
499
+ export function indexOfLastMatchingNumberInRange(values: number[], targetValue: number, startIndex: number, endIndex: number) {
500
+ for (let i = endIndex - 1; i >= startIndex; i--) {
501
+ if (values[i] === targetValue) {
502
+ return i
503
+ }
504
+ }
505
+
506
+ return -1
507
+ }