echogarden 1.4.3 → 1.5.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.
- package/README.md +1 -1
- package/data/schemas/options.json +267 -19
- package/data/tables/lcid-table.json +9 -0
- package/dist/alignment/DTWMfccSequenceAlignment.d.ts +1 -1
- package/dist/alignment/DTWMfccSequenceAlignment.js +9 -5
- package/dist/alignment/DTWMfccSequenceAlignment.js.map +1 -1
- package/dist/alignment/DTWSequenceAlignmentWindowed.js +4 -4
- package/dist/alignment/DTWSequenceAlignmentWindowed.js.map +1 -1
- package/dist/alignment/{TextAlignment.d.ts → SemanticTextAlignment.d.ts} +10 -1
- package/dist/alignment/SemanticTextAlignment.js +336 -0
- package/dist/alignment/SemanticTextAlignment.js.map +1 -0
- package/dist/alignment/SpeechAlignment.d.ts +2 -1
- package/dist/alignment/SpeechAlignment.js +106 -38
- package/dist/alignment/SpeechAlignment.js.map +1 -1
- package/dist/api/API.d.ts +7 -2
- package/dist/api/API.js +7 -2
- package/dist/api/API.js.map +1 -1
- package/dist/api/APIOptions.d.ts +4 -1
- package/dist/api/Alignment.d.ts +1 -1
- package/dist/api/Alignment.js +14 -6
- package/dist/api/Alignment.js.map +1 -1
- package/dist/api/LanguageDetectionCommon.d.ts +6 -0
- package/dist/api/LanguageDetectionCommon.js +2 -0
- package/dist/api/LanguageDetectionCommon.js.map +1 -0
- package/dist/api/Recognition.js.map +1 -1
- package/dist/api/{LanguageDetection.d.ts → SpeechLanguageDetection.d.ts} +1 -25
- package/dist/api/{LanguageDetection.js → SpeechLanguageDetection.js} +1 -68
- package/dist/api/SpeechLanguageDetection.js.map +1 -0
- package/dist/api/{Translation.js → SpeechTranslation.js} +3 -3
- package/dist/api/SpeechTranslation.js.map +1 -0
- package/dist/api/Synthesis.js +4 -4
- package/dist/api/TextLanguageDetection.d.ts +21 -0
- package/dist/api/TextLanguageDetection.js +67 -0
- package/dist/api/TextLanguageDetection.js.map +1 -0
- package/dist/api/TextTranslation.d.ts +5 -0
- package/dist/api/TextTranslation.js +4 -0
- package/dist/api/TextTranslation.js.map +1 -0
- package/dist/api/TimelineTranslationAlignment.d.ts +23 -0
- package/dist/api/TimelineTranslationAlignment.js +92 -0
- package/dist/api/TimelineTranslationAlignment.js.map +1 -0
- package/dist/api/TranscriptAndTranslationAlignment.d.ts +35 -0
- package/dist/api/TranscriptAndTranslationAlignment.js +78 -0
- package/dist/api/TranscriptAndTranslationAlignment.js.map +1 -0
- package/dist/api/TranslationAlignment.d.ts +4 -3
- package/dist/api/TranslationAlignment.js +9 -8
- package/dist/api/TranslationAlignment.js.map +1 -1
- package/dist/api/VoiceActivityDetection.js +16 -1
- package/dist/api/VoiceActivityDetection.js.map +1 -1
- package/dist/cli/CLI.d.ts +27 -7
- package/dist/cli/CLI.js +205 -34
- package/dist/cli/CLI.js.map +1 -1
- package/dist/codecs/FFMpegTranscoder.js +7 -0
- package/dist/codecs/FFMpegTranscoder.js.map +1 -1
- package/dist/dsp/FFT.d.ts +1 -1
- package/dist/dsp/FFT.js +6 -0
- package/dist/dsp/FFT.js.map +1 -1
- package/dist/dsp/KWeightingFilter.js +1 -1
- package/dist/dsp/KWeightingFilter.js.map +1 -1
- package/dist/dsp/MelSpectogram.d.ts +3 -2
- package/dist/dsp/MelSpectogram.js +14 -8
- package/dist/dsp/MelSpectogram.js.map +1 -1
- package/dist/math/VectorMath.d.ts +22 -20
- package/dist/math/VectorMath.js +57 -30
- package/dist/math/VectorMath.js.map +1 -1
- package/dist/recognition/WhisperCppSTT.d.ts +1 -1
- package/dist/recognition/WhisperCppSTT.js +2 -2
- package/dist/recognition/WhisperCppSTT.js.map +1 -1
- package/dist/recognition/WhisperSTT.js +9 -6
- package/dist/recognition/WhisperSTT.js.map +1 -1
- package/dist/server/Client.d.ts +3 -2
- package/dist/server/Client.js.map +1 -1
- package/dist/server/Worker.d.ts +3 -2
- package/dist/server/Worker.js +3 -2
- package/dist/server/Worker.js.map +1 -1
- package/dist/source-separation/MDXNetSourceSeparation.js +1 -1
- package/dist/source-separation/MDXNetSourceSeparation.js.map +1 -1
- package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.d.ts +13 -0
- package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.js +68 -0
- package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.js.map +1 -0
- package/dist/speech-language-detection/SileroLanguageDetection.d.ts +1 -1
- package/dist/speech-language-detection/SileroLanguageDetection.js +1 -1
- package/dist/speech-language-detection/SileroLanguageDetection.js.map +1 -1
- package/dist/synthesis/EspeakTTS.js +4 -5
- package/dist/synthesis/EspeakTTS.js.map +1 -1
- package/dist/tests/Test.js +0 -8
- package/dist/tests/Test.js.map +1 -1
- package/dist/text-language-detection/FastTextLanguageDetection.d.ts +1 -1
- package/dist/text-language-detection/FastTextLanguageDetection.js.map +1 -1
- package/dist/text-language-detection/TinyLDLanguageDetection.d.ts +1 -1
- package/dist/text-language-detection/TinyLDLanguageDetection.js.map +1 -1
- package/dist/text-translation/NLLBTextTranslation.js +1 -1
- package/dist/text-translation/NLLBTextTranslation.js.map +1 -1
- package/dist/utilities/Locale.d.ts +1 -1
- package/dist/utilities/Locale.js +1 -1
- package/dist/utilities/OnnxUtilities.d.ts +1 -1
- package/dist/utilities/PackageManager.js +8 -2
- package/dist/utilities/PackageManager.js.map +1 -1
- package/dist/utilities/Timeline.d.ts +1 -0
- package/dist/utilities/Timeline.js +12 -0
- package/dist/utilities/Timeline.js.map +1 -1
- package/docs/API.md +81 -3
- package/docs/CLI.md +51 -1
- package/docs/Engines.md +24 -0
- package/docs/Options.md +33 -1
- package/docs/Tasklist.md +4 -1
- package/package.json +11 -11
- package/src/alignment/DTWMfccSequenceAlignment.ts +11 -5
- package/src/alignment/DTWSequenceAlignmentWindowed.ts +4 -4
- package/src/alignment/SemanticTextAlignment.ts +467 -0
- package/src/alignment/SpeechAlignment.ts +180 -53
- package/src/api/API.ts +18 -2
- package/src/api/APIOptions.ts +14 -1
- package/src/api/Alignment.ts +32 -10
- package/src/api/LanguageDetectionCommon.ts +7 -0
- package/src/api/Recognition.ts +2 -0
- package/src/api/{LanguageDetection.ts → SpeechLanguageDetection.ts} +1 -119
- package/src/api/{Translation.ts → SpeechTranslation.ts} +2 -2
- package/src/api/Synthesis.ts +4 -4
- package/src/api/TextLanguageDetection.ts +116 -0
- package/src/api/TextTranslation.ts +9 -0
- package/src/api/TimelineTranslationAlignment.ts +162 -0
- package/src/api/TranscriptAndTranslationAlignment.ts +164 -0
- package/src/api/TranslationAlignment.ts +12 -10
- package/src/api/VoiceActivityDetection.ts +24 -3
- package/src/cli/CLI.ts +276 -34
- package/src/codecs/FFMpegTranscoder.ts +6 -0
- package/src/dsp/FFT.ts +8 -2
- package/src/dsp/KWeightingFilter.ts +1 -1
- package/src/dsp/MelSpectogram.ts +17 -8
- package/src/math/VectorMath.ts +87 -52
- package/src/recognition/WhisperCppSTT.ts +2 -2
- package/src/recognition/WhisperSTT.ts +10 -6
- package/src/server/Client.ts +3 -2
- package/src/server/Worker.ts +3 -2
- package/src/source-separation/MDXNetSourceSeparation.ts +1 -1
- package/src/speech-embeddings/WavToVec2BertFeatureEmbeddings.ts +107 -0
- package/src/speech-language-detection/SileroLanguageDetection.ts +2 -1
- package/src/synthesis/EspeakTTS.ts +6 -8
- package/src/tests/Test.ts +1 -12
- package/src/text-language-detection/FastTextLanguageDetection.ts +1 -1
- package/src/text-language-detection/TinyLDLanguageDetection.ts +1 -1
- package/src/text-translation/NLLBTextTranslation.ts +1 -1
- package/src/utilities/Locale.ts +1 -1
- package/src/utilities/OnnxUtilities.ts +1 -1
- package/src/utilities/PackageManager.ts +9 -2
- package/src/utilities/Timeline.ts +14 -0
- package/dist/alignment/TextAlignment.js +0 -63
- package/dist/alignment/TextAlignment.js.map +0 -1
- package/dist/api/LanguageDetection.js.map +0 -1
- package/dist/api/Translation.js.map +0 -1
- package/src/alignment/TextAlignment.ts +0 -96
- /package/dist/api/{Translation.d.ts → SpeechTranslation.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Echogarden is an easy-to-use speech toolset that includes a variety of speech pr
|
|
|
26
26
|
|
|
27
27
|
## Installation
|
|
28
28
|
|
|
29
|
-
Ensure you have [Node.js](https://nodejs.org/) `v18.
|
|
29
|
+
Ensure you have [Node.js](https://nodejs.org/) `v18.16.0` or later installed.
|
|
30
30
|
|
|
31
31
|
then:
|
|
32
32
|
```bash
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
"APIOptions": {
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"VoiceListRequestOptions": {
|
|
9
|
-
"$ref": "#/definitions/VoiceListRequestOptions"
|
|
10
|
-
},
|
|
11
8
|
"SynthesisOptions": {
|
|
12
9
|
"$ref": "#/definitions/SynthesisOptions"
|
|
13
10
|
},
|
|
11
|
+
"VoiceListRequestOptions": {
|
|
12
|
+
"$ref": "#/definitions/VoiceListRequestOptions"
|
|
13
|
+
},
|
|
14
14
|
"RecognitionOptions": {
|
|
15
15
|
"$ref": "#/definitions/RecognitionOptions"
|
|
16
16
|
},
|
|
@@ -20,9 +20,18 @@
|
|
|
20
20
|
"TranslationAlignmentOptions": {
|
|
21
21
|
"$ref": "#/definitions/TranslationAlignmentOptions"
|
|
22
22
|
},
|
|
23
|
+
"TranscriptAndTranslationAlignmentOptions": {
|
|
24
|
+
"$ref": "#/definitions/TranscriptAndTranslationAlignmentOptions"
|
|
25
|
+
},
|
|
26
|
+
"TimelineTranslationAlignmentOptions": {
|
|
27
|
+
"$ref": "#/definitions/TimelineTranslationAlignmentOptions"
|
|
28
|
+
},
|
|
23
29
|
"SpeechTranslationOptions": {
|
|
24
30
|
"$ref": "#/definitions/SpeechTranslationOptions"
|
|
25
31
|
},
|
|
32
|
+
"TextTranslationOptions": {
|
|
33
|
+
"$ref": "#/definitions/TextTranslationOptions"
|
|
34
|
+
},
|
|
26
35
|
"SpeechLanguageDetectionOptions": {
|
|
27
36
|
"$ref": "#/definitions/SpeechLanguageDetectionOptions"
|
|
28
37
|
},
|
|
@@ -49,12 +58,15 @@
|
|
|
49
58
|
}
|
|
50
59
|
},
|
|
51
60
|
"required": [
|
|
52
|
-
"VoiceListRequestOptions",
|
|
53
61
|
"SynthesisOptions",
|
|
62
|
+
"VoiceListRequestOptions",
|
|
54
63
|
"RecognitionOptions",
|
|
55
64
|
"AlignmentOptions",
|
|
56
65
|
"TranslationAlignmentOptions",
|
|
66
|
+
"TranscriptAndTranslationAlignmentOptions",
|
|
67
|
+
"TimelineTranslationAlignmentOptions",
|
|
57
68
|
"SpeechTranslationOptions",
|
|
69
|
+
"TextTranslationOptions",
|
|
58
70
|
"SpeechLanguageDetectionOptions",
|
|
59
71
|
"TextLanguageDetectionOptions",
|
|
60
72
|
"VADOptions",
|
|
@@ -66,7 +78,7 @@
|
|
|
66
78
|
],
|
|
67
79
|
"additionalProperties": false
|
|
68
80
|
},
|
|
69
|
-
"
|
|
81
|
+
"SynthesisOptions": {
|
|
70
82
|
"type": "object",
|
|
71
83
|
"properties": {
|
|
72
84
|
"engine": {
|
|
@@ -356,18 +368,6 @@
|
|
|
356
368
|
"streamlabsPolly": {
|
|
357
369
|
"type": "object",
|
|
358
370
|
"additionalProperties": false
|
|
359
|
-
},
|
|
360
|
-
"cache": {
|
|
361
|
-
"type": "object",
|
|
362
|
-
"properties": {
|
|
363
|
-
"path": {
|
|
364
|
-
"type": "string"
|
|
365
|
-
},
|
|
366
|
-
"duration": {
|
|
367
|
-
"type": "number"
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
"additionalProperties": false
|
|
371
371
|
}
|
|
372
372
|
},
|
|
373
373
|
"additionalProperties": false
|
|
@@ -513,6 +513,7 @@
|
|
|
513
513
|
"enum": [
|
|
514
514
|
"dtw",
|
|
515
515
|
"dtw-ra",
|
|
516
|
+
"dtw-ea",
|
|
516
517
|
"whisper"
|
|
517
518
|
]
|
|
518
519
|
},
|
|
@@ -614,7 +615,8 @@
|
|
|
614
615
|
"type": "string",
|
|
615
616
|
"enum": [
|
|
616
617
|
"cpu",
|
|
617
|
-
"dml"
|
|
618
|
+
"dml",
|
|
619
|
+
"cuda"
|
|
618
620
|
]
|
|
619
621
|
},
|
|
620
622
|
"WhisperVADOptions": {
|
|
@@ -1306,7 +1308,7 @@
|
|
|
1306
1308
|
},
|
|
1307
1309
|
"additionalProperties": false
|
|
1308
1310
|
},
|
|
1309
|
-
"
|
|
1311
|
+
"VoiceListRequestOptions": {
|
|
1310
1312
|
"type": "object",
|
|
1311
1313
|
"properties": {
|
|
1312
1314
|
"engine": {
|
|
@@ -1596,6 +1598,18 @@
|
|
|
1596
1598
|
"streamlabsPolly": {
|
|
1597
1599
|
"type": "object",
|
|
1598
1600
|
"additionalProperties": false
|
|
1601
|
+
},
|
|
1602
|
+
"cache": {
|
|
1603
|
+
"type": "object",
|
|
1604
|
+
"properties": {
|
|
1605
|
+
"path": {
|
|
1606
|
+
"type": "string"
|
|
1607
|
+
},
|
|
1608
|
+
"duration": {
|
|
1609
|
+
"type": "number"
|
|
1610
|
+
}
|
|
1611
|
+
},
|
|
1612
|
+
"additionalProperties": false
|
|
1599
1613
|
}
|
|
1600
1614
|
},
|
|
1601
1615
|
"additionalProperties": false
|
|
@@ -1643,6 +1657,236 @@
|
|
|
1643
1657
|
"type": "string",
|
|
1644
1658
|
"const": "whisper"
|
|
1645
1659
|
},
|
|
1660
|
+
"TranscriptAndTranslationAlignmentOptions": {
|
|
1661
|
+
"type": "object",
|
|
1662
|
+
"properties": {
|
|
1663
|
+
"engine": {
|
|
1664
|
+
"$ref": "#/definitions/TranscriptAndTranslationAlignmentEngine"
|
|
1665
|
+
},
|
|
1666
|
+
"sourceLanguage": {
|
|
1667
|
+
"type": "string"
|
|
1668
|
+
},
|
|
1669
|
+
"targetLanguage": {
|
|
1670
|
+
"type": "string"
|
|
1671
|
+
},
|
|
1672
|
+
"isolate": {
|
|
1673
|
+
"type": "boolean"
|
|
1674
|
+
},
|
|
1675
|
+
"crop": {
|
|
1676
|
+
"type": "boolean"
|
|
1677
|
+
},
|
|
1678
|
+
"alignment": {
|
|
1679
|
+
"$ref": "#/definitions/AlignmentOptions"
|
|
1680
|
+
},
|
|
1681
|
+
"timelineAlignment": {
|
|
1682
|
+
"$ref": "#/definitions/TimelineTranslationAlignmentOptions"
|
|
1683
|
+
},
|
|
1684
|
+
"languageDetection": {
|
|
1685
|
+
"$ref": "#/definitions/TextLanguageDetectionOptions"
|
|
1686
|
+
},
|
|
1687
|
+
"vad": {
|
|
1688
|
+
"$ref": "#/definitions/VADOptions"
|
|
1689
|
+
},
|
|
1690
|
+
"plainText": {
|
|
1691
|
+
"$ref": "#/definitions/PlainTextOptions"
|
|
1692
|
+
},
|
|
1693
|
+
"subtitles": {
|
|
1694
|
+
"$ref": "#/definitions/SubtitlesConfig"
|
|
1695
|
+
},
|
|
1696
|
+
"sourceSeparation": {
|
|
1697
|
+
"$ref": "#/definitions/SourceSeparationOptions"
|
|
1698
|
+
}
|
|
1699
|
+
},
|
|
1700
|
+
"additionalProperties": false
|
|
1701
|
+
},
|
|
1702
|
+
"TranscriptAndTranslationAlignmentEngine": {
|
|
1703
|
+
"type": "string",
|
|
1704
|
+
"const": "two-stage"
|
|
1705
|
+
},
|
|
1706
|
+
"TimelineTranslationAlignmentOptions": {
|
|
1707
|
+
"type": "object",
|
|
1708
|
+
"properties": {
|
|
1709
|
+
"engine": {
|
|
1710
|
+
"type": "string",
|
|
1711
|
+
"const": "e5"
|
|
1712
|
+
},
|
|
1713
|
+
"sourceLanguage": {
|
|
1714
|
+
"type": "string"
|
|
1715
|
+
},
|
|
1716
|
+
"targetLanguage": {
|
|
1717
|
+
"type": "string"
|
|
1718
|
+
},
|
|
1719
|
+
"audio": {
|
|
1720
|
+
"$ref": "#/definitions/AudioSourceParam"
|
|
1721
|
+
},
|
|
1722
|
+
"languageDetection": {
|
|
1723
|
+
"$ref": "#/definitions/TextLanguageDetectionOptions"
|
|
1724
|
+
},
|
|
1725
|
+
"subtitles": {
|
|
1726
|
+
"$ref": "#/definitions/SubtitlesConfig"
|
|
1727
|
+
},
|
|
1728
|
+
"e5": {
|
|
1729
|
+
"type": "object",
|
|
1730
|
+
"properties": {
|
|
1731
|
+
"model": {
|
|
1732
|
+
"type": "string",
|
|
1733
|
+
"const": "small-fp16"
|
|
1734
|
+
}
|
|
1735
|
+
},
|
|
1736
|
+
"required": [
|
|
1737
|
+
"model"
|
|
1738
|
+
],
|
|
1739
|
+
"additionalProperties": false
|
|
1740
|
+
}
|
|
1741
|
+
},
|
|
1742
|
+
"additionalProperties": false
|
|
1743
|
+
},
|
|
1744
|
+
"AudioSourceParam": {
|
|
1745
|
+
"anyOf": [
|
|
1746
|
+
{
|
|
1747
|
+
"type": "string"
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
"$ref": "#/definitions/global.Buffer"
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
"type": "object",
|
|
1754
|
+
"properties": {
|
|
1755
|
+
"BYTES_PER_ELEMENT": {
|
|
1756
|
+
"type": "number"
|
|
1757
|
+
},
|
|
1758
|
+
"buffer": {
|
|
1759
|
+
"type": "object",
|
|
1760
|
+
"properties": {
|
|
1761
|
+
"byteLength": {
|
|
1762
|
+
"type": "number"
|
|
1763
|
+
}
|
|
1764
|
+
},
|
|
1765
|
+
"required": [
|
|
1766
|
+
"byteLength"
|
|
1767
|
+
],
|
|
1768
|
+
"additionalProperties": false
|
|
1769
|
+
},
|
|
1770
|
+
"byteLength": {
|
|
1771
|
+
"type": "number"
|
|
1772
|
+
},
|
|
1773
|
+
"byteOffset": {
|
|
1774
|
+
"type": "number"
|
|
1775
|
+
},
|
|
1776
|
+
"length": {
|
|
1777
|
+
"type": "number"
|
|
1778
|
+
}
|
|
1779
|
+
},
|
|
1780
|
+
"required": [
|
|
1781
|
+
"BYTES_PER_ELEMENT",
|
|
1782
|
+
"buffer",
|
|
1783
|
+
"byteLength",
|
|
1784
|
+
"byteOffset",
|
|
1785
|
+
"length"
|
|
1786
|
+
],
|
|
1787
|
+
"additionalProperties": {
|
|
1788
|
+
"type": "number"
|
|
1789
|
+
}
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
"$ref": "#/definitions/RawAudio"
|
|
1793
|
+
}
|
|
1794
|
+
]
|
|
1795
|
+
},
|
|
1796
|
+
"global.Buffer": {
|
|
1797
|
+
"type": "object",
|
|
1798
|
+
"additionalProperties": {
|
|
1799
|
+
"type": "number"
|
|
1800
|
+
},
|
|
1801
|
+
"properties": {
|
|
1802
|
+
"BYTES_PER_ELEMENT": {
|
|
1803
|
+
"type": "number"
|
|
1804
|
+
},
|
|
1805
|
+
"buffer": {
|
|
1806
|
+
"type": "object",
|
|
1807
|
+
"properties": {
|
|
1808
|
+
"byteLength": {
|
|
1809
|
+
"type": "number"
|
|
1810
|
+
}
|
|
1811
|
+
},
|
|
1812
|
+
"required": [
|
|
1813
|
+
"byteLength"
|
|
1814
|
+
],
|
|
1815
|
+
"additionalProperties": false
|
|
1816
|
+
},
|
|
1817
|
+
"byteLength": {
|
|
1818
|
+
"type": "number"
|
|
1819
|
+
},
|
|
1820
|
+
"byteOffset": {
|
|
1821
|
+
"type": "number"
|
|
1822
|
+
},
|
|
1823
|
+
"length": {
|
|
1824
|
+
"type": "number"
|
|
1825
|
+
}
|
|
1826
|
+
},
|
|
1827
|
+
"required": [
|
|
1828
|
+
"BYTES_PER_ELEMENT",
|
|
1829
|
+
"buffer",
|
|
1830
|
+
"byteLength",
|
|
1831
|
+
"byteOffset",
|
|
1832
|
+
"length"
|
|
1833
|
+
]
|
|
1834
|
+
},
|
|
1835
|
+
"RawAudio": {
|
|
1836
|
+
"type": "object",
|
|
1837
|
+
"properties": {
|
|
1838
|
+
"audioChannels": {
|
|
1839
|
+
"type": "array",
|
|
1840
|
+
"items": {
|
|
1841
|
+
"type": "object",
|
|
1842
|
+
"properties": {
|
|
1843
|
+
"BYTES_PER_ELEMENT": {
|
|
1844
|
+
"type": "number"
|
|
1845
|
+
},
|
|
1846
|
+
"buffer": {
|
|
1847
|
+
"type": "object",
|
|
1848
|
+
"properties": {
|
|
1849
|
+
"byteLength": {
|
|
1850
|
+
"type": "number"
|
|
1851
|
+
}
|
|
1852
|
+
},
|
|
1853
|
+
"required": [
|
|
1854
|
+
"byteLength"
|
|
1855
|
+
],
|
|
1856
|
+
"additionalProperties": false
|
|
1857
|
+
},
|
|
1858
|
+
"byteLength": {
|
|
1859
|
+
"type": "number"
|
|
1860
|
+
},
|
|
1861
|
+
"byteOffset": {
|
|
1862
|
+
"type": "number"
|
|
1863
|
+
},
|
|
1864
|
+
"length": {
|
|
1865
|
+
"type": "number"
|
|
1866
|
+
}
|
|
1867
|
+
},
|
|
1868
|
+
"required": [
|
|
1869
|
+
"BYTES_PER_ELEMENT",
|
|
1870
|
+
"buffer",
|
|
1871
|
+
"byteLength",
|
|
1872
|
+
"byteOffset",
|
|
1873
|
+
"length"
|
|
1874
|
+
],
|
|
1875
|
+
"additionalProperties": {
|
|
1876
|
+
"type": "number"
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
},
|
|
1880
|
+
"sampleRate": {
|
|
1881
|
+
"type": "number"
|
|
1882
|
+
}
|
|
1883
|
+
},
|
|
1884
|
+
"required": [
|
|
1885
|
+
"audioChannels",
|
|
1886
|
+
"sampleRate"
|
|
1887
|
+
],
|
|
1888
|
+
"additionalProperties": false
|
|
1889
|
+
},
|
|
1646
1890
|
"SpeechTranslationOptions": {
|
|
1647
1891
|
"type": "object",
|
|
1648
1892
|
"properties": {
|
|
@@ -1693,6 +1937,10 @@
|
|
|
1693
1937
|
"openai-cloud"
|
|
1694
1938
|
]
|
|
1695
1939
|
},
|
|
1940
|
+
"TextTranslationOptions": {
|
|
1941
|
+
"type": "object",
|
|
1942
|
+
"additionalProperties": false
|
|
1943
|
+
},
|
|
1696
1944
|
"DenoisingOptions": {
|
|
1697
1945
|
"type": "object",
|
|
1698
1946
|
"properties": {
|
|
@@ -7423,5 +7423,14 @@
|
|
|
7423
7423
|
"ThreeLetterWindowsLanguageName": "ZHG",
|
|
7424
7424
|
"EnglishName": "Standard Moroccan Tamazight (Tifinagh, Morocco)",
|
|
7425
7425
|
"ANSICodePage": 0
|
|
7426
|
+
},
|
|
7427
|
+
{
|
|
7428
|
+
"LCID": 4096,
|
|
7429
|
+
"Name": "la",
|
|
7430
|
+
"TwoLetterISOLanguageName": "la",
|
|
7431
|
+
"ThreeLetterISOLanguageName": "lat",
|
|
7432
|
+
"ThreeLetterWindowsLanguageName": "",
|
|
7433
|
+
"EnglishName": "Latin",
|
|
7434
|
+
"ANSICodePage": 0
|
|
7426
7435
|
}
|
|
7427
7436
|
]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function alignMFCC_DTW(mfccFrames1: number[][], mfccFrames2: number[][], windowLength: number,
|
|
1
|
+
export declare function alignMFCC_DTW(mfccFrames1: number[][], mfccFrames2: number[][], windowLength: number, distanceFunctionKind?: 'euclidian' | 'cosine', centerIndexes?: number[]): Promise<import("./SpeechAlignment.js").AlignmentPath>;
|
|
2
2
|
export declare function getCostMatrixMemorySizeMB(sequence1Length: number, sequence2Length: number, windowLength: number): number;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { cosineDistancePrecomputedMagnitudes, createVectorForIntegerRange, euclidianDistance, magnitude } from '../math/VectorMath.js';
|
|
1
|
+
import { cosineDistancePrecomputedMagnitudes, createVectorForIntegerRange, euclidianDistance, euclidianDistance13Dim, magnitude } from '../math/VectorMath.js';
|
|
2
2
|
import { logToStderr } from '../utilities/Utilities.js';
|
|
3
3
|
import { alignDTWWindowed } from './DTWSequenceAlignmentWindowed.js';
|
|
4
4
|
const log = logToStderr;
|
|
5
|
-
export async function alignMFCC_DTW(mfccFrames1, mfccFrames2, windowLength,
|
|
6
|
-
if (
|
|
7
|
-
|
|
5
|
+
export async function alignMFCC_DTW(mfccFrames1, mfccFrames2, windowLength, distanceFunctionKind = 'euclidian', centerIndexes) {
|
|
6
|
+
if (distanceFunctionKind == 'euclidian') {
|
|
7
|
+
let distanceFunction = euclidianDistance;
|
|
8
|
+
if (mfccFrames1.length > 0 && mfccFrames1[0].length === 13) {
|
|
9
|
+
distanceFunction = euclidianDistance13Dim;
|
|
10
|
+
}
|
|
11
|
+
const { path } = alignDTWWindowed(mfccFrames1, mfccFrames2, distanceFunction, windowLength, centerIndexes);
|
|
8
12
|
return path;
|
|
9
13
|
}
|
|
10
|
-
else if (
|
|
14
|
+
else if (distanceFunctionKind == 'cosine') {
|
|
11
15
|
const indexes1 = createVectorForIntegerRange(0, mfccFrames1.length);
|
|
12
16
|
const indexes2 = createVectorForIntegerRange(0, mfccFrames2.length);
|
|
13
17
|
const magnitudes1 = mfccFrames1.map(magnitude);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DTWMfccSequenceAlignment.js","sourceRoot":"","sources":["../../src/alignment/DTWMfccSequenceAlignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"DTWMfccSequenceAlignment.js","sourceRoot":"","sources":["../../src/alignment/DTWMfccSequenceAlignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC9J,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAEpE,MAAM,GAAG,GAAG,WAAW,CAAA;AAEvB,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,WAAuB,EAAE,WAAuB,EAAE,YAAoB,EAAE,uBAA+C,WAAW,EAAE,aAAwB;IAC/L,IAAI,oBAAoB,IAAI,WAAW,EAA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,CAAC,eAAe,EAAE,YAAY,CAAC,GAAG,CAAC,GAAG,OAAO,CAAA;IAEtG,OAAO,sBAAsB,CAAA;AAC9B,CAAC"}
|
|
@@ -67,7 +67,7 @@ function computeAccumulatedCostMatrixTransposed(sequence1, sequence2, costFuncti
|
|
|
67
67
|
// Compute the delta between the current window start offset
|
|
68
68
|
// and left column's window offset
|
|
69
69
|
const windowOffsetDelta = windowStartOffset - windowStartOffsets[columnIndex - 1];
|
|
70
|
-
//
|
|
70
|
+
// Compute the accumulated cost for all rows in the window
|
|
71
71
|
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
72
72
|
// Compute the cost for current cell
|
|
73
73
|
const cost = costFunction(targetSequence1Value, sequence2[windowStartOffset + rowIndex]);
|
|
@@ -125,21 +125,21 @@ function computeBestPathTransposed(accumulatedCostMatrixTransposed, windowStartO
|
|
|
125
125
|
const upRowIndex = rowIndex - 1;
|
|
126
126
|
let upCost = Infinity;
|
|
127
127
|
if (upRowIndex >= 0) {
|
|
128
|
-
upCost = accumulatedCostMatrixTransposed[columnIndex][upRowIndex];
|
|
128
|
+
upCost = accumulatedCostMatrixTransposed[columnIndex][upRowIndex];
|
|
129
129
|
}
|
|
130
130
|
// Retrieve the cost for the 'left' (deletion) neighbor
|
|
131
131
|
const leftRowIndex = rowIndex + windowStartDelta;
|
|
132
132
|
const leftColumnIndex = columnIndex - 1;
|
|
133
133
|
let leftCost = Infinity;
|
|
134
134
|
if (leftColumnIndex >= 0 && leftRowIndex < rowCount) {
|
|
135
|
-
leftCost = accumulatedCostMatrixTransposed[leftColumnIndex][leftRowIndex];
|
|
135
|
+
leftCost = accumulatedCostMatrixTransposed[leftColumnIndex][leftRowIndex];
|
|
136
136
|
}
|
|
137
137
|
// Retrieve the cost for the 'up and left' (match) neighbor
|
|
138
138
|
const upAndLeftRowIndex = rowIndex - 1 + windowStartDelta;
|
|
139
139
|
const upAndLeftColumnIndex = columnIndex - 1;
|
|
140
140
|
let upAndLeftCost = Infinity;
|
|
141
141
|
if (upAndLeftColumnIndex >= 0 && upAndLeftRowIndex >= 0 && upAndLeftRowIndex < rowCount) {
|
|
142
|
-
upAndLeftCost = accumulatedCostMatrixTransposed[upAndLeftColumnIndex][upAndLeftRowIndex];
|
|
142
|
+
upAndLeftCost = accumulatedCostMatrixTransposed[upAndLeftColumnIndex][upAndLeftRowIndex];
|
|
143
143
|
}
|
|
144
144
|
// If all neighbors have a cost of infinity, it means
|
|
145
145
|
// there is a "jump" between the window for the current and previous column
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DTWSequenceAlignmentWindowed.js","sourceRoot":"","sources":["../../src/alignment/DTWSequenceAlignmentWindowed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAGvD,MAAM,GAAG,GAAG,WAAW,CAAA;AAEvB,MAAM,UAAU,gBAAgB,CAAO,SAAc,EAAE,SAAc,EAAE,YAAoC,EAAE,eAAuB,EAAE,aAAwB;IAC7J,IAAI,eAAe,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;IAC/D,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACpD,OAAO;YACN,IAAI,EAAE,EAAmB;YACzB,QAAQ,EAAE,CAAC;SACX,CAAA;IACF,CAAC;IAED,+CAA+C;IAC/C,MAAM,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,GAAG,sCAAsC,CAAC,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,CAAC,CAAA;IAE1K,yCAAyC;IACzC,MAAM,IAAI,GAAG,yBAAyB,CAAC,+BAA+B,EAAE,kBAAkB,CAAC,CAAA;IAE3F,2DAA2D;IAC3D,MAAM,WAAW,GAAG,+BAA+B,CAAC,MAAM,CAAA;IAC1D,MAAM,QAAQ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AAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC;QAC1B,OAAO,CAAC,CAAA;IACT,CAAC;SAAM,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC;QACrB,OAAO,CAAC,CAAA;IACT,CAAC;SAAM,CAAC;QACP,OAAO,CAAC,CAAA;IACT,CAAC;AACF,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type PreTrainedModel, type PreTrainedTokenizer } from '@echogarden/transformers-nodejs-lite';
|
|
2
|
-
|
|
2
|
+
import { Timeline } from '../utilities/Timeline.js';
|
|
3
|
+
export declare function alignTimelineToTextSemantically(timeline: Timeline, text: string, textLangCode: string): Promise<Timeline>;
|
|
4
|
+
export declare function alignWordsToWordsSemantically(wordsGroups1: string[][], wordsGroups2: string[][], windowTokenCount?: number): Promise<WordMapping[]>;
|
|
3
5
|
export declare class E5TextEmbedding {
|
|
4
6
|
readonly modelPath: string;
|
|
5
7
|
tokenizer?: PreTrainedTokenizer;
|
|
@@ -14,3 +16,10 @@ export interface TokenEmbeddingData {
|
|
|
14
16
|
text: string;
|
|
15
17
|
embeddingVector: Float32Array;
|
|
16
18
|
}
|
|
19
|
+
export interface WordMapping {
|
|
20
|
+
wordIndex1: number;
|
|
21
|
+
word1: string;
|
|
22
|
+
wordIndex2: number;
|
|
23
|
+
word2: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const e5SupportedLanguages: string[];
|