echogarden 2.10.1 → 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.
- package/LICENSE.MIT.md +7 -0
- package/README.md +9 -1
- package/data/lexicons/heteronyms.en.json +44 -10
- package/data/lexicons/words.en.json +726 -22
- package/data/schemas/options.json +91 -153
- package/dist/alignment/DTWMfccSequenceAlignment.d.ts +1 -0
- package/dist/alignment/DTWMfccSequenceAlignment.d.ts.map +1 -0
- package/dist/alignment/DTWMfccSequenceAlignment.js.map +1 -1
- package/dist/alignment/DTWSequenceAlignment.d.ts +1 -0
- package/dist/alignment/DTWSequenceAlignment.d.ts.map +1 -0
- package/dist/alignment/DTWSequenceAlignmentWindowed.d.ts +1 -0
- package/dist/alignment/DTWSequenceAlignmentWindowed.d.ts.map +1 -0
- package/dist/alignment/LevenshteinSequenceAlignment.d.ts +1 -0
- package/dist/alignment/LevenshteinSequenceAlignment.d.ts.map +1 -0
- package/dist/alignment/SemanticTextAlignment.d.ts +5 -2
- package/dist/alignment/SemanticTextAlignment.d.ts.map +1 -0
- package/dist/alignment/SemanticTextAlignment.js +7 -7
- package/dist/alignment/SemanticTextAlignment.js.map +1 -1
- package/dist/alignment/SpeechAlignment.d.ts +10 -10
- package/dist/alignment/SpeechAlignment.d.ts.map +1 -0
- package/dist/alignment/SpeechAlignment.js +23 -96
- package/dist/alignment/SpeechAlignment.js.map +1 -1
- package/dist/api/API.d.ts +1 -0
- package/dist/api/API.d.ts.map +1 -0
- package/dist/api/APIOptions.d.ts +2 -1
- package/dist/api/APIOptions.d.ts.map +1 -0
- package/dist/api/Alignment.d.ts +9 -6
- package/dist/api/Alignment.d.ts.map +1 -0
- package/dist/api/Alignment.js +31 -40
- package/dist/api/Alignment.js.map +1 -1
- package/dist/api/Common.d.ts +8 -0
- package/dist/api/Common.d.ts.map +1 -0
- package/dist/api/Common.js.map +1 -1
- package/dist/api/Denoising.d.ts +6 -2
- package/dist/api/Denoising.d.ts.map +1 -0
- package/dist/api/Denoising.js +15 -15
- package/dist/api/Denoising.js.map +1 -1
- package/dist/api/GlobalOptions.d.ts +3 -8
- package/dist/api/GlobalOptions.d.ts.map +1 -0
- package/dist/api/GlobalOptions.js +2 -13
- package/dist/api/GlobalOptions.js.map +1 -1
- package/dist/api/LanguageDetectionCommon.d.ts +1 -0
- package/dist/api/LanguageDetectionCommon.d.ts.map +1 -0
- package/dist/api/Recognition.d.ts +12 -12
- package/dist/api/Recognition.d.ts.map +1 -0
- package/dist/api/Recognition.js +32 -82
- package/dist/api/Recognition.js.map +1 -1
- package/dist/api/SourceSeparation.d.ts +8 -2
- package/dist/api/SourceSeparation.d.ts.map +1 -0
- package/dist/api/SourceSeparation.js +12 -10
- package/dist/api/SourceSeparation.js.map +1 -1
- package/dist/api/SpeechLanguageDetection.d.ts +12 -7
- package/dist/api/SpeechLanguageDetection.d.ts.map +1 -0
- package/dist/api/SpeechLanguageDetection.js +37 -30
- package/dist/api/SpeechLanguageDetection.js.map +1 -1
- package/dist/api/SpeechSearch.d.ts +5 -1
- package/dist/api/SpeechSearch.d.ts.map +1 -0
- package/dist/api/SpeechSearch.js.map +1 -1
- package/dist/api/SpeechTranslation.d.ts +11 -6
- package/dist/api/SpeechTranslation.d.ts.map +1 -0
- package/dist/api/SpeechTranslation.js +28 -26
- package/dist/api/SpeechTranslation.js.map +1 -1
- package/dist/api/Synthesis.d.ts +14 -8
- package/dist/api/Synthesis.d.ts.map +1 -0
- package/dist/api/Synthesis.js +67 -89
- package/dist/api/Synthesis.js.map +1 -1
- package/dist/api/TextLanguageDetection.d.ts +5 -2
- package/dist/api/TextLanguageDetection.d.ts.map +1 -0
- package/dist/api/TextLanguageDetection.js +4 -7
- package/dist/api/TextLanguageDetection.js.map +1 -1
- package/dist/api/TextTranslation.d.ts +5 -2
- package/dist/api/TextTranslation.d.ts.map +1 -0
- package/dist/api/TextTranslation.js +13 -24
- package/dist/api/TextTranslation.js.map +1 -1
- package/dist/api/TimelineTranslationAlignment.d.ts +7 -3
- package/dist/api/TimelineTranslationAlignment.d.ts.map +1 -0
- package/dist/api/TimelineTranslationAlignment.js +20 -11
- package/dist/api/TimelineTranslationAlignment.js.map +1 -1
- package/dist/api/TranscriptAndTranslationAlignment.d.ts +7 -4
- package/dist/api/TranscriptAndTranslationAlignment.d.ts.map +1 -0
- package/dist/api/TranscriptAndTranslationAlignment.js +11 -12
- package/dist/api/TranscriptAndTranslationAlignment.js.map +1 -1
- package/dist/api/TranslationAlignment.d.ts +7 -4
- package/dist/api/TranslationAlignment.d.ts.map +1 -0
- package/dist/api/TranslationAlignment.js +20 -21
- package/dist/api/TranslationAlignment.js.map +1 -1
- package/dist/api/VoiceActivityDetection.d.ts +10 -8
- package/dist/api/VoiceActivityDetection.d.ts.map +1 -0
- package/dist/api/VoiceActivityDetection.js +20 -43
- package/dist/api/VoiceActivityDetection.js.map +1 -1
- package/dist/audio/AudioBufferConversion.d.ts +1 -0
- package/dist/audio/AudioBufferConversion.d.ts.map +1 -0
- package/dist/audio/AudioBufferConversion.js.map +1 -1
- package/dist/audio/AudioPlayer.d.ts +2 -3
- package/dist/audio/AudioPlayer.d.ts.map +1 -0
- package/dist/audio/AudioPlayer.js +3 -188
- package/dist/audio/AudioPlayer.js.map +1 -1
- package/dist/audio/AudioUtilities.d.ts +3 -1
- package/dist/audio/AudioUtilities.d.ts.map +1 -0
- package/dist/audio/AudioUtilities.js +2 -2
- package/dist/audio/AudioUtilities.js.map +1 -1
- package/dist/build-tools/MakeTarballsForInstalledPackages.d.ts +1 -0
- package/dist/build-tools/MakeTarballsForInstalledPackages.d.ts.map +1 -0
- package/dist/build-tools/MakeTarballsForInstalledPackages.js +3 -3
- package/dist/build-tools/MakeTarballsForInstalledPackages.js.map +1 -1
- package/dist/cli/CLI.d.ts +1 -0
- package/dist/cli/CLI.d.ts.map +1 -0
- package/dist/cli/CLI.js +139 -92
- package/dist/cli/CLI.js.map +1 -1
- package/dist/cli/CLIConfigFile.d.ts +1 -0
- package/dist/cli/CLIConfigFile.d.ts.map +1 -0
- package/dist/cli/CLILauncher.d.ts +1 -0
- package/dist/cli/CLILauncher.d.ts.map +1 -0
- package/dist/cli/CLIOptions.d.ts +1 -0
- package/dist/cli/CLIOptions.d.ts.map +1 -0
- package/dist/cli/CLIOptionsSchema.d.ts +1 -0
- package/dist/cli/CLIOptionsSchema.d.ts.map +1 -0
- package/dist/cli/CLIParser.d.ts +1 -0
- package/dist/cli/CLIParser.d.ts.map +1 -0
- package/dist/cli/CLIStarter.d.ts +1 -0
- package/dist/cli/CLIStarter.d.ts.map +1 -0
- package/dist/codecs/FFMpegTranscoder.d.ts +5 -3
- package/dist/codecs/FFMpegTranscoder.d.ts.map +1 -0
- package/dist/codecs/FFMpegTranscoder.js +16 -14
- package/dist/codecs/FFMpegTranscoder.js.map +1 -1
- package/dist/codecs/TIMITCodec.d.ts +1 -0
- package/dist/codecs/TIMITCodec.d.ts.map +1 -0
- package/dist/data-structures/DynamicTypedArray.d.ts +1 -0
- package/dist/data-structures/DynamicTypedArray.d.ts.map +1 -0
- package/dist/data-structures/DynamicTypedArray.js.map +1 -1
- package/dist/data-structures/Queue.d.ts +1 -0
- package/dist/data-structures/Queue.d.ts.map +1 -0
- package/dist/data-structures/WindowedList.d.ts +1 -0
- package/dist/data-structures/WindowedList.d.ts.map +1 -0
- package/dist/data-structures/WindowedList.js.map +1 -1
- package/dist/denoising/NSNet2.d.ts +4 -2
- package/dist/denoising/NSNet2.d.ts.map +1 -0
- package/dist/denoising/NSNet2.js +4 -4
- package/dist/denoising/NSNet2.js.map +1 -1
- package/dist/denoising/RNNoise.d.ts +3 -1
- package/dist/denoising/RNNoise.d.ts.map +1 -0
- package/dist/denoising/RNNoise.js +10 -6
- package/dist/denoising/RNNoise.js.map +1 -1
- package/dist/dsp/BiquadFilter.d.ts +1 -0
- package/dist/dsp/BiquadFilter.d.ts.map +1 -0
- package/dist/dsp/DecayingPeakEstimator.d.ts +1 -0
- package/dist/dsp/DecayingPeakEstimator.d.ts.map +1 -0
- package/dist/dsp/DecayingPeakEstimator.js.map +1 -1
- package/dist/dsp/FFT.d.ts +1 -0
- package/dist/dsp/FFT.d.ts.map +1 -0
- package/dist/dsp/FFT.js +2 -1
- package/dist/dsp/FFT.js.map +1 -1
- package/dist/dsp/KWeightingFilter.d.ts +1 -0
- package/dist/dsp/KWeightingFilter.d.ts.map +1 -0
- package/dist/dsp/KWeightingFilter.js.map +1 -1
- package/dist/dsp/LoudnessEstimator.d.ts +1 -0
- package/dist/dsp/LoudnessEstimator.d.ts.map +1 -0
- package/dist/dsp/LoudnessEstimator.js.map +1 -1
- package/dist/dsp/MFCC.d.ts +4 -2
- package/dist/dsp/MFCC.d.ts.map +1 -0
- package/dist/dsp/MFCC.js +4 -4
- package/dist/dsp/MFCC.js.map +1 -1
- package/dist/dsp/MelSpectrogram.d.ts +11 -8
- package/dist/dsp/MelSpectrogram.d.ts.map +1 -0
- package/dist/dsp/MelSpectrogram.js +31 -34
- package/dist/dsp/MelSpectrogram.js.map +1 -1
- package/dist/dsp/Rubberband.d.ts +1 -0
- package/dist/dsp/Rubberband.d.ts.map +1 -0
- package/dist/dsp/Rubberband.js +8 -3
- package/dist/dsp/Rubberband.js.map +1 -1
- package/dist/dsp/Sonic.d.ts +1 -0
- package/dist/dsp/Sonic.d.ts.map +1 -0
- package/dist/dsp/Sonic.js +1 -1
- package/dist/dsp/Sonic.js.map +1 -1
- package/dist/dsp/SpeexResampler.d.ts +1 -0
- package/dist/dsp/SpeexResampler.d.ts.map +1 -0
- package/dist/dsp/SpeexResampler.js +1 -1
- package/dist/dsp/SpeexResampler.js.map +1 -1
- package/dist/encodings/Ascii.d.ts +2 -1
- package/dist/encodings/Ascii.d.ts.map +1 -0
- package/dist/encodings/Base64.d.ts +1 -0
- package/dist/encodings/Base64.d.ts.map +1 -0
- package/dist/encodings/Base64.js.map +1 -1
- package/dist/encodings/Hex.d.ts +1 -0
- package/dist/encodings/Hex.d.ts.map +1 -0
- package/dist/encodings/HtmlEscape.d.ts +1 -0
- package/dist/encodings/HtmlEscape.d.ts.map +1 -0
- package/dist/encodings/LEB128.d.ts +1 -0
- package/dist/encodings/LEB128.d.ts.map +1 -0
- package/dist/encodings/TextEncodingsCommon.d.ts +1 -0
- package/dist/encodings/TextEncodingsCommon.d.ts.map +1 -0
- package/dist/encodings/Utf16.d.ts +1 -0
- package/dist/encodings/Utf16.d.ts.map +1 -0
- package/dist/encodings/Utf32.d.ts +1 -0
- package/dist/encodings/Utf32.d.ts.map +1 -0
- package/dist/encodings/Utf8.d.ts +1 -0
- package/dist/encodings/Utf8.d.ts.map +1 -0
- package/dist/math/MedianFilter.d.ts +1 -0
- package/dist/math/MedianFilter.d.ts.map +1 -0
- package/dist/math/VectorMath.d.ts +2 -0
- package/dist/math/VectorMath.d.ts.map +1 -0
- package/dist/math/VectorMath.js +9 -5
- package/dist/math/VectorMath.js.map +1 -1
- package/dist/nlp/ChineseSegmentation.d.ts +2 -1
- package/dist/nlp/ChineseSegmentation.d.ts.map +1 -0
- package/dist/nlp/EspeakPhonemizer.d.ts +2 -1
- package/dist/nlp/EspeakPhonemizer.d.ts.map +1 -0
- package/dist/nlp/EspeakPhonemizer.js +2 -2
- package/dist/nlp/EspeakPhonemizer.js.map +1 -1
- package/dist/nlp/IPA.d.ts +3 -2
- package/dist/nlp/IPA.d.ts.map +1 -0
- package/dist/nlp/JapaneseSegmentation.d.ts +1 -0
- package/dist/nlp/JapaneseSegmentation.d.ts.map +1 -0
- package/dist/nlp/Lexicon.d.ts +1 -0
- package/dist/nlp/Lexicon.d.ts.map +1 -0
- package/dist/nlp/PhoneConversion.d.ts +1 -0
- package/dist/nlp/PhoneConversion.d.ts.map +1 -0
- package/dist/nlp/Segmentation.d.ts +2 -1
- package/dist/nlp/Segmentation.d.ts.map +1 -0
- package/dist/nlp/Segmentation.js +8 -4
- package/dist/nlp/Segmentation.js.map +1 -1
- package/dist/nlp/TextNormalizer.d.ts +1 -0
- package/dist/nlp/TextNormalizer.d.ts.map +1 -0
- package/dist/recognition/AmazonTranscribeSTT.d.ts +3 -1
- package/dist/recognition/AmazonTranscribeSTT.d.ts.map +1 -0
- package/dist/recognition/AmazonTranscribeSTT.js +3 -3
- package/dist/recognition/AmazonTranscribeSTT.js.map +1 -1
- package/dist/recognition/AzureCognitiveServicesSTT.d.ts +3 -1
- package/dist/recognition/AzureCognitiveServicesSTT.d.ts.map +1 -0
- package/dist/recognition/AzureCognitiveServicesSTT.js +4 -4
- package/dist/recognition/AzureCognitiveServicesSTT.js.map +1 -1
- package/dist/recognition/DeepgramSTT.d.ts +3 -1
- package/dist/recognition/DeepgramSTT.d.ts.map +1 -0
- package/dist/recognition/DeepgramSTT.js +12 -13
- package/dist/recognition/DeepgramSTT.js.map +1 -1
- package/dist/recognition/GoogleCloudSTT.d.ts +3 -1
- package/dist/recognition/GoogleCloudSTT.d.ts.map +1 -0
- package/dist/recognition/GoogleCloudSTT.js +11 -10
- package/dist/recognition/GoogleCloudSTT.js.map +1 -1
- package/dist/recognition/OpenAICloudSTT.d.ts +3 -1
- package/dist/recognition/OpenAICloudSTT.d.ts.map +1 -0
- package/dist/recognition/OpenAICloudSTT.js +6 -6
- package/dist/recognition/OpenAICloudSTT.js.map +1 -1
- package/dist/recognition/WhisperCommon.d.ts +9 -0
- package/dist/recognition/WhisperCommon.d.ts.map +1 -0
- package/dist/recognition/WhisperCommon.js +52 -0
- package/dist/recognition/WhisperCommon.js.map +1 -0
- package/dist/recognition/{WhisperCppSTT.d.ts → WhisperCppCliSTT.d.ts} +14 -15
- package/dist/recognition/WhisperCppCliSTT.d.ts.map +1 -0
- package/dist/recognition/{WhisperCppSTT.js → WhisperCppCliSTT.js} +55 -84
- package/dist/recognition/WhisperCppCliSTT.js.map +1 -0
- package/dist/recognition/WhisperSTT.d.ts +73 -85
- package/dist/recognition/WhisperSTT.d.ts.map +1 -0
- package/dist/recognition/WhisperSTT.js +384 -519
- package/dist/recognition/WhisperSTT.js.map +1 -1
- package/dist/server/Client.d.ts +3 -2
- package/dist/server/Client.d.ts.map +1 -0
- package/dist/server/Client.js.map +1 -1
- package/dist/server/Server.d.ts +1 -0
- package/dist/server/Server.d.ts.map +1 -0
- package/dist/server/ServerStarter.d.ts +1 -0
- package/dist/server/ServerStarter.d.ts.map +1 -0
- package/dist/server/Worker.d.ts +7 -7
- package/dist/server/Worker.d.ts.map +1 -0
- package/dist/server/Worker.js +42 -44
- package/dist/server/Worker.js.map +1 -1
- package/dist/server/WorkerStarter.d.ts +1 -0
- package/dist/server/WorkerStarter.d.ts.map +1 -0
- package/dist/source-separation/MDXNetSourceSeparation.d.ts +4 -2
- package/dist/source-separation/MDXNetSourceSeparation.d.ts.map +1 -0
- package/dist/source-separation/MDXNetSourceSeparation.js +10 -8
- package/dist/source-separation/MDXNetSourceSeparation.js.map +1 -1
- package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.d.ts +4 -2
- package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.d.ts.map +1 -0
- package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.js +5 -5
- package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.js.map +1 -1
- package/dist/speech-language-detection/SileroLanguageDetection.d.ts +6 -3
- package/dist/speech-language-detection/SileroLanguageDetection.d.ts.map +1 -0
- package/dist/speech-language-detection/SileroLanguageDetection.js +8 -8
- package/dist/speech-language-detection/SileroLanguageDetection.js.map +1 -1
- package/dist/speech-search/DTWSpeechSearch.d.ts +3 -1
- package/dist/speech-search/DTWSpeechSearch.d.ts.map +1 -0
- package/dist/speech-search/DTWSpeechSearch.js +4 -4
- package/dist/speech-search/DTWSpeechSearch.js.map +1 -1
- package/dist/subtitles/Subtitles.d.ts +14 -1
- package/dist/subtitles/Subtitles.d.ts.map +1 -0
- package/dist/subtitles/Subtitles.js +22 -22
- package/dist/subtitles/Subtitles.js.map +1 -1
- package/dist/synthesis/AwsPollyTTS.d.ts +4 -2
- package/dist/synthesis/AwsPollyTTS.d.ts.map +1 -0
- package/dist/synthesis/AwsPollyTTS.js +5 -5
- package/dist/synthesis/AwsPollyTTS.js.map +1 -1
- package/dist/synthesis/AzureCognitiveServicesTTS.d.ts +3 -1
- package/dist/synthesis/AzureCognitiveServicesTTS.d.ts.map +1 -0
- package/dist/synthesis/AzureCognitiveServicesTTS.js +3 -3
- package/dist/synthesis/AzureCognitiveServicesTTS.js.map +1 -1
- package/dist/synthesis/CoquiServerTTS.d.ts +3 -1
- package/dist/synthesis/CoquiServerTTS.d.ts.map +1 -0
- package/dist/synthesis/CoquiServerTTS.js +7 -8
- package/dist/synthesis/CoquiServerTTS.js.map +1 -1
- package/dist/synthesis/DeepgramTTS.d.ts +3 -2
- package/dist/synthesis/DeepgramTTS.d.ts.map +1 -0
- package/dist/synthesis/DeepgramTTS.js +13 -13
- package/dist/synthesis/DeepgramTTS.js.map +1 -1
- package/dist/synthesis/ElevenLabsTTS.d.ts +4 -3
- package/dist/synthesis/ElevenLabsTTS.d.ts.map +1 -0
- package/dist/synthesis/ElevenLabsTTS.js +22 -21
- package/dist/synthesis/ElevenLabsTTS.js.map +1 -1
- package/dist/synthesis/EspeakTTS.d.ts +12 -9
- package/dist/synthesis/EspeakTTS.d.ts.map +1 -0
- package/dist/synthesis/EspeakTTS.js +118 -68
- package/dist/synthesis/EspeakTTS.js.map +1 -1
- package/dist/synthesis/FliteTTS.d.ts +3 -2
- package/dist/synthesis/FliteTTS.d.ts.map +1 -0
- package/dist/synthesis/FliteTTS.js +2 -2
- package/dist/synthesis/FliteTTS.js.map +1 -1
- package/dist/synthesis/GnuSpeechTTS.d.ts +3 -2
- package/dist/synthesis/GnuSpeechTTS.d.ts.map +1 -0
- package/dist/synthesis/GnuSpeechTTS.js +1 -1
- package/dist/synthesis/GnuSpeechTTS.js.map +1 -1
- package/dist/synthesis/GoogleCloudTTS.d.ts +4 -2
- package/dist/synthesis/GoogleCloudTTS.d.ts.map +1 -0
- package/dist/synthesis/GoogleCloudTTS.js +15 -14
- package/dist/synthesis/GoogleCloudTTS.js.map +1 -1
- package/dist/synthesis/GoogleTranslateTTS.d.ts +4 -2
- package/dist/synthesis/GoogleTranslateTTS.d.ts.map +1 -0
- package/dist/synthesis/GoogleTranslateTTS.js +11 -11
- package/dist/synthesis/GoogleTranslateTTS.js.map +1 -1
- package/dist/synthesis/KokoroTTS.d.ts +5 -4
- package/dist/synthesis/KokoroTTS.d.ts.map +1 -0
- package/dist/synthesis/KokoroTTS.js +11 -10
- package/dist/synthesis/KokoroTTS.js.map +1 -1
- package/dist/synthesis/MicrosoftEdgeTTS.d.ts +5 -3
- package/dist/synthesis/MicrosoftEdgeTTS.d.ts.map +1 -0
- package/dist/synthesis/MicrosoftEdgeTTS.js +41 -20
- package/dist/synthesis/MicrosoftEdgeTTS.js.map +1 -1
- package/dist/synthesis/OpenAICloudTTS.d.ts +3 -2
- package/dist/synthesis/OpenAICloudTTS.d.ts.map +1 -0
- package/dist/synthesis/OpenAICloudTTS.js +6 -5
- package/dist/synthesis/OpenAICloudTTS.js.map +1 -1
- package/dist/synthesis/SamTTS.d.ts +3 -1
- package/dist/synthesis/SamTTS.d.ts.map +1 -0
- package/dist/synthesis/SamTTS.js +2 -2
- package/dist/synthesis/SamTTS.js.map +1 -1
- package/dist/synthesis/SapiTTS.d.ts +3 -2
- package/dist/synthesis/SapiTTS.d.ts.map +1 -0
- package/dist/synthesis/SapiTTS.js +2 -2
- package/dist/synthesis/SapiTTS.js.map +1 -1
- package/dist/synthesis/SvoxPicoTTS.d.ts +3 -2
- package/dist/synthesis/SvoxPicoTTS.d.ts.map +1 -0
- package/dist/synthesis/SvoxPicoTTS.js +3 -3
- package/dist/synthesis/SvoxPicoTTS.js.map +1 -1
- package/dist/synthesis/VitsTTS.d.ts +4 -3
- package/dist/synthesis/VitsTTS.d.ts.map +1 -0
- package/dist/synthesis/VitsTTS.js +14 -11
- package/dist/synthesis/VitsTTS.js.map +1 -1
- package/dist/tests/Test.d.ts +1 -0
- package/dist/tests/Test.d.ts.map +1 -0
- package/dist/text-language-detection/FastTextLanguageDetection.d.ts +1 -0
- package/dist/text-language-detection/FastTextLanguageDetection.d.ts.map +1 -0
- package/dist/text-language-detection/TinyLDLanguageDetection.d.ts +1 -0
- package/dist/text-language-detection/TinyLDLanguageDetection.d.ts.map +1 -0
- package/dist/text-translation/DeepLTextTranslation.d.ts +3 -2
- package/dist/text-translation/DeepLTextTranslation.d.ts.map +1 -0
- package/dist/text-translation/DeepLTextTranslation.js +10 -9
- package/dist/text-translation/DeepLTextTranslation.js.map +1 -1
- package/dist/text-translation/GoogleTranslateTextTranslation.d.ts +5 -4
- package/dist/text-translation/GoogleTranslateTextTranslation.d.ts.map +1 -0
- package/dist/text-translation/GoogleTranslateTextTranslation.js +20 -18
- package/dist/text-translation/GoogleTranslateTextTranslation.js.map +1 -1
- package/dist/text-translation/NLLBTextTranslation.d.ts +3 -2
- package/dist/text-translation/NLLBTextTranslation.d.ts.map +1 -0
- package/dist/text-translation/NLLBTextTranslation.js +4 -6
- package/dist/text-translation/NLLBTextTranslation.js.map +1 -1
- package/dist/typings/TypedArray.d.ts +1 -0
- package/dist/typings/TypedArray.d.ts.map +1 -0
- package/dist/utilities/BrowserRequestHeaders.d.ts +1 -0
- package/dist/utilities/BrowserRequestHeaders.d.ts.map +1 -0
- package/dist/utilities/Compression.d.ts +5 -3
- package/dist/utilities/Compression.d.ts.map +1 -0
- package/dist/utilities/Compression.js +9 -9
- package/dist/utilities/Compression.js.map +1 -1
- package/dist/utilities/FileDownloader.d.ts +7 -3
- package/dist/utilities/FileDownloader.d.ts.map +1 -0
- package/dist/utilities/FileDownloader.js +25 -21
- package/dist/utilities/FileDownloader.js.map +1 -1
- package/dist/utilities/FileReader.d.ts +1 -0
- package/dist/utilities/FileReader.d.ts.map +1 -0
- package/dist/utilities/FileReader.js.map +1 -1
- package/dist/utilities/FileSystem.d.ts +1 -0
- package/dist/utilities/FileSystem.d.ts.map +1 -0
- package/dist/utilities/FileSystem.js +1 -1
- package/dist/utilities/FileSystem.js.map +1 -1
- package/dist/utilities/FileWriter.d.ts +1 -0
- package/dist/utilities/FileWriter.d.ts.map +1 -0
- package/dist/utilities/FileWriter.js.map +1 -1
- package/dist/utilities/Hashing.d.ts +1 -0
- package/dist/utilities/Hashing.d.ts.map +1 -0
- package/dist/utilities/Hashing.js.map +1 -1
- package/dist/utilities/Locale.d.ts +1 -0
- package/dist/utilities/Locale.d.ts.map +1 -0
- package/dist/utilities/Locale.js.map +1 -1
- package/dist/utilities/Logger.d.ts +18 -9
- package/dist/utilities/Logger.d.ts.map +1 -0
- package/dist/utilities/Logger.js +50 -35
- package/dist/utilities/Logger.js.map +1 -1
- package/dist/utilities/NpmUtilities.d.ts +1 -0
- package/dist/utilities/NpmUtilities.d.ts.map +1 -0
- package/dist/utilities/NpmUtilities.js +4 -5
- package/dist/utilities/NpmUtilities.js.map +1 -1
- package/dist/utilities/ObjectUtilities.d.ts +1 -0
- package/dist/utilities/ObjectUtilities.d.ts.map +1 -0
- package/dist/utilities/ObjectUtilities.js.map +1 -1
- package/dist/utilities/OnnxUtilities.d.ts +1 -0
- package/dist/utilities/OnnxUtilities.d.ts.map +1 -0
- package/dist/utilities/OpenPromise.d.ts +1 -0
- package/dist/utilities/OpenPromise.d.ts.map +1 -0
- package/dist/utilities/OpenPromise.js.map +1 -1
- package/dist/utilities/PackageManager.d.ts +5 -1
- package/dist/utilities/PackageManager.d.ts.map +1 -0
- package/dist/utilities/PackageManager.js +37 -22
- package/dist/utilities/PackageManager.js.map +1 -1
- package/dist/utilities/PathUtilities.d.ts +3 -0
- package/dist/utilities/PathUtilities.d.ts.map +1 -0
- package/dist/utilities/PathUtilities.js +5 -2
- package/dist/utilities/PathUtilities.js.map +1 -1
- package/dist/utilities/RandomGenerator.d.ts +1 -0
- package/dist/utilities/RandomGenerator.d.ts.map +1 -0
- package/dist/utilities/SignalChannel.d.ts +1 -0
- package/dist/utilities/SignalChannel.d.ts.map +1 -0
- package/dist/utilities/SmoothEstimator.d.ts +1 -0
- package/dist/utilities/SmoothEstimator.d.ts.map +1 -0
- package/dist/utilities/SmoothEstimator.js.map +1 -1
- package/dist/utilities/StringBuilder.d.ts +1 -0
- package/dist/utilities/StringBuilder.d.ts.map +1 -0
- package/dist/utilities/StringUtilities.d.ts +1 -0
- package/dist/utilities/StringUtilities.d.ts.map +1 -0
- package/dist/utilities/TarballMaker.d.ts +5 -3
- package/dist/utilities/TarballMaker.d.ts.map +1 -0
- package/dist/utilities/TarballMaker.js +6 -6
- package/dist/utilities/TarballMaker.js.map +1 -1
- package/dist/utilities/Timeline.d.ts +1 -0
- package/dist/utilities/Timeline.d.ts.map +1 -0
- package/dist/utilities/Timeline.js.map +1 -1
- package/dist/utilities/Timer.d.ts +1 -0
- package/dist/utilities/Timer.d.ts.map +1 -0
- package/dist/utilities/Utilities.d.ts +10 -7
- package/dist/utilities/Utilities.d.ts.map +1 -0
- package/dist/utilities/Utilities.js +49 -31
- package/dist/utilities/Utilities.js.map +1 -1
- package/dist/utilities/VirtualFileReadStream.d.ts +1 -0
- package/dist/utilities/VirtualFileReadStream.d.ts.map +1 -0
- package/dist/utilities/WebReader.d.ts +3 -1
- package/dist/utilities/WebReader.d.ts.map +1 -0
- package/dist/utilities/WebReader.js +7 -6
- package/dist/utilities/WebReader.js.map +1 -1
- package/dist/utilities/WikipediaReader.d.ts +3 -1
- package/dist/utilities/WikipediaReader.d.ts.map +1 -0
- package/dist/utilities/WikipediaReader.js +1 -5
- package/dist/utilities/WikipediaReader.js.map +1 -1
- package/dist/voice-activity-detection/AdaptiveGateVAD.d.ts +3 -1
- package/dist/voice-activity-detection/AdaptiveGateVAD.d.ts.map +1 -0
- package/dist/voice-activity-detection/AdaptiveGateVAD.js +1 -1
- package/dist/voice-activity-detection/AdaptiveGateVAD.js.map +1 -1
- package/dist/voice-activity-detection/SileroVAD.d.ts +1 -0
- package/dist/voice-activity-detection/SileroVAD.d.ts.map +1 -0
- package/dist/voice-activity-detection/SileroVAD.js.map +1 -1
- package/dist/voice-activity-detection/WebRtcVAD.d.ts +1 -0
- package/dist/voice-activity-detection/WebRtcVAD.d.ts.map +1 -0
- package/dist/voice-activity-detection/WebRtcVAD.js +1 -1
- package/dist/voice-activity-detection/WebRtcVAD.js.map +1 -1
- package/docs/API.md +62 -17
- package/docs/CUDA.md +4 -3
- package/docs/Engines.md +8 -7
- package/docs/Licenses.md +0 -3
- package/docs/Options.md +27 -31
- package/docs/Server.md +1 -0
- package/docs/Tasklist.md +2 -1
- package/docs/Technical.md +2 -2
- package/package.json +45 -35
- package/src/alignment/SemanticTextAlignment.ts +14 -7
- package/src/alignment/SpeechAlignment.ts +47 -150
- package/src/api/APIOptions.ts +1 -1
- package/src/api/Alignment.ts +95 -61
- package/src/api/Common.ts +11 -0
- package/src/api/Denoising.ts +22 -17
- package/src/api/GlobalOptions.ts +4 -20
- package/src/api/Recognition.ts +106 -123
- package/src/api/SourceSeparation.ts +39 -21
- package/src/api/SpeechLanguageDetection.ts +77 -37
- package/src/api/SpeechSearch.ts +6 -1
- package/src/api/SpeechTranslation.ts +75 -38
- package/src/api/Synthesis.ts +220 -116
- package/src/api/TextLanguageDetection.ts +10 -12
- package/src/api/TextTranslation.ts +43 -26
- package/src/api/TimelineTranslationAlignment.ts +41 -13
- package/src/api/TranscriptAndTranslationAlignment.ts +28 -15
- package/src/api/TranslationAlignment.ts +53 -24
- package/src/api/VoiceActivityDetection.ts +33 -68
- package/src/audio/AudioPlayer.ts +4 -232
- package/src/audio/AudioUtilities.ts +9 -2
- package/src/build-tools/MakeTarballsForInstalledPackages.ts +4 -3
- package/src/cli/CLI.ts +209 -101
- package/src/codecs/FFMpegTranscoder.ts +18 -16
- package/src/denoising/NSNet2.ts +5 -4
- package/src/denoising/RNNoise.ts +14 -6
- package/src/dsp/FFT.ts +2 -1
- package/src/dsp/MFCC.ts +7 -5
- package/src/dsp/MelSpectrogram.ts +56 -36
- package/src/dsp/Rubberband.ts +10 -3
- package/src/dsp/Sonic.ts +2 -1
- package/src/dsp/SpeexResampler.ts +2 -1
- package/src/encodings/Ascii.ts +1 -1
- package/src/encodings/Base64.ts +1 -1
- package/src/math/VectorMath.ts +10 -6
- package/src/nlp/EspeakPhonemizer.ts +2 -2
- package/src/nlp/Segmentation.ts +9 -4
- package/src/recognition/AmazonTranscribeSTT.ts +4 -3
- package/src/recognition/AzureCognitiveServicesSTT.ts +5 -4
- package/src/recognition/DeepgramSTT.ts +16 -16
- package/src/recognition/GoogleCloudSTT.ts +14 -12
- package/src/recognition/OpenAICloudSTT.ts +12 -6
- package/src/recognition/WhisperCommon.ts +130 -0
- package/src/recognition/{WhisperCppSTT.ts → WhisperCppCliSTT.ts} +73 -133
- package/src/recognition/WhisperSTT.ts +569 -718
- package/src/server/Client.ts +4 -4
- package/src/server/Worker.ts +59 -59
- package/src/source-separation/MDXNetSourceSeparation.ts +15 -10
- package/src/speech-embeddings/WavToVec2BertFeatureEmbeddings.ts +7 -5
- package/src/speech-language-detection/SileroLanguageDetection.ts +18 -9
- package/src/speech-search/DTWSpeechSearch.ts +6 -5
- package/src/subtitles/Subtitles.ts +22 -22
- package/src/synthesis/AwsPollyTTS.ts +12 -5
- package/src/synthesis/AzureCognitiveServicesTTS.ts +11 -3
- package/src/synthesis/CoquiServerTTS.ts +8 -7
- package/src/synthesis/DeepgramTTS.ts +21 -15
- package/src/synthesis/ElevenLabsTTS.ts +33 -23
- package/src/synthesis/EspeakTTS.ts +145 -69
- package/src/synthesis/FliteTTS.ts +3 -3
- package/src/synthesis/GnuSpeechTTS.ts +2 -2
- package/src/synthesis/GoogleCloudTTS.ts +23 -14
- package/src/synthesis/GoogleTranslateTTS.ts +19 -11
- package/src/synthesis/KokoroTTS.ts +37 -14
- package/src/synthesis/MicrosoftEdgeTTS.ts +71 -23
- package/src/synthesis/OpenAICloudTTS.ts +7 -6
- package/src/synthesis/SamTTS.ts +3 -2
- package/src/synthesis/SapiTTS.ts +3 -3
- package/src/synthesis/SvoxPicoTTS.ts +4 -5
- package/src/synthesis/VitsTTS.ts +43 -15
- package/src/text-translation/DeepLTextTranslation.ts +12 -10
- package/src/text-translation/GoogleTranslateTextTranslation.ts +35 -21
- package/src/text-translation/NLLBTextTranslation.ts +5 -9
- package/src/typings/Fillers.d.ts +0 -60
- package/src/typings/TypedArray.ts +12 -1
- package/src/utilities/Compression.ts +10 -9
- package/src/utilities/FileDownloader.ts +38 -23
- package/src/utilities/FileSystem.ts +1 -1
- package/src/utilities/Logger.ts +59 -42
- package/src/utilities/NpmUtilities.ts +4 -6
- package/src/utilities/OpenPromise.ts +1 -2
- package/src/utilities/PackageManager.ts +53 -26
- package/src/utilities/PathUtilities.ts +6 -2
- package/src/utilities/TarballMaker.ts +7 -7
- package/src/utilities/Utilities.ts +58 -39
- package/src/utilities/WebReader.ts +11 -6
- package/src/utilities/WikipediaReader.ts +2 -8
- package/src/voice-activity-detection/AdaptiveGateVAD.ts +13 -8
- package/src/voice-activity-detection/WebRtcVAD.ts +1 -2
- package/tsconfig.json +53 -94
- package/dist/audio/AudioRecorder.d.ts +0 -3
- package/dist/audio/AudioRecorder.js +0 -68
- package/dist/audio/AudioRecorder.js.map +0 -1
- package/dist/audio/SoxPath.d.ts +0 -1
- package/dist/audio/SoxPath.js +0 -24
- package/dist/audio/SoxPath.js.map +0 -1
- package/dist/recognition/SileroSTT.d.ts +0 -29
- package/dist/recognition/SileroSTT.js +0 -152
- package/dist/recognition/SileroSTT.js.map +0 -1
- package/dist/recognition/VoskSTT.d.ts +0 -10
- package/dist/recognition/VoskSTT.js +0 -72
- package/dist/recognition/VoskSTT.js.map +0 -1
- package/dist/recognition/WhisperCppSTT.js.map +0 -1
- package/dist/synthesis/StreamlabsPollyTTS.d.ts +0 -11
- package/dist/synthesis/StreamlabsPollyTTS.js +0 -88
- package/dist/synthesis/StreamlabsPollyTTS.js.map +0 -1
- package/dist/utilities/BinaryUtilities.d.ts +0 -13
- package/dist/utilities/BinaryUtilities.js +0 -113
- package/dist/utilities/BinaryUtilities.js.map +0 -1
- package/src/audio/AudioRecorder.ts +0 -91
- package/src/audio/SoxPath.ts +0 -31
- package/src/recognition/SileroSTT.ts +0 -222
- package/src/recognition/VoskSTT.ts +0 -112
- package/src/synthesis/StreamlabsPollyTTS.ts +0 -114
- package/src/utilities/BinaryUtilities.ts +0 -138
- /package/{LICENSE.md → LICENSE.GPLv3.md} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { downloadAndExtractTarball } from './FileDownloader.js'
|
|
1
|
+
import { downloadAndExtractTarball, FileDownloaderCallbacks } from './FileDownloader.js'
|
|
2
2
|
import { getAppDataDir, ensureDir, existsSync, remove } from './FileSystem.js'
|
|
3
3
|
import { appName } from '../api/Common.js'
|
|
4
|
-
import { GaxiosOptions } from 'gaxios'
|
|
5
4
|
import { getAppTempDir, joinPath } from './PathUtilities.js'
|
|
6
5
|
import { getGlobalOption } from '../api/GlobalOptions.js'
|
|
6
|
+
import { EasierHttpRequestConfig } from 'easier-http-request'
|
|
7
7
|
|
|
8
|
-
export async function loadPackage(packageName: string) {
|
|
8
|
+
export async function loadPackage(packageName: string, callbacks: LoadPackageCallbacks) {
|
|
9
9
|
packageName = resolveToVersionedPackageNameIfNeeded(packageName)
|
|
10
10
|
|
|
11
11
|
const packagesPath = await ensureAndGetPackagesDir()
|
|
@@ -23,16 +23,18 @@ export async function loadPackage(packageName: string) {
|
|
|
23
23
|
const headers = {
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const config: EasierHttpRequestConfig = {
|
|
27
27
|
url: `${packageBaseURL}${packageName}.tar.gz`,
|
|
28
|
-
headers
|
|
28
|
+
headers,
|
|
29
|
+
abortSignal: callbacks?.abortSignal
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
await downloadAndExtractTarball(
|
|
32
|
-
|
|
33
|
+
config,
|
|
33
34
|
packagesPath,
|
|
34
35
|
tempPath,
|
|
35
36
|
packageName,
|
|
37
|
+
callbacks,
|
|
36
38
|
)
|
|
37
39
|
|
|
38
40
|
return packagePath
|
|
@@ -81,8 +83,8 @@ export function resolveVersionTagForUnversionedPackageName(unversionedPackageNam
|
|
|
81
83
|
const defaultVersionTag = '20230718'
|
|
82
84
|
|
|
83
85
|
const packageVersionTagResolutionLookup: { [packageName: string]: string } = {
|
|
84
|
-
//
|
|
85
|
-
'
|
|
86
|
+
// eSpeak-NG
|
|
87
|
+
'espeak-ng-emscripten': '20260722',
|
|
86
88
|
|
|
87
89
|
// VITS voices
|
|
88
90
|
'vits-de_DE-thorsten_emotional-medium': '20230808',
|
|
@@ -131,17 +133,6 @@ const packageVersionTagResolutionLookup: { [packageName: string]: string } = {
|
|
|
131
133
|
'kokoro-82m-v1.0-quantized': '20250209',
|
|
132
134
|
'kokoro-82m-v1.0-voices': '20250209',
|
|
133
135
|
|
|
134
|
-
// Whisper (integrated engine) models
|
|
135
|
-
'whisper-tiny': '20231126',
|
|
136
|
-
'whisper-tiny.en': '20231126',
|
|
137
|
-
'whisper-base': '20231126',
|
|
138
|
-
'whisper-base.en': '20231126',
|
|
139
|
-
'whisper-small': '20231126',
|
|
140
|
-
'whisper-small.en': '20231126',
|
|
141
|
-
'whisper-medium': '20231126',
|
|
142
|
-
'whisper-medium.en': '20231126',
|
|
143
|
-
'whisper-large-v3-turbo-fp16': '20241002',
|
|
144
|
-
|
|
145
136
|
// Whisper tiktoken data
|
|
146
137
|
'whisper-tiktoken-data': '20240408',
|
|
147
138
|
|
|
@@ -169,38 +160,71 @@ const packageVersionTagResolutionLookup: { [packageName: string]: string } = {
|
|
|
169
160
|
// whisper.cpp models
|
|
170
161
|
'whisper.cpp-tiny': '20240405',
|
|
171
162
|
'whisper.cpp-tiny-q5_1': '20240405',
|
|
163
|
+
'whisper.cpp-tiny-q8_0': '20260725',
|
|
164
|
+
|
|
172
165
|
'whisper.cpp-tiny.en': '20240405',
|
|
173
166
|
'whisper.cpp-tiny.en-q5_1': '20240405',
|
|
174
|
-
'whisper.cpp-tiny.en-q8_0': '
|
|
167
|
+
'whisper.cpp-tiny.en-q8_0': '20260725',
|
|
175
168
|
|
|
176
169
|
'whisper.cpp-base': '20240405',
|
|
177
170
|
'whisper.cpp-base-q5_1': '20240405',
|
|
171
|
+
'whisper.cpp-base-q8_0': '20260725',
|
|
172
|
+
|
|
178
173
|
'whisper.cpp-base.en': '20240405',
|
|
179
174
|
'whisper.cpp-base.en-q5_1': '20240405',
|
|
175
|
+
'whisper.cpp-base.en-q8_0': '20260725',
|
|
180
176
|
|
|
181
177
|
'whisper.cpp-small': '20240405',
|
|
182
178
|
'whisper.cpp-small-q5_1': '20240405',
|
|
179
|
+
'whisper.cpp-small-q8_0': '20260725',
|
|
180
|
+
|
|
183
181
|
'whisper.cpp-small.en': '20240405',
|
|
184
182
|
'whisper.cpp-small.en-q5_1': '20240405',
|
|
183
|
+
'whisper.cpp-small.en-q8_0': '20260725',
|
|
185
184
|
|
|
186
185
|
'whisper.cpp-medium': '20240405',
|
|
187
186
|
'whisper.cpp-medium-q5_0': '20240405',
|
|
187
|
+
'whisper.cpp-medium-q8_0': '20260725',
|
|
188
|
+
|
|
188
189
|
'whisper.cpp-medium.en': '20240405',
|
|
189
190
|
'whisper.cpp-medium.en-q5_0': '20240405',
|
|
191
|
+
'whisper.cpp-medium.en-q8_0': '20260725',
|
|
190
192
|
|
|
191
193
|
'whisper.cpp-large-v1': '20240405',
|
|
194
|
+
|
|
192
195
|
'whisper.cpp-large-v2': '20240405',
|
|
193
196
|
'whisper.cpp-large-v2-q5_0': '20240405',
|
|
197
|
+
'whisper.cpp-large-v2-q8_0': '20260725',
|
|
198
|
+
|
|
194
199
|
'whisper.cpp-large-v3': '20240405',
|
|
195
200
|
'whisper.cpp-large-v3-q5_0': '20240405',
|
|
201
|
+
|
|
196
202
|
'whisper.cpp-large-v3-turbo': '20241003',
|
|
197
203
|
'whisper.cpp-large-v3-turbo-q5_0': '20241003',
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
'whisper.cpp-
|
|
202
|
-
'whisper.cpp-
|
|
203
|
-
'whisper.cpp-
|
|
204
|
+
'whisper.cpp-large-v3-turbo-q8_0': '20260725',
|
|
205
|
+
|
|
206
|
+
// whisper.cpp library fork used for binding (introduced in Echogarden v3.0.0)
|
|
207
|
+
'whisper.cpp-lib-windows-x64-cpu': '20260720',
|
|
208
|
+
'whisper.cpp-lib-windows-x64-cublas-12.4.0': '20260720',
|
|
209
|
+
'whisper.cpp-lib-windows-arm64-cpu': '20260720',
|
|
210
|
+
'whisper.cpp-lib-macos-universal': '20260720',
|
|
211
|
+
'whisper.cpp-lib-macos-universal-cpu-basic': '20260720',
|
|
212
|
+
'whisper.cpp-lib-linux-x64-cpu': '20260720',
|
|
213
|
+
'whisper.cpp-lib-linux-x64-cublas-12.4.0': '20260720',
|
|
214
|
+
'whisper.cpp-lib-linux-arm64-cpu': '20260720',
|
|
215
|
+
|
|
216
|
+
// CuBLAS dynamically linked libraries Windows x64 distribution
|
|
217
|
+
'cublas-lib-12.4.0-windows-x64': '20250607',
|
|
218
|
+
|
|
219
|
+
// whisper.cpp CLI binaries
|
|
220
|
+
'whisper.cpp-binaries-windows-x64-cpu': '20260720',
|
|
221
|
+
'whisper.cpp-binaries-windows-x64-cublas-12.4.0': '20260720',
|
|
222
|
+
'whisper.cpp-binaries-windows-arm64-cpu': '20260720',
|
|
223
|
+
'whisper.cpp-binaries-macos-universal': '20260720',
|
|
224
|
+
'whisper.cpp-binaries-macos-universal-cpu-basic': '20260720',
|
|
225
|
+
'whisper.cpp-binaries-linux-x64-cpu': '20260720',
|
|
226
|
+
'whisper.cpp-binaries-linux-x64-cublas-12.4.0': '20260720',
|
|
227
|
+
'whisper.cpp-binaries-linux-arm64-cpu': '20260720',
|
|
204
228
|
|
|
205
229
|
// E5 models
|
|
206
230
|
'xenova-multilingual-e5-small-q8': '20240504',
|
|
@@ -220,3 +244,6 @@ const packageVersionTagResolutionLookup: { [packageName: string]: string } = {
|
|
|
220
244
|
'nsnet2-20ms-baseline': '20242610',
|
|
221
245
|
'nsnet2-20ms-48k-baseline': '20242610',
|
|
222
246
|
}
|
|
247
|
+
|
|
248
|
+
export interface LoadPackageCallbacks extends FileDownloaderCallbacks {
|
|
249
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as NodePath from 'node:path'
|
|
2
|
-
import
|
|
2
|
+
import * as NodeUrl from 'node:url'
|
|
3
3
|
import * as os from 'node:os'
|
|
4
4
|
|
|
5
5
|
export function getModuleRootDir() {
|
|
6
|
-
const currentScriptDir = getDirName(fileURLToPath(import.meta.url))
|
|
6
|
+
const currentScriptDir = getDirName(NodeUrl.fileURLToPath(import.meta.url))
|
|
7
7
|
|
|
8
8
|
return resolvePath(currentScriptDir, '..', '..')
|
|
9
9
|
}
|
|
@@ -53,6 +53,10 @@ export function normalizePath(path: string) {
|
|
|
53
53
|
return NodePath.normalize(path)
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
export function pathToFileUrl(path: string) {
|
|
57
|
+
return NodeUrl.pathToFileURL(path)
|
|
58
|
+
}
|
|
59
|
+
|
|
56
60
|
export function getBaseName(path: string) {
|
|
57
61
|
return NodePath.basename(path)
|
|
58
62
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { createTarball } from './Compression.js'
|
|
2
2
|
import { ensureDir, move, readdir, stat } from './FileSystem.js'
|
|
3
|
-
import { appName } from '../api/Common.js'
|
|
3
|
+
import { appName, OperationCallbacks } from '../api/Common.js'
|
|
4
4
|
import { getRandomHexString } from './Utilities.js'
|
|
5
5
|
import { getAppTempDir, getFileNameWithoutExtension, joinPath } from './PathUtilities.js'
|
|
6
6
|
|
|
7
|
-
export async function createNamedTarball(inputPath: string, name: string, tarballDir: string) {
|
|
7
|
+
export async function createNamedTarball(inputPath: string, name: string, tarballDir: string, callbacks: OperationCallbacks) {
|
|
8
8
|
const tempDir = getAppTempDir(appName)
|
|
9
9
|
await ensureDir(tempDir)
|
|
10
10
|
const tempFilename = joinPath(tempDir, getRandomHexString(16))
|
|
11
11
|
|
|
12
|
-
await createTarball(inputPath, tempFilename, name)
|
|
12
|
+
await createTarball(inputPath, tempFilename, name, callbacks)
|
|
13
13
|
|
|
14
14
|
const targetFilname = joinPath(tarballDir, `${name}.tar.gz`)
|
|
15
15
|
|
|
16
16
|
await move(tempFilename, targetFilname)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export async function createTarballForEachDirIn(baseDir: string, namePrefix: string, tarballDir: string) {
|
|
19
|
+
export async function createTarballForEachDirIn(baseDir: string, namePrefix: string, tarballDir: string, callbacks: OperationCallbacks) {
|
|
20
20
|
for (const dirName of await readdir(baseDir)) {
|
|
21
21
|
const dirPath = joinPath(baseDir, dirName)
|
|
22
22
|
|
|
@@ -28,11 +28,11 @@ export async function createTarballForEachDirIn(baseDir: string, namePrefix: str
|
|
|
28
28
|
|
|
29
29
|
const archiveName = `${namePrefix}-${dirName}`
|
|
30
30
|
|
|
31
|
-
await createNamedTarball(dirPath, archiveName, tarballDir)
|
|
31
|
+
await createNamedTarball(dirPath, archiveName, tarballDir, callbacks)
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export async function createTarballForEachFileIn(baseDir: string, namePrefix: string, tarballDir: string) {
|
|
35
|
+
export async function createTarballForEachFileIn(baseDir: string, namePrefix: string, tarballDir: string, callbacks: OperationCallbacks) {
|
|
36
36
|
for (const filename of await readdir(baseDir)) {
|
|
37
37
|
const filenameWithoutExtension = getFileNameWithoutExtension(filename)
|
|
38
38
|
|
|
@@ -46,6 +46,6 @@ export async function createTarballForEachFileIn(baseDir: string, namePrefix: st
|
|
|
46
46
|
|
|
47
47
|
const archiveName = `${namePrefix}-${filenameWithoutExtension}`
|
|
48
48
|
|
|
49
|
-
await createNamedTarball(filePath, archiveName, tarballDir)
|
|
49
|
+
await createNamedTarball(filePath, archiveName, tarballDir, callbacks)
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -8,7 +8,8 @@ import { ChildProcessWithoutNullStreams } from 'node:child_process'
|
|
|
8
8
|
import { inspect } from 'node:util'
|
|
9
9
|
import { TypedArray, TypedArrayConstructor } from '../typings/TypedArray.js'
|
|
10
10
|
import { encodeHex } from '../encodings/Hex.js'
|
|
11
|
-
import {
|
|
11
|
+
import { OperationCallbacks } from '../api/Common.js'
|
|
12
|
+
import { parseJSON5, stringifyJSON5 } from 'quick-json5'
|
|
12
13
|
|
|
13
14
|
const log = logToStderr
|
|
14
15
|
|
|
@@ -125,20 +126,8 @@ export function roundToDigits(val: number, digits = 3) {
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
export function sleep(timeMs: number) {
|
|
128
|
-
const timer = new Timer()
|
|
129
|
-
|
|
130
129
|
return new Promise<void>((resolve) => {
|
|
131
|
-
|
|
132
|
-
if (timer.elapsedTime < timeMs) {
|
|
133
|
-
//setImmediate(tickCallback)
|
|
134
|
-
setTimeout(tickCallback, 0)
|
|
135
|
-
} else {
|
|
136
|
-
resolve()
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
//setImmediate(tickCallback)
|
|
141
|
-
setTimeout(tickCallback, 0)
|
|
130
|
+
setTimeout(resolve, timeMs)
|
|
142
131
|
})
|
|
143
132
|
}
|
|
144
133
|
|
|
@@ -156,23 +145,19 @@ export function printMatrix(matrix: Float32Array[]) {
|
|
|
156
145
|
}
|
|
157
146
|
}
|
|
158
147
|
|
|
159
|
-
export
|
|
148
|
+
export function parseJson(jsonText: string, useJson5 = false) {
|
|
160
149
|
if (useJson5) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
return JSON5.parse(jsonText)
|
|
150
|
+
return parseJSON5(jsonText)
|
|
164
151
|
} else {
|
|
165
152
|
return JSON.parse(jsonText)
|
|
166
153
|
}
|
|
167
154
|
}
|
|
168
155
|
|
|
169
|
-
export
|
|
156
|
+
export function stringifyAndFormatJson(obj: any, useJson5 = false) {
|
|
170
157
|
let textContent: string
|
|
171
158
|
|
|
172
159
|
if (useJson5) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
textContent = JSON5.stringify(obj, undefined, 4)
|
|
160
|
+
textContent = stringifyJSON5(obj, undefined, 4)
|
|
176
161
|
} else {
|
|
177
162
|
textContent = JSON.stringify(obj, undefined, 4)
|
|
178
163
|
}
|
|
@@ -180,11 +165,11 @@ export async function stringifyAndFormatJson(obj: any, useJson5 = false) {
|
|
|
180
165
|
return textContent
|
|
181
166
|
}
|
|
182
167
|
|
|
183
|
-
export
|
|
168
|
+
export function parseJSONAndGetType(str: string, useJson5 = false) {
|
|
184
169
|
let parsedValue: any = undefined
|
|
185
170
|
|
|
186
171
|
try {
|
|
187
|
-
parsedValue =
|
|
172
|
+
parsedValue = parseJson(str, useJson5)
|
|
188
173
|
} catch (e) {
|
|
189
174
|
}
|
|
190
175
|
|
|
@@ -210,7 +195,6 @@ export async function parseJSONAndGetType(str: string, useJson5 = false) {
|
|
|
210
195
|
}
|
|
211
196
|
}
|
|
212
197
|
|
|
213
|
-
|
|
214
198
|
export function secondsToHMS(totalSeconds: number) {
|
|
215
199
|
let remainingSeconds = totalSeconds
|
|
216
200
|
|
|
@@ -428,12 +412,13 @@ export async function resolveModuleScriptPath(moduleName: string) {
|
|
|
428
412
|
|
|
429
413
|
export async function runOperationWithRetries<R>(
|
|
430
414
|
operationFunc: () => Promise<R>,
|
|
431
|
-
logger: Logger,
|
|
432
415
|
operationName = 'Operation',
|
|
416
|
+
callbacks: OperationCallbacks,
|
|
433
417
|
delayBetweenRetries = 2000,
|
|
434
|
-
maxRetries = 200
|
|
418
|
+
maxRetries = 200,
|
|
419
|
+
errorFilter?: (e: any) => boolean) {
|
|
435
420
|
|
|
436
|
-
const
|
|
421
|
+
const logger = new Logger(callbacks.logLevel)
|
|
437
422
|
|
|
438
423
|
for (let retryIndex = 1; retryIndex <= maxRetries; retryIndex++) {
|
|
439
424
|
try {
|
|
@@ -441,25 +426,19 @@ export async function runOperationWithRetries<R>(
|
|
|
441
426
|
|
|
442
427
|
return result
|
|
443
428
|
} catch (e: any) {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
if (shouldCancelCurrentTask()) {
|
|
447
|
-
throw new Error('Canceled')
|
|
429
|
+
if (errorFilter && errorFilter(e) === false) {
|
|
430
|
+
throw e
|
|
448
431
|
}
|
|
449
432
|
|
|
450
|
-
logger.
|
|
451
|
-
|
|
452
|
-
logger.logTitledMessage(`Error`, e.message, chalk.redBright, 'error')
|
|
433
|
+
logger.logTitledMessage(`Error`, e.message, 'error')
|
|
453
434
|
logger.log('', 'error')
|
|
454
|
-
logger.logTitledMessage(`${operationName} failed`, `Trying again in ${delayBetweenRetries}ms..`,
|
|
435
|
+
logger.logTitledMessage(`${operationName} failed`, `Trying again in ${delayBetweenRetries}ms..`, 'error')
|
|
455
436
|
|
|
456
437
|
await sleep(delayBetweenRetries)
|
|
457
438
|
|
|
458
439
|
logger.log(``, 'warning')
|
|
459
|
-
logger.logTitledMessage(`Starting retry attempt`, `${retryIndex} / ${maxRetries}`,
|
|
440
|
+
logger.logTitledMessage(`Starting retry attempt`, `${retryIndex} / ${maxRetries}`, 'warning')
|
|
460
441
|
logger.log(``, 'warning')
|
|
461
|
-
|
|
462
|
-
logger.unsetAsActiveLogger()
|
|
463
442
|
}
|
|
464
443
|
}
|
|
465
444
|
|
|
@@ -588,3 +567,43 @@ export function getTopKIndexes(values: ArrayLike<number>, topCount: number, sort
|
|
|
588
567
|
|
|
589
568
|
return topKIndexes
|
|
590
569
|
}
|
|
570
|
+
|
|
571
|
+
export function isValidHttpUrl(urlString: string): boolean {
|
|
572
|
+
if (typeof urlString !== 'string' || urlString.trim() === '') {
|
|
573
|
+
return false
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
try {
|
|
577
|
+
const url = new URL(urlString)
|
|
578
|
+
|
|
579
|
+
const allowedProtocols = ['http:', 'https:']
|
|
580
|
+
|
|
581
|
+
if (!allowedProtocols.includes(url.protocol)) {
|
|
582
|
+
return false;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
if (!url.hostname) {
|
|
586
|
+
return false
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
return true
|
|
590
|
+
} catch (error) {
|
|
591
|
+
return false
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
export function throwIfAborted(abortSignal?: AbortSignal, cleanupFunction?: Function) {
|
|
596
|
+
if (!abortSignal) {
|
|
597
|
+
return
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
try {
|
|
601
|
+
abortSignal.throwIfAborted()
|
|
602
|
+
} catch (error) {
|
|
603
|
+
if (cleanupFunction) {
|
|
604
|
+
cleanupFunction()
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
throw error
|
|
608
|
+
}
|
|
609
|
+
}
|
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
import { Readability } from '@mozilla/readability'
|
|
2
2
|
import { JSDOM, VirtualConsole } from 'jsdom'
|
|
3
|
-
import { request } from 'gaxios'
|
|
4
3
|
import { Logger } from './Logger.js'
|
|
5
4
|
import { getChromeOnWindowsHeaders } from './BrowserRequestHeaders.js'
|
|
6
5
|
import { convertHtmlToText } from './StringUtilities.js'
|
|
6
|
+
import { requestHttp } from 'easier-http-request'
|
|
7
|
+
import { OperationCallbacks } from '../api/Common.js'
|
|
8
|
+
|
|
9
|
+
export async function fetchDocumentText(url: string, callbacks: OperationCallbacks) {
|
|
10
|
+
const progressLogger = new Logger(callbacks.logLevel)
|
|
7
11
|
|
|
8
|
-
export async function fetchDocumentText(url: string) {
|
|
9
|
-
const progressLogger = new Logger()
|
|
10
12
|
progressLogger.start(`Fetch ${url}`)
|
|
11
13
|
|
|
12
14
|
const parsedUrl = new URL(url)
|
|
13
15
|
const origin = parsedUrl.origin
|
|
14
16
|
|
|
15
|
-
const response = await
|
|
17
|
+
const response = await requestHttp({
|
|
16
18
|
url,
|
|
17
|
-
responseType: 'text',
|
|
18
19
|
|
|
19
20
|
headers: getChromeOnWindowsHeaders({
|
|
20
21
|
origin: origin,
|
|
21
22
|
referrer: `${origin}/`
|
|
22
23
|
}),
|
|
24
|
+
|
|
25
|
+
abortSignal: callbacks?.abortSignal
|
|
23
26
|
})
|
|
24
27
|
|
|
28
|
+
const responseBodyText = await response.text()
|
|
29
|
+
|
|
25
30
|
progressLogger.start(`Parse document body`)
|
|
26
31
|
|
|
27
|
-
const doc = new JSDOM(
|
|
32
|
+
const doc = new JSDOM(responseBodyText, {
|
|
28
33
|
url,
|
|
29
34
|
virtualConsole: new VirtualConsole()
|
|
30
35
|
})
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
+
import { OperationCallbacks } from '../api/Common.js'
|
|
1
2
|
import { splitToParagraphs, wordCharacterRegExp } from '../nlp/Segmentation.js'
|
|
2
|
-
import { Logger } from './Logger.js'
|
|
3
|
-
|
|
4
|
-
export async function parseWikipediaArticle(articleName: string, language: string) {
|
|
5
|
-
const logger = new Logger()
|
|
6
|
-
|
|
7
|
-
await logger.startAsync('Fetching Wikipedia article')
|
|
8
3
|
|
|
4
|
+
export async function fetchAndParseWikipediaArticle(articleName: string, language: string, callbacks: OperationCallbacks) {
|
|
9
5
|
const { default: wtf } = await import('wtf_wikipedia')
|
|
10
6
|
|
|
11
7
|
const document = await wtf.fetch(articleName, language)
|
|
@@ -35,7 +31,5 @@ export async function parseWikipediaArticle(articleName: string, language: strin
|
|
|
35
31
|
}
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
logger.end()
|
|
39
|
-
|
|
40
34
|
return sectionsText
|
|
41
35
|
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { VoiceActivityDetectionCallbacks } from '../api/VoiceActivityDetection.js'
|
|
2
|
+
import { RawAudio, getRawAudioDuration } from '../audio/AudioUtilities.js'
|
|
3
|
+
import { BiquadFilter, createHighpassFilter, createLowpassFilter } from '../dsp/BiquadFilter.js'
|
|
4
|
+
import { DecayingPeakEstimator } from '../dsp/DecayingPeakEstimator.js'
|
|
5
|
+
import { LoudnessEstimator } from '../dsp/LoudnessEstimator.js'
|
|
6
|
+
import { extendDeep } from '../utilities/ObjectUtilities.js'
|
|
7
|
+
import { Timeline } from '../utilities/Timeline.js'
|
|
8
|
+
import { logToStderr } from '../utilities/Utilities.js'
|
|
8
9
|
|
|
9
10
|
const log = logToStderr
|
|
10
11
|
|
|
11
|
-
export async function detectVoiceActivity(
|
|
12
|
+
export async function detectVoiceActivity(
|
|
13
|
+
rawAudio: RawAudio,
|
|
14
|
+
options: AdaptiveGateVADOptions,
|
|
15
|
+
callbacks: VoiceActivityDetectionCallbacks) {
|
|
16
|
+
|
|
12
17
|
const channelCount = rawAudio.audioChannels.length
|
|
13
18
|
const sampleCount = rawAudio.audioChannels[0].length
|
|
14
19
|
const sampleRate = rawAudio.sampleRate
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as AudioBufferConversion from '../audio/AudioBufferConversion.js'
|
|
2
2
|
import { RawAudio } from '../audio/AudioUtilities.js'
|
|
3
3
|
|
|
4
|
-
import { wrapEmscriptenModuleHeap } from 'wasm-heap-manager'
|
|
5
|
-
|
|
6
4
|
export async function detectVoiceActivity(rawAudio: RawAudio, frameDuration: 10 | 20 | 30 = 10, mode: 0 | 1 | 2 | 3 = 0) {
|
|
7
5
|
if (rawAudio.sampleRate != 16000) {
|
|
8
6
|
throw new Error('Audio sample rate must be 16KHz')
|
|
@@ -16,6 +14,7 @@ export async function detectVoiceActivity(rawAudio: RawAudio, frameDuration: 10
|
|
|
16
14
|
export async function fvad(samples: Int16Array, sampleRate: number, frameDuration: 10 | 20 | 30, mode: 0 | 1 | 2 | 3) {
|
|
17
15
|
const m = await getFvadInstance()
|
|
18
16
|
|
|
17
|
+
const { wrapEmscriptenModuleHeap } = await import('wasm-heap-manager')
|
|
19
18
|
const wasmHeap = wrapEmscriptenModuleHeap(m)
|
|
20
19
|
|
|
21
20
|
const fvad_new = m._fvad_new
|