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.
- 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.js.map +1 -1
- package/dist/alignment/SemanticTextAlignment.d.ts +4 -2
- package/dist/alignment/SemanticTextAlignment.d.ts.map +1 -1
- package/dist/alignment/SemanticTextAlignment.js +7 -7
- package/dist/alignment/SemanticTextAlignment.js.map +1 -1
- package/dist/alignment/SpeechAlignment.d.ts +9 -10
- package/dist/alignment/SpeechAlignment.d.ts.map +1 -1
- package/dist/alignment/SpeechAlignment.js +23 -96
- package/dist/alignment/SpeechAlignment.js.map +1 -1
- package/dist/api/APIOptions.d.ts +1 -1
- package/dist/api/APIOptions.d.ts.map +1 -1
- package/dist/api/Alignment.d.ts +8 -6
- package/dist/api/Alignment.d.ts.map +1 -1
- package/dist/api/Alignment.js +31 -40
- package/dist/api/Alignment.js.map +1 -1
- package/dist/api/Common.d.ts +7 -0
- package/dist/api/Common.d.ts.map +1 -1
- package/dist/api/Common.js.map +1 -1
- package/dist/api/Denoising.d.ts +5 -2
- package/dist/api/Denoising.d.ts.map +1 -1
- package/dist/api/Denoising.js +15 -15
- package/dist/api/Denoising.js.map +1 -1
- package/dist/api/GlobalOptions.d.ts +2 -8
- package/dist/api/GlobalOptions.d.ts.map +1 -1
- package/dist/api/GlobalOptions.js +2 -13
- package/dist/api/GlobalOptions.js.map +1 -1
- package/dist/api/Recognition.d.ts +11 -12
- package/dist/api/Recognition.d.ts.map +1 -1
- package/dist/api/Recognition.js +32 -82
- package/dist/api/Recognition.js.map +1 -1
- package/dist/api/SourceSeparation.d.ts +7 -2
- package/dist/api/SourceSeparation.d.ts.map +1 -1
- package/dist/api/SourceSeparation.js +12 -10
- package/dist/api/SourceSeparation.js.map +1 -1
- package/dist/api/SpeechLanguageDetection.d.ts +11 -7
- package/dist/api/SpeechLanguageDetection.d.ts.map +1 -1
- package/dist/api/SpeechLanguageDetection.js +37 -30
- package/dist/api/SpeechLanguageDetection.js.map +1 -1
- package/dist/api/SpeechSearch.d.ts +4 -1
- package/dist/api/SpeechSearch.d.ts.map +1 -1
- package/dist/api/SpeechSearch.js.map +1 -1
- package/dist/api/SpeechTranslation.d.ts +10 -6
- package/dist/api/SpeechTranslation.d.ts.map +1 -1
- package/dist/api/SpeechTranslation.js +28 -26
- package/dist/api/SpeechTranslation.js.map +1 -1
- package/dist/api/Synthesis.d.ts +13 -8
- package/dist/api/Synthesis.d.ts.map +1 -1
- package/dist/api/Synthesis.js +67 -89
- package/dist/api/Synthesis.js.map +1 -1
- package/dist/api/TextLanguageDetection.d.ts +4 -2
- package/dist/api/TextLanguageDetection.d.ts.map +1 -1
- package/dist/api/TextLanguageDetection.js +4 -7
- package/dist/api/TextLanguageDetection.js.map +1 -1
- package/dist/api/TextTranslation.d.ts +4 -2
- package/dist/api/TextTranslation.d.ts.map +1 -1
- package/dist/api/TextTranslation.js +13 -24
- package/dist/api/TextTranslation.js.map +1 -1
- package/dist/api/TimelineTranslationAlignment.d.ts +6 -3
- package/dist/api/TimelineTranslationAlignment.d.ts.map +1 -1
- package/dist/api/TimelineTranslationAlignment.js +20 -11
- package/dist/api/TimelineTranslationAlignment.js.map +1 -1
- package/dist/api/TranscriptAndTranslationAlignment.d.ts +6 -4
- package/dist/api/TranscriptAndTranslationAlignment.d.ts.map +1 -1
- package/dist/api/TranscriptAndTranslationAlignment.js +11 -12
- package/dist/api/TranscriptAndTranslationAlignment.js.map +1 -1
- package/dist/api/TranslationAlignment.d.ts +6 -4
- package/dist/api/TranslationAlignment.d.ts.map +1 -1
- package/dist/api/TranslationAlignment.js +20 -21
- package/dist/api/TranslationAlignment.js.map +1 -1
- package/dist/api/VoiceActivityDetection.d.ts +9 -8
- package/dist/api/VoiceActivityDetection.d.ts.map +1 -1
- package/dist/api/VoiceActivityDetection.js +20 -43
- package/dist/api/VoiceActivityDetection.js.map +1 -1
- package/dist/audio/AudioBufferConversion.js.map +1 -1
- package/dist/audio/AudioPlayer.d.ts +1 -3
- package/dist/audio/AudioPlayer.d.ts.map +1 -1
- package/dist/audio/AudioPlayer.js +3 -188
- package/dist/audio/AudioPlayer.js.map +1 -1
- package/dist/audio/AudioUtilities.d.ts +2 -1
- package/dist/audio/AudioUtilities.d.ts.map +1 -1
- package/dist/audio/AudioUtilities.js +2 -2
- package/dist/audio/AudioUtilities.js.map +1 -1
- package/dist/build-tools/MakeTarballsForInstalledPackages.js +3 -3
- package/dist/build-tools/MakeTarballsForInstalledPackages.js.map +1 -1
- package/dist/cli/CLI.d.ts.map +1 -1
- package/dist/cli/CLI.js +139 -92
- package/dist/cli/CLI.js.map +1 -1
- package/dist/codecs/FFMpegTranscoder.d.ts +4 -3
- package/dist/codecs/FFMpegTranscoder.d.ts.map +1 -1
- package/dist/codecs/FFMpegTranscoder.js +16 -14
- package/dist/codecs/FFMpegTranscoder.js.map +1 -1
- package/dist/codecs/TIMITCodec.d.ts.map +1 -1
- package/dist/data-structures/DynamicTypedArray.d.ts.map +1 -1
- package/dist/data-structures/DynamicTypedArray.js.map +1 -1
- package/dist/data-structures/Queue.d.ts.map +1 -1
- package/dist/data-structures/WindowedList.d.ts.map +1 -1
- package/dist/data-structures/WindowedList.js.map +1 -1
- package/dist/denoising/NSNet2.d.ts +3 -2
- package/dist/denoising/NSNet2.d.ts.map +1 -1
- package/dist/denoising/NSNet2.js +4 -4
- package/dist/denoising/NSNet2.js.map +1 -1
- package/dist/denoising/RNNoise.d.ts +2 -1
- package/dist/denoising/RNNoise.d.ts.map +1 -1
- package/dist/denoising/RNNoise.js +10 -6
- package/dist/denoising/RNNoise.js.map +1 -1
- package/dist/dsp/BiquadFilter.d.ts.map +1 -1
- package/dist/dsp/DecayingPeakEstimator.d.ts.map +1 -1
- package/dist/dsp/DecayingPeakEstimator.js.map +1 -1
- package/dist/dsp/FFT.d.ts.map +1 -1
- package/dist/dsp/FFT.js +2 -1
- package/dist/dsp/FFT.js.map +1 -1
- package/dist/dsp/KWeightingFilter.d.ts.map +1 -1
- package/dist/dsp/KWeightingFilter.js.map +1 -1
- package/dist/dsp/LoudnessEstimator.d.ts.map +1 -1
- package/dist/dsp/LoudnessEstimator.js.map +1 -1
- package/dist/dsp/MFCC.d.ts +3 -2
- package/dist/dsp/MFCC.d.ts.map +1 -1
- package/dist/dsp/MFCC.js +4 -4
- package/dist/dsp/MFCC.js.map +1 -1
- package/dist/dsp/MelSpectrogram.d.ts +10 -8
- package/dist/dsp/MelSpectrogram.d.ts.map +1 -1
- package/dist/dsp/MelSpectrogram.js +31 -34
- package/dist/dsp/MelSpectrogram.js.map +1 -1
- package/dist/dsp/Rubberband.d.ts.map +1 -1
- package/dist/dsp/Rubberband.js +8 -3
- package/dist/dsp/Rubberband.js.map +1 -1
- package/dist/dsp/Sonic.d.ts.map +1 -1
- package/dist/dsp/Sonic.js +1 -1
- package/dist/dsp/Sonic.js.map +1 -1
- package/dist/dsp/SpeexResampler.d.ts.map +1 -1
- package/dist/dsp/SpeexResampler.js +1 -1
- package/dist/dsp/SpeexResampler.js.map +1 -1
- package/dist/encodings/Ascii.d.ts +1 -1
- package/dist/encodings/Ascii.d.ts.map +1 -1
- package/dist/encodings/Base64.js.map +1 -1
- package/dist/encodings/Utf16.d.ts.map +1 -1
- package/dist/encodings/Utf8.d.ts.map +1 -1
- package/dist/math/VectorMath.d.ts +1 -0
- package/dist/math/VectorMath.d.ts.map +1 -1
- package/dist/math/VectorMath.js +9 -5
- package/dist/math/VectorMath.js.map +1 -1
- package/dist/nlp/ChineseSegmentation.d.ts +1 -1
- package/dist/nlp/ChineseSegmentation.d.ts.map +1 -1
- package/dist/nlp/EspeakPhonemizer.d.ts +1 -1
- package/dist/nlp/EspeakPhonemizer.d.ts.map +1 -1
- package/dist/nlp/EspeakPhonemizer.js +2 -2
- package/dist/nlp/EspeakPhonemizer.js.map +1 -1
- package/dist/nlp/IPA.d.ts +2 -2
- package/dist/nlp/Segmentation.d.ts +1 -1
- package/dist/nlp/Segmentation.d.ts.map +1 -1
- package/dist/nlp/Segmentation.js +8 -4
- package/dist/nlp/Segmentation.js.map +1 -1
- package/dist/recognition/AmazonTranscribeSTT.d.ts +2 -1
- package/dist/recognition/AmazonTranscribeSTT.d.ts.map +1 -1
- package/dist/recognition/AmazonTranscribeSTT.js +3 -3
- package/dist/recognition/AmazonTranscribeSTT.js.map +1 -1
- package/dist/recognition/AzureCognitiveServicesSTT.d.ts +2 -1
- package/dist/recognition/AzureCognitiveServicesSTT.d.ts.map +1 -1
- package/dist/recognition/AzureCognitiveServicesSTT.js +4 -4
- package/dist/recognition/AzureCognitiveServicesSTT.js.map +1 -1
- package/dist/recognition/DeepgramSTT.d.ts +2 -1
- package/dist/recognition/DeepgramSTT.d.ts.map +1 -1
- package/dist/recognition/DeepgramSTT.js +12 -13
- package/dist/recognition/DeepgramSTT.js.map +1 -1
- package/dist/recognition/GoogleCloudSTT.d.ts +2 -1
- package/dist/recognition/GoogleCloudSTT.d.ts.map +1 -1
- package/dist/recognition/GoogleCloudSTT.js +11 -10
- package/dist/recognition/GoogleCloudSTT.js.map +1 -1
- package/dist/recognition/OpenAICloudSTT.d.ts +2 -1
- package/dist/recognition/OpenAICloudSTT.d.ts.map +1 -1
- 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 -16
- 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 +72 -85
- package/dist/recognition/WhisperSTT.d.ts.map +1 -1
- package/dist/recognition/WhisperSTT.js +384 -519
- package/dist/recognition/WhisperSTT.js.map +1 -1
- package/dist/server/Client.d.ts +2 -2
- package/dist/server/Client.d.ts.map +1 -1
- package/dist/server/Client.js.map +1 -1
- package/dist/server/Worker.d.ts +6 -7
- package/dist/server/Worker.d.ts.map +1 -1
- package/dist/server/Worker.js +42 -44
- package/dist/server/Worker.js.map +1 -1
- package/dist/source-separation/MDXNetSourceSeparation.d.ts +3 -2
- package/dist/source-separation/MDXNetSourceSeparation.d.ts.map +1 -1
- package/dist/source-separation/MDXNetSourceSeparation.js +10 -8
- package/dist/source-separation/MDXNetSourceSeparation.js.map +1 -1
- package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.d.ts +3 -2
- package/dist/speech-embeddings/WavToVec2BertFeatureEmbeddings.d.ts.map +1 -1
- 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 +5 -3
- package/dist/speech-language-detection/SileroLanguageDetection.d.ts.map +1 -1
- 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 +2 -1
- package/dist/speech-search/DTWSpeechSearch.d.ts.map +1 -1
- package/dist/speech-search/DTWSpeechSearch.js +4 -4
- package/dist/speech-search/DTWSpeechSearch.js.map +1 -1
- package/dist/subtitles/Subtitles.d.ts +13 -1
- package/dist/subtitles/Subtitles.d.ts.map +1 -1
- package/dist/subtitles/Subtitles.js +22 -22
- package/dist/subtitles/Subtitles.js.map +1 -1
- package/dist/synthesis/AwsPollyTTS.d.ts +3 -2
- package/dist/synthesis/AwsPollyTTS.d.ts.map +1 -1
- package/dist/synthesis/AwsPollyTTS.js +5 -5
- package/dist/synthesis/AwsPollyTTS.js.map +1 -1
- package/dist/synthesis/AzureCognitiveServicesTTS.d.ts +2 -1
- package/dist/synthesis/AzureCognitiveServicesTTS.d.ts.map +1 -1
- package/dist/synthesis/AzureCognitiveServicesTTS.js +3 -3
- package/dist/synthesis/AzureCognitiveServicesTTS.js.map +1 -1
- package/dist/synthesis/CoquiServerTTS.d.ts +2 -1
- package/dist/synthesis/CoquiServerTTS.d.ts.map +1 -1
- package/dist/synthesis/CoquiServerTTS.js +7 -8
- package/dist/synthesis/CoquiServerTTS.js.map +1 -1
- package/dist/synthesis/DeepgramTTS.d.ts +2 -2
- package/dist/synthesis/DeepgramTTS.d.ts.map +1 -1
- package/dist/synthesis/DeepgramTTS.js +13 -13
- package/dist/synthesis/DeepgramTTS.js.map +1 -1
- package/dist/synthesis/ElevenLabsTTS.d.ts +3 -3
- package/dist/synthesis/ElevenLabsTTS.d.ts.map +1 -1
- package/dist/synthesis/ElevenLabsTTS.js +22 -21
- package/dist/synthesis/ElevenLabsTTS.js.map +1 -1
- package/dist/synthesis/EspeakTTS.d.ts +11 -9
- package/dist/synthesis/EspeakTTS.d.ts.map +1 -1
- package/dist/synthesis/EspeakTTS.js +118 -68
- package/dist/synthesis/EspeakTTS.js.map +1 -1
- package/dist/synthesis/FliteTTS.d.ts +2 -2
- package/dist/synthesis/FliteTTS.d.ts.map +1 -1
- package/dist/synthesis/FliteTTS.js +2 -2
- package/dist/synthesis/FliteTTS.js.map +1 -1
- package/dist/synthesis/GnuSpeechTTS.d.ts +2 -2
- package/dist/synthesis/GnuSpeechTTS.d.ts.map +1 -1
- package/dist/synthesis/GnuSpeechTTS.js +1 -1
- package/dist/synthesis/GnuSpeechTTS.js.map +1 -1
- package/dist/synthesis/GoogleCloudTTS.d.ts +3 -2
- package/dist/synthesis/GoogleCloudTTS.d.ts.map +1 -1
- package/dist/synthesis/GoogleCloudTTS.js +15 -14
- package/dist/synthesis/GoogleCloudTTS.js.map +1 -1
- package/dist/synthesis/GoogleTranslateTTS.d.ts +3 -2
- package/dist/synthesis/GoogleTranslateTTS.d.ts.map +1 -1
- package/dist/synthesis/GoogleTranslateTTS.js +11 -11
- package/dist/synthesis/GoogleTranslateTTS.js.map +1 -1
- package/dist/synthesis/KokoroTTS.d.ts +4 -4
- package/dist/synthesis/KokoroTTS.d.ts.map +1 -1
- package/dist/synthesis/KokoroTTS.js +11 -10
- package/dist/synthesis/KokoroTTS.js.map +1 -1
- package/dist/synthesis/MicrosoftEdgeTTS.d.ts +4 -3
- package/dist/synthesis/MicrosoftEdgeTTS.d.ts.map +1 -1
- package/dist/synthesis/MicrosoftEdgeTTS.js +41 -20
- package/dist/synthesis/MicrosoftEdgeTTS.js.map +1 -1
- package/dist/synthesis/OpenAICloudTTS.d.ts +2 -2
- package/dist/synthesis/OpenAICloudTTS.d.ts.map +1 -1
- package/dist/synthesis/OpenAICloudTTS.js +6 -5
- package/dist/synthesis/OpenAICloudTTS.js.map +1 -1
- package/dist/synthesis/SamTTS.d.ts +2 -1
- package/dist/synthesis/SamTTS.d.ts.map +1 -1
- package/dist/synthesis/SamTTS.js +2 -2
- package/dist/synthesis/SamTTS.js.map +1 -1
- package/dist/synthesis/SapiTTS.d.ts +2 -2
- package/dist/synthesis/SapiTTS.d.ts.map +1 -1
- package/dist/synthesis/SapiTTS.js +2 -2
- package/dist/synthesis/SapiTTS.js.map +1 -1
- package/dist/synthesis/SvoxPicoTTS.d.ts +2 -2
- package/dist/synthesis/SvoxPicoTTS.d.ts.map +1 -1
- package/dist/synthesis/SvoxPicoTTS.js +3 -3
- package/dist/synthesis/SvoxPicoTTS.js.map +1 -1
- package/dist/synthesis/VitsTTS.d.ts +3 -3
- package/dist/synthesis/VitsTTS.d.ts.map +1 -1
- package/dist/synthesis/VitsTTS.js +14 -11
- package/dist/synthesis/VitsTTS.js.map +1 -1
- package/dist/text-translation/DeepLTextTranslation.d.ts +2 -2
- package/dist/text-translation/DeepLTextTranslation.d.ts.map +1 -1
- package/dist/text-translation/DeepLTextTranslation.js +10 -9
- package/dist/text-translation/DeepLTextTranslation.js.map +1 -1
- package/dist/text-translation/GoogleTranslateTextTranslation.d.ts +4 -4
- package/dist/text-translation/GoogleTranslateTextTranslation.d.ts.map +1 -1
- package/dist/text-translation/GoogleTranslateTextTranslation.js +20 -18
- package/dist/text-translation/GoogleTranslateTextTranslation.js.map +1 -1
- package/dist/text-translation/NLLBTextTranslation.d.ts +2 -2
- package/dist/text-translation/NLLBTextTranslation.d.ts.map +1 -1
- package/dist/text-translation/NLLBTextTranslation.js +4 -6
- package/dist/text-translation/NLLBTextTranslation.js.map +1 -1
- package/dist/typings/TypedArray.d.ts.map +1 -1
- package/dist/utilities/Compression.d.ts +4 -3
- package/dist/utilities/Compression.d.ts.map +1 -1
- package/dist/utilities/Compression.js +9 -9
- package/dist/utilities/Compression.js.map +1 -1
- package/dist/utilities/FileDownloader.d.ts +6 -3
- package/dist/utilities/FileDownloader.d.ts.map +1 -1
- package/dist/utilities/FileDownloader.js +25 -21
- package/dist/utilities/FileDownloader.js.map +1 -1
- package/dist/utilities/FileReader.d.ts.map +1 -1
- package/dist/utilities/FileReader.js.map +1 -1
- package/dist/utilities/FileSystem.js +1 -1
- package/dist/utilities/FileSystem.js.map +1 -1
- package/dist/utilities/FileWriter.d.ts.map +1 -1
- package/dist/utilities/FileWriter.js.map +1 -1
- package/dist/utilities/Hashing.d.ts.map +1 -1
- package/dist/utilities/Hashing.js.map +1 -1
- package/dist/utilities/Locale.js.map +1 -1
- package/dist/utilities/Logger.d.ts +17 -9
- package/dist/utilities/Logger.d.ts.map +1 -1
- package/dist/utilities/Logger.js +50 -35
- package/dist/utilities/Logger.js.map +1 -1
- package/dist/utilities/NpmUtilities.d.ts.map +1 -1
- package/dist/utilities/NpmUtilities.js +4 -5
- package/dist/utilities/NpmUtilities.js.map +1 -1
- package/dist/utilities/ObjectUtilities.js.map +1 -1
- package/dist/utilities/OpenPromise.d.ts.map +1 -1
- package/dist/utilities/OpenPromise.js.map +1 -1
- package/dist/utilities/PackageManager.d.ts +4 -1
- package/dist/utilities/PackageManager.d.ts.map +1 -1
- package/dist/utilities/PackageManager.js +37 -22
- package/dist/utilities/PackageManager.js.map +1 -1
- package/dist/utilities/PathUtilities.d.ts +2 -0
- package/dist/utilities/PathUtilities.d.ts.map +1 -1
- package/dist/utilities/PathUtilities.js +5 -2
- package/dist/utilities/PathUtilities.js.map +1 -1
- package/dist/utilities/RandomGenerator.d.ts.map +1 -1
- package/dist/utilities/SignalChannel.d.ts.map +1 -1
- package/dist/utilities/SmoothEstimator.d.ts.map +1 -1
- package/dist/utilities/SmoothEstimator.js.map +1 -1
- package/dist/utilities/StringBuilder.d.ts.map +1 -1
- package/dist/utilities/TarballMaker.d.ts +4 -3
- package/dist/utilities/TarballMaker.d.ts.map +1 -1
- package/dist/utilities/TarballMaker.js +6 -6
- package/dist/utilities/TarballMaker.js.map +1 -1
- package/dist/utilities/Timeline.js.map +1 -1
- package/dist/utilities/Timer.d.ts.map +1 -1
- package/dist/utilities/Utilities.d.ts +9 -7
- package/dist/utilities/Utilities.d.ts.map +1 -1
- package/dist/utilities/Utilities.js +49 -33
- package/dist/utilities/Utilities.js.map +1 -1
- package/dist/utilities/VirtualFileReadStream.d.ts.map +1 -1
- package/dist/utilities/WebReader.d.ts +2 -1
- package/dist/utilities/WebReader.d.ts.map +1 -1
- package/dist/utilities/WebReader.js +7 -6
- package/dist/utilities/WebReader.js.map +1 -1
- package/dist/utilities/WikipediaReader.d.ts +2 -1
- package/dist/utilities/WikipediaReader.d.ts.map +1 -1
- package/dist/utilities/WikipediaReader.js +1 -5
- package/dist/utilities/WikipediaReader.js.map +1 -1
- package/dist/voice-activity-detection/AdaptiveGateVAD.d.ts +2 -1
- package/dist/voice-activity-detection/AdaptiveGateVAD.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/voice-activity-detection/SileroVAD.js.map +1 -1
- package/dist/voice-activity-detection/WebRtcVAD.d.ts.map +1 -1
- 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 -41
- 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 -54
- package/dist/audio/AudioRecorder.d.ts +0 -4
- package/dist/audio/AudioRecorder.d.ts.map +0 -1
- package/dist/audio/AudioRecorder.js +0 -68
- package/dist/audio/AudioRecorder.js.map +0 -1
- package/dist/audio/SoxPath.d.ts +0 -2
- package/dist/audio/SoxPath.d.ts.map +0 -1
- package/dist/audio/SoxPath.js +0 -24
- package/dist/audio/SoxPath.js.map +0 -1
- package/dist/recognition/SileroSTT.d.ts +0 -30
- package/dist/recognition/SileroSTT.d.ts.map +0 -1
- package/dist/recognition/SileroSTT.js +0 -152
- package/dist/recognition/SileroSTT.js.map +0 -1
- package/dist/recognition/VoskSTT.d.ts +0 -11
- package/dist/recognition/VoskSTT.d.ts.map +0 -1
- package/dist/recognition/VoskSTT.js +0 -72
- package/dist/recognition/VoskSTT.js.map +0 -1
- package/dist/recognition/WhisperCppSTT.d.ts.map +0 -1
- package/dist/recognition/WhisperCppSTT.js.map +0 -1
- package/dist/synthesis/StreamlabsPollyTTS.d.ts +0 -12
- package/dist/synthesis/StreamlabsPollyTTS.d.ts.map +0 -1
- package/dist/synthesis/StreamlabsPollyTTS.js +0 -88
- package/dist/synthesis/StreamlabsPollyTTS.js.map +0 -1
- package/dist/utilities/BinaryUtilities.d.ts +0 -14
- package/dist/utilities/BinaryUtilities.d.ts.map +0 -1
- 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,25 +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
|
-
const JSON5 = json5Module.default ?? json5Module
|
|
163
|
-
|
|
164
|
-
return JSON5.parse(jsonText)
|
|
150
|
+
return parseJSON5(jsonText)
|
|
165
151
|
} else {
|
|
166
152
|
return JSON.parse(jsonText)
|
|
167
153
|
}
|
|
168
154
|
}
|
|
169
155
|
|
|
170
|
-
export
|
|
156
|
+
export function stringifyAndFormatJson(obj: any, useJson5 = false) {
|
|
171
157
|
let textContent: string
|
|
172
158
|
|
|
173
159
|
if (useJson5) {
|
|
174
|
-
|
|
175
|
-
const JSON5 = json5Module.default ?? json5Module
|
|
176
|
-
|
|
177
|
-
textContent = JSON5.stringify(obj, undefined, 4)
|
|
160
|
+
textContent = stringifyJSON5(obj, undefined, 4)
|
|
178
161
|
} else {
|
|
179
162
|
textContent = JSON.stringify(obj, undefined, 4)
|
|
180
163
|
}
|
|
@@ -182,11 +165,11 @@ export async function stringifyAndFormatJson(obj: any, useJson5 = false) {
|
|
|
182
165
|
return textContent
|
|
183
166
|
}
|
|
184
167
|
|
|
185
|
-
export
|
|
168
|
+
export function parseJSONAndGetType(str: string, useJson5 = false) {
|
|
186
169
|
let parsedValue: any = undefined
|
|
187
170
|
|
|
188
171
|
try {
|
|
189
|
-
parsedValue =
|
|
172
|
+
parsedValue = parseJson(str, useJson5)
|
|
190
173
|
} catch (e) {
|
|
191
174
|
}
|
|
192
175
|
|
|
@@ -212,7 +195,6 @@ export async function parseJSONAndGetType(str: string, useJson5 = false) {
|
|
|
212
195
|
}
|
|
213
196
|
}
|
|
214
197
|
|
|
215
|
-
|
|
216
198
|
export function secondsToHMS(totalSeconds: number) {
|
|
217
199
|
let remainingSeconds = totalSeconds
|
|
218
200
|
|
|
@@ -430,12 +412,13 @@ export async function resolveModuleScriptPath(moduleName: string) {
|
|
|
430
412
|
|
|
431
413
|
export async function runOperationWithRetries<R>(
|
|
432
414
|
operationFunc: () => Promise<R>,
|
|
433
|
-
logger: Logger,
|
|
434
415
|
operationName = 'Operation',
|
|
416
|
+
callbacks: OperationCallbacks,
|
|
435
417
|
delayBetweenRetries = 2000,
|
|
436
|
-
maxRetries = 200
|
|
418
|
+
maxRetries = 200,
|
|
419
|
+
errorFilter?: (e: any) => boolean) {
|
|
437
420
|
|
|
438
|
-
const
|
|
421
|
+
const logger = new Logger(callbacks.logLevel)
|
|
439
422
|
|
|
440
423
|
for (let retryIndex = 1; retryIndex <= maxRetries; retryIndex++) {
|
|
441
424
|
try {
|
|
@@ -443,25 +426,19 @@ export async function runOperationWithRetries<R>(
|
|
|
443
426
|
|
|
444
427
|
return result
|
|
445
428
|
} catch (e: any) {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
if (shouldCancelCurrentTask()) {
|
|
449
|
-
throw new Error('Canceled')
|
|
429
|
+
if (errorFilter && errorFilter(e) === false) {
|
|
430
|
+
throw e
|
|
450
431
|
}
|
|
451
432
|
|
|
452
|
-
logger.
|
|
453
|
-
|
|
454
|
-
logger.logTitledMessage(`Error`, e.message, chalk.redBright, 'error')
|
|
433
|
+
logger.logTitledMessage(`Error`, e.message, 'error')
|
|
455
434
|
logger.log('', 'error')
|
|
456
|
-
logger.logTitledMessage(`${operationName} failed`, `Trying again in ${delayBetweenRetries}ms..`,
|
|
435
|
+
logger.logTitledMessage(`${operationName} failed`, `Trying again in ${delayBetweenRetries}ms..`, 'error')
|
|
457
436
|
|
|
458
437
|
await sleep(delayBetweenRetries)
|
|
459
438
|
|
|
460
439
|
logger.log(``, 'warning')
|
|
461
|
-
logger.logTitledMessage(`Starting retry attempt`, `${retryIndex} / ${maxRetries}`,
|
|
440
|
+
logger.logTitledMessage(`Starting retry attempt`, `${retryIndex} / ${maxRetries}`, 'warning')
|
|
462
441
|
logger.log(``, 'warning')
|
|
463
|
-
|
|
464
|
-
logger.unsetAsActiveLogger()
|
|
465
442
|
}
|
|
466
443
|
}
|
|
467
444
|
|
|
@@ -590,3 +567,43 @@ export function getTopKIndexes(values: ArrayLike<number>, topCount: number, sort
|
|
|
590
567
|
|
|
591
568
|
return topKIndexes
|
|
592
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
|
package/tsconfig.json
CHANGED
|
@@ -1,56 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
2
|
+
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
// File Layout
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
|
|
8
|
+
// Environment Settings
|
|
9
|
+
// See also https://aka.ms/tsconfig/module
|
|
10
|
+
"module": "nodenext",
|
|
11
|
+
"target": "esnext",
|
|
12
|
+
"types": ["node"],
|
|
13
|
+
// For nodejs:
|
|
14
|
+
// "lib": ["esnext"],
|
|
15
|
+
// "types": ["node"],
|
|
16
|
+
// and npm install -D @types/node
|
|
17
|
+
|
|
18
|
+
// Other Outputs
|
|
19
|
+
"sourceMap": true,
|
|
20
|
+
"declaration": true,
|
|
21
|
+
"declarationMap": true,
|
|
22
|
+
|
|
23
|
+
// Stricter Typechecking Options
|
|
24
|
+
// "noUncheckedIndexedAccess": true,
|
|
25
|
+
// "exactOptionalPropertyTypes": true,
|
|
26
|
+
|
|
27
|
+
// Style Options
|
|
28
|
+
"noImplicitReturns": true,
|
|
29
|
+
// "noImplicitOverride": true,
|
|
30
|
+
// "noUnusedLocals": true,
|
|
31
|
+
// "noUnusedParameters": true,
|
|
32
|
+
// "noFallthroughCasesInSwitch": true,
|
|
33
|
+
// "noPropertyAccessFromIndexSignature": true,
|
|
34
|
+
|
|
35
|
+
// Recommended Options
|
|
36
|
+
"strict": true,
|
|
37
|
+
"jsx": "react-jsx",
|
|
38
|
+
// "verbatimModuleSyntax": true,
|
|
39
|
+
"isolatedModules": true,
|
|
40
|
+
"noUncheckedSideEffectImports": true,
|
|
41
|
+
"moduleDetection": "force",
|
|
42
|
+
"skipLibCheck": true,
|
|
43
|
+
|
|
44
|
+
// Extended options not in generated tsconfig.json
|
|
45
|
+
"newLine": "lf",
|
|
46
|
+
"forceConsistentCasingInFileNames": true,
|
|
47
|
+
"alwaysStrict": true,
|
|
48
|
+
|
|
49
|
+
"noImplicitThis": true,
|
|
50
|
+
"strictBindCallApply": true,
|
|
51
|
+
"strictFunctionTypes": true,
|
|
52
|
+
|
|
53
|
+
"noErrorTruncation": true,
|
|
54
|
+
}
|
|
56
55
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { RawAudio } from './AudioUtilities.js';
|
|
2
|
-
export declare function recordAudioInput(channelCount?: number, sampleRate?: number, maxTime?: number): Promise<RawAudio>;
|
|
3
|
-
export declare function captureAudioInput(channelCount?: number, sampleRate?: number, maxTime?: number, onAudioSamples?: (rawAudio: Float32Array[]) => void): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=AudioRecorder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AudioRecorder.d.ts","sourceRoot":"","sources":["../../src/audio/AudioRecorder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAuB,MAAM,qBAAqB,CAAA;AAWnE,wBAAsB,gBAAgB,CAAC,YAAY,SAAI,EAAE,UAAU,SAAQ,EAAE,OAAO,SAAK,qBAexF;AAED,wBAAgB,iBAAiB,CAAC,YAAY,SAAI,EAAE,UAAU,SAAQ,EAAE,OAAO,SAAK,EAAE,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,IAAI,iBA4DxI"}
|