echogarden 2.10.2 → 3.0.1
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 +129 -71
- 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 +158 -71
- 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
package/src/api/Synthesis.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import chalk from 'chalk'
|
|
2
|
+
|
|
3
|
+
import * as API from './API.js'
|
|
4
|
+
|
|
1
5
|
import { deepClone, extendDeep } from '../utilities/ObjectUtilities.js'
|
|
2
6
|
|
|
3
7
|
import * as FFMpegTranscoder from '../codecs/FFMpegTranscoder.js'
|
|
4
8
|
|
|
5
|
-
import { clip, sha256AsHex, stringifyAndFormatJson,
|
|
9
|
+
import { clip, sha256AsHex, stringifyAndFormatJson, yieldToEventLoop, runOperationWithRetries } from '../utilities/Utilities.js'
|
|
6
10
|
import { RawAudio, concatAudioSegments, downmixToMono, encodeRawAudioToWave, getSamplePeakDecibels, getEmptyRawAudio, getRawAudioDuration, trimAudioEnd, trimAudioStart, attenuateIfClippingInPlace, normalizeAudioLevelInPlace } from '../audio/AudioUtilities.js'
|
|
7
11
|
import { Logger } from '../utilities/Logger.js'
|
|
8
12
|
|
|
@@ -10,14 +14,11 @@ import { isWordOrSymbolWord, parseText, splitToParagraphs } from '../nlp/Segment
|
|
|
10
14
|
import { type RubberbandOptions } from '../dsp/Rubberband.js'
|
|
11
15
|
import { loadLexiconsForLanguage } from '../nlp/Lexicon.js'
|
|
12
16
|
|
|
13
|
-
import * as API from './API.js'
|
|
14
17
|
import { Timeline, TimelineEntry, addTimeOffsetToTimeline, multiplyTimelineByFactor } from '../utilities/Timeline.js'
|
|
15
18
|
import { getAppDataDir, ensureDir, existsSync, isFileIsUpToDate, readAndParseJsonFile, writeFileSafe } from '../utilities/FileSystem.js'
|
|
16
|
-
import { formatLanguageCodeWithName, getShortLanguageCode, normalizeLanguageCode, defaultDialectForLanguageCode,
|
|
19
|
+
import { formatLanguageCodeWithName, getShortLanguageCode, normalizeLanguageCode, defaultDialectForLanguageCode, normalizeIdentifierToLanguageCode } from '../utilities/Locale.js'
|
|
17
20
|
import { loadPackage } from '../utilities/PackageManager.js'
|
|
18
21
|
import { EngineMetadata, appName } from './Common.js'
|
|
19
|
-
import { shouldCancelCurrentTask } from '../server/Worker.js'
|
|
20
|
-
import chalk from 'chalk'
|
|
21
22
|
import { type SubtitlesConfig } from '../subtitles/Subtitles.js'
|
|
22
23
|
import { type EspeakOptions } from '../synthesis/EspeakTTS.js'
|
|
23
24
|
import { type OpenAICloudTTSOptions } from '../synthesis/OpenAICloudTTS.js'
|
|
@@ -29,12 +30,10 @@ import { convertHtmlToText } from '../utilities/StringUtilities.js'
|
|
|
29
30
|
import { joinPath, resolvePath } from '../utilities/PathUtilities.js'
|
|
30
31
|
import { Timer } from '../utilities/Timer.js'
|
|
31
32
|
|
|
32
|
-
const log = logToStderr
|
|
33
|
-
|
|
34
33
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
35
34
|
// Synthesis
|
|
36
35
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
37
|
-
export async function synthesize(input: string | string[], options: SynthesisOptions,
|
|
36
|
+
export async function synthesize(input: string | string[], options: SynthesisOptions, callbacks?: SynthesisCallbacks): Promise<SynthesisResult> {
|
|
38
37
|
options = extendDeep(defaultSynthesisOptions, options)
|
|
39
38
|
|
|
40
39
|
let segments: string[]
|
|
@@ -49,12 +48,14 @@ export async function synthesize(input: string | string[], options: SynthesisOpt
|
|
|
49
48
|
segments = splitToParagraphs(input, plainTextOptions.paragraphBreaks!, plainTextOptions.whitespace!)
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
return synthesizeSegments(segments, options,
|
|
51
|
+
return synthesizeSegments(segments, options, callbacks)
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
async function synthesizeSegments(segments: string[], options: SynthesisOptions,
|
|
56
|
-
const logger = new Logger()
|
|
54
|
+
async function synthesizeSegments(segments: string[], options: SynthesisOptions, callbacks?: SynthesisCallbacks): Promise<SynthesisResult> {
|
|
57
55
|
options = extendDeep(defaultSynthesisOptions, options)
|
|
56
|
+
callbacks = { logLevel: API.getGlobalLogLevel(), ...callbacks }
|
|
57
|
+
|
|
58
|
+
const logger = new Logger(callbacks.logLevel)
|
|
58
59
|
|
|
59
60
|
const totalSynthesisTimeTimer = new Timer()
|
|
60
61
|
|
|
@@ -71,7 +72,10 @@ async function synthesizeSegments(segments: string[], options: SynthesisOptions,
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
const { detectedLanguage } = await API.detectTextLanguage(
|
|
75
|
+
const { detectedLanguage } = await API.detectTextLanguage(
|
|
76
|
+
segmentsPlainText.join('\n\n'),
|
|
77
|
+
options.languageDetection!,
|
|
78
|
+
{ abortSignal: callbacks.abortSignal, logLevel: 'warning' })
|
|
75
79
|
|
|
76
80
|
options.language = detectedLanguage
|
|
77
81
|
|
|
@@ -91,7 +95,10 @@ async function synthesizeSegments(segments: string[], options: SynthesisOptions,
|
|
|
91
95
|
|
|
92
96
|
logger.start(`Get voice list for ${options.engine}`)
|
|
93
97
|
|
|
94
|
-
const { bestMatchingVoice } = await requestVoiceList(
|
|
98
|
+
const { bestMatchingVoice } = await requestVoiceList(
|
|
99
|
+
options,
|
|
100
|
+
{ ...callbacks, logLevel: 'warning' }
|
|
101
|
+
)
|
|
95
102
|
|
|
96
103
|
if (!bestMatchingVoice) {
|
|
97
104
|
throw new Error('No matching voice found')
|
|
@@ -116,6 +123,8 @@ async function synthesizeSegments(segments: string[], options: SynthesisOptions,
|
|
|
116
123
|
let timeOffset = 0
|
|
117
124
|
|
|
118
125
|
for (let segmentIndex = 0; segmentIndex < segments.length; segmentIndex++) {
|
|
126
|
+
callbacks?.abortSignal?.throwIfAborted()
|
|
127
|
+
|
|
119
128
|
const segmentText = segments[segmentIndex]
|
|
120
129
|
|
|
121
130
|
logger.log(`\n${chalk.magentaBright(`Synthesizing segment ${segmentIndex + 1}/${segments.length}`)}: '${segmentText.trim()}'`)
|
|
@@ -147,23 +156,24 @@ async function synthesizeSegments(segments: string[], options: SynthesisOptions,
|
|
|
147
156
|
const sentencesTimelines: Timeline[] = []
|
|
148
157
|
|
|
149
158
|
for (let sentenceIndex = 0; sentenceIndex < sentences.length; sentenceIndex++) {
|
|
150
|
-
|
|
159
|
+
callbacks?.abortSignal?.throwIfAborted()
|
|
151
160
|
|
|
152
|
-
|
|
153
|
-
//log('\n\n\n\n\nCANCELED\n\n\n\n')
|
|
154
|
-
throw new Error('Canceled')
|
|
155
|
-
}
|
|
161
|
+
await yieldToEventLoop()
|
|
156
162
|
|
|
157
163
|
const sentenceText = sentences[sentenceIndex]
|
|
158
164
|
|
|
159
|
-
logger.log(`\n${chalk.magentaBright(`Synthesizing sentence ${sentenceIndex + 1}/${sentences.length}`)}:
|
|
165
|
+
logger.log(`\n${chalk.magentaBright(`Synthesizing sentence ${sentenceIndex + 1}/${sentences.length}`)}: '${sentenceText.trim()}'`)
|
|
160
166
|
|
|
161
167
|
const sentenceStartTime = timeOffset
|
|
162
168
|
|
|
163
169
|
let sentenceSynthesisOptions: SynthesisOptions = { postProcessing: { normalizeAudio: false } }
|
|
164
170
|
sentenceSynthesisOptions = extendDeep(options, sentenceSynthesisOptions)
|
|
165
171
|
|
|
166
|
-
const { synthesizedAudio: sentenceRawAudio, timeline: sentenceTimeline } = await synthesizeSegment(
|
|
172
|
+
const { synthesizedAudio: sentenceRawAudio, timeline: sentenceTimeline } = await synthesizeSegment(
|
|
173
|
+
sentenceText,
|
|
174
|
+
sentenceSynthesisOptions,
|
|
175
|
+
callbacks
|
|
176
|
+
)
|
|
167
177
|
|
|
168
178
|
const endPause = sentenceIndex == sentences.length - 1 ? options.segmentEndPause! : options.sentenceEndPause!
|
|
169
179
|
sentenceRawAudio.audioChannels[0] = trimAudioEnd(sentenceRawAudio.audioChannels[0], endPause * sentenceRawAudio.sampleRate)
|
|
@@ -194,8 +204,8 @@ async function synthesizeSegments(segments: string[], options: SynthesisOptions,
|
|
|
194
204
|
|
|
195
205
|
const sentenceAudio = await convertToTargetCodecIfNeeded(sentenceRawAudio)
|
|
196
206
|
|
|
197
|
-
if (onSentence) {
|
|
198
|
-
await onSentence({
|
|
207
|
+
if (callbacks?.onSentence) {
|
|
208
|
+
await callbacks.onSentence({
|
|
199
209
|
index: sentenceIndex,
|
|
200
210
|
total: sentences.length,
|
|
201
211
|
audio: sentenceAudio,
|
|
@@ -232,8 +242,8 @@ async function synthesizeSegments(segments: string[], options: SynthesisOptions,
|
|
|
232
242
|
|
|
233
243
|
logger.end()
|
|
234
244
|
|
|
235
|
-
if (onSegment) {
|
|
236
|
-
await onSegment({
|
|
245
|
+
if (callbacks?.onSegment) {
|
|
246
|
+
await callbacks.onSegment({
|
|
237
247
|
index: segmentIndex,
|
|
238
248
|
total: segments.length,
|
|
239
249
|
audio: segmentAudio,
|
|
@@ -273,7 +283,7 @@ async function synthesizeSegments(segments: string[], options: SynthesisOptions,
|
|
|
273
283
|
output = encodeRawAudioToWave(rawAudio)
|
|
274
284
|
} else {
|
|
275
285
|
const ffmpegOptions = FFMpegTranscoder.getDefaultFFMpegOptionsForSpeech(targetCodec, options.outputAudioFormat?.bitrate)
|
|
276
|
-
output = await FFMpegTranscoder.encodeFromChannels(rawAudio, ffmpegOptions)
|
|
286
|
+
output = await FFMpegTranscoder.encodeFromChannels(rawAudio, ffmpegOptions, callbacks!)
|
|
277
287
|
}
|
|
278
288
|
} else {
|
|
279
289
|
output = rawAudio
|
|
@@ -286,7 +296,7 @@ async function synthesizeSegments(segments: string[], options: SynthesisOptions,
|
|
|
286
296
|
|
|
287
297
|
logger.end()
|
|
288
298
|
|
|
289
|
-
logger.logTitledMessage('Total synthesis time', `${totalSynthesisTimeTimer.elapsedTime.toFixed(1)}ms`, chalk.magentaBright)
|
|
299
|
+
logger.logTitledMessage('Total synthesis time', `${totalSynthesisTimeTimer.elapsedTime.toFixed(1)}ms`, 'info', chalk.magentaBright)
|
|
290
300
|
|
|
291
301
|
return {
|
|
292
302
|
audio: resultAudio,
|
|
@@ -303,8 +313,10 @@ export interface SynthesisResult {
|
|
|
303
313
|
voice: string
|
|
304
314
|
}
|
|
305
315
|
|
|
306
|
-
async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
307
|
-
|
|
316
|
+
async function synthesizeSegment(text: string, options: SynthesisOptions, callbacks?: SynthesisCallbacks) {
|
|
317
|
+
callbacks = { logLevel: API.getGlobalLogLevel(), ...callbacks }
|
|
318
|
+
|
|
319
|
+
const logger = new Logger(callbacks.logLevel)
|
|
308
320
|
|
|
309
321
|
const startTimestamp = logger.getTimestamp()
|
|
310
322
|
|
|
@@ -316,7 +328,9 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
316
328
|
|
|
317
329
|
logger.start(`Get voice list for ${engine}`)
|
|
318
330
|
|
|
319
|
-
const { bestMatchingVoice } = await requestVoiceList(
|
|
331
|
+
const { bestMatchingVoice } = await requestVoiceList(
|
|
332
|
+
options,
|
|
333
|
+
{ ...callbacks, logLevel: 'warning' })
|
|
320
334
|
|
|
321
335
|
if (!bestMatchingVoice) {
|
|
322
336
|
throw new Error('No matching voice found')
|
|
@@ -329,7 +343,7 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
329
343
|
if (selectedVoice.packageName) {
|
|
330
344
|
logger.end()
|
|
331
345
|
|
|
332
|
-
voicePackagePath = await loadPackage(selectedVoice.packageName)
|
|
346
|
+
voicePackagePath = await loadPackage(selectedVoice.packageName, callbacks)
|
|
333
347
|
}
|
|
334
348
|
|
|
335
349
|
logger.start(`Initialize ${engine} module`)
|
|
@@ -403,7 +417,9 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
403
417
|
lengthScale,
|
|
404
418
|
speakerId ?? 0,
|
|
405
419
|
lexicons,
|
|
406
|
-
onnxExecutionProviders
|
|
420
|
+
onnxExecutionProviders,
|
|
421
|
+
callbacks,
|
|
422
|
+
)
|
|
407
423
|
|
|
408
424
|
synthesizedAudio = rawAudio
|
|
409
425
|
timeline = outTimeline
|
|
@@ -429,8 +445,8 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
429
445
|
const modelName = kokoroOptions.model!
|
|
430
446
|
const modelPackageName = `kokoro-${modelName}`
|
|
431
447
|
|
|
432
|
-
const modelPath = await loadPackage(modelPackageName)
|
|
433
|
-
const voicesPath = await loadPackage('kokoro-82m-v1.0-voices')
|
|
448
|
+
const modelPath = await loadPackage(modelPackageName, callbacks)
|
|
449
|
+
const voicesPath = await loadPackage('kokoro-82m-v1.0-voices', callbacks)
|
|
434
450
|
|
|
435
451
|
logger.end()
|
|
436
452
|
|
|
@@ -443,7 +459,8 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
443
459
|
lexicons,
|
|
444
460
|
modelPath,
|
|
445
461
|
voicesPath,
|
|
446
|
-
onnxExecutionProviders
|
|
462
|
+
onnxExecutionProviders,
|
|
463
|
+
callbacks,
|
|
447
464
|
)
|
|
448
465
|
|
|
449
466
|
synthesizedAudio = rawAudio
|
|
@@ -476,7 +493,13 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
476
493
|
const resourceFilePath = resolvePath(voicePackagePath!, textAnalysisFilename)
|
|
477
494
|
const signalGenerationFilePath = resolvePath(voicePackagePath!, signalGenerationFilename)
|
|
478
495
|
|
|
479
|
-
const { rawAudio } = await SvoxPicoTTS.synthesize(
|
|
496
|
+
const { rawAudio } = await SvoxPicoTTS.synthesize(
|
|
497
|
+
preparedText,
|
|
498
|
+
resourceFilePath,
|
|
499
|
+
signalGenerationFilePath,
|
|
500
|
+
undefined,
|
|
501
|
+
callbacks,
|
|
502
|
+
)
|
|
480
503
|
|
|
481
504
|
synthesizedAudio = rawAudio
|
|
482
505
|
|
|
@@ -492,7 +515,15 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
492
515
|
|
|
493
516
|
logger.end()
|
|
494
517
|
|
|
495
|
-
const { rawAudio, events } = await FliteTTS.synthesize(
|
|
518
|
+
const { rawAudio, events } = await FliteTTS.synthesize(
|
|
519
|
+
simplifiedText,
|
|
520
|
+
voice,
|
|
521
|
+
voicePackagePath,
|
|
522
|
+
speed,
|
|
523
|
+
undefined,
|
|
524
|
+
undefined,
|
|
525
|
+
callbacks,
|
|
526
|
+
)
|
|
496
527
|
|
|
497
528
|
synthesizedAudio = rawAudio
|
|
498
529
|
|
|
@@ -508,8 +539,15 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
508
539
|
|
|
509
540
|
const engineOptions = options.gnuspeech!
|
|
510
541
|
|
|
542
|
+
let defaultGnuSpeechOptions
|
|
543
|
+
|
|
544
|
+
try {
|
|
545
|
+
({ defaultGnuSpeechOptions } = await import('@echogarden/gnuspeech-wasm'))
|
|
546
|
+
} catch {
|
|
547
|
+
throw new Error(`Couldn't load the '@echogarden/gnuspeech-wasm' module. Since Echogarden v3.0.0 it is an optional dependency, due to its GPL-3 license. To enable it, you'll need to install it manually via 'npm install [-g] @echogarden/gnuspeech-wasm'.`)
|
|
548
|
+
}
|
|
549
|
+
|
|
511
550
|
const GnuSpeech = await import('../synthesis/GnuSpeechTTS.js')
|
|
512
|
-
const { defaultGnuSpeechOptions } = await import('@echogarden/gnuspeech-wasm')
|
|
513
551
|
|
|
514
552
|
const gnuSpeechOptions = extendDeep(defaultGnuSpeechOptions, engineOptions)
|
|
515
553
|
|
|
@@ -519,7 +557,7 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
519
557
|
|
|
520
558
|
await logger.startAsync(`Synthesize with Gnuspeech`)
|
|
521
559
|
|
|
522
|
-
const { rawAudio } = await GnuSpeech.synthesize(simplifiedText, gnuSpeechOptions)
|
|
560
|
+
const { rawAudio } = await GnuSpeech.synthesize(simplifiedText, gnuSpeechOptions, callbacks)
|
|
523
561
|
|
|
524
562
|
synthesizedAudio = rawAudio
|
|
525
563
|
|
|
@@ -556,7 +594,7 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
556
594
|
if (inputIsSSML) {
|
|
557
595
|
logger.end()
|
|
558
596
|
|
|
559
|
-
const { rawAudio } = await EspeakTTS.synthesize(text, espeakOptions)
|
|
597
|
+
const { rawAudio } = await EspeakTTS.synthesize(text, espeakOptions, callbacks)
|
|
560
598
|
|
|
561
599
|
synthesizedAudio = rawAudio
|
|
562
600
|
} else {
|
|
@@ -564,7 +602,13 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
564
602
|
|
|
565
603
|
logger.end()
|
|
566
604
|
|
|
567
|
-
const { referenceSynthesizedAudio, referenceTimeline } = await EspeakTTS.preprocessAndSynthesize(
|
|
605
|
+
const { referenceSynthesizedAudio, referenceTimeline } = await EspeakTTS.preprocessAndSynthesize(
|
|
606
|
+
text,
|
|
607
|
+
espeakLanguage,
|
|
608
|
+
espeakOptions,
|
|
609
|
+
lexicons,
|
|
610
|
+
callbacks,
|
|
611
|
+
)
|
|
568
612
|
|
|
569
613
|
synthesizedAudio = referenceSynthesizedAudio
|
|
570
614
|
timeline = referenceTimeline.flatMap(clause => clause.timeline!)
|
|
@@ -589,7 +633,7 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
589
633
|
|
|
590
634
|
logger.end()
|
|
591
635
|
|
|
592
|
-
const { rawAudio } = await SamTTS.synthesize(simplifiedText, samPitch, samSpeed, samMouth, samThroat)
|
|
636
|
+
const { rawAudio } = await SamTTS.synthesize(simplifiedText, samPitch, samSpeed, samMouth, samThroat, callbacks)
|
|
593
637
|
|
|
594
638
|
synthesizedAudio = rawAudio
|
|
595
639
|
|
|
@@ -611,7 +655,13 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
611
655
|
|
|
612
656
|
logger.end()
|
|
613
657
|
|
|
614
|
-
const { rawAudio, timeline: outTimeline } = await SapiTTS.synthesize(
|
|
658
|
+
const { rawAudio, timeline: outTimeline } = await SapiTTS.synthesize(
|
|
659
|
+
text,
|
|
660
|
+
voice,
|
|
661
|
+
sapiRate,
|
|
662
|
+
false,
|
|
663
|
+
callbacks,
|
|
664
|
+
)
|
|
615
665
|
|
|
616
666
|
synthesizedAudio = rawAudio
|
|
617
667
|
timeline = outTimeline
|
|
@@ -637,7 +687,13 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
637
687
|
|
|
638
688
|
logger.end()
|
|
639
689
|
|
|
640
|
-
const { rawAudio, timeline: outTimeline } = await SapiTTS.synthesize(
|
|
690
|
+
const { rawAudio, timeline: outTimeline } = await SapiTTS.synthesize(
|
|
691
|
+
text,
|
|
692
|
+
voice,
|
|
693
|
+
sapiRate,
|
|
694
|
+
true,
|
|
695
|
+
callbacks,
|
|
696
|
+
)
|
|
641
697
|
|
|
642
698
|
synthesizedAudio = rawAudio
|
|
643
699
|
timeline = outTimeline
|
|
@@ -666,7 +722,12 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
666
722
|
|
|
667
723
|
logger.end()
|
|
668
724
|
|
|
669
|
-
const { rawAudio } = await CoquiServerTTS.synthesize(
|
|
725
|
+
const { rawAudio } = await CoquiServerTTS.synthesize(
|
|
726
|
+
simplifiedText,
|
|
727
|
+
speakerId,
|
|
728
|
+
serverUrl,
|
|
729
|
+
callbacks,
|
|
730
|
+
)
|
|
670
731
|
|
|
671
732
|
synthesizedAudio = rawAudio
|
|
672
733
|
|
|
@@ -701,7 +762,19 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
701
762
|
|
|
702
763
|
logger.end()
|
|
703
764
|
|
|
704
|
-
const { rawAudio, timepoints } = await GoogleCloudTTS.synthesize(
|
|
765
|
+
const { rawAudio, timepoints } = await GoogleCloudTTS.synthesize(
|
|
766
|
+
text,
|
|
767
|
+
apiKey,
|
|
768
|
+
language,
|
|
769
|
+
voice,
|
|
770
|
+
speed,
|
|
771
|
+
pitchDeltaSemitones,
|
|
772
|
+
0,
|
|
773
|
+
inputIsSSML,
|
|
774
|
+
undefined,
|
|
775
|
+
undefined,
|
|
776
|
+
callbacks,
|
|
777
|
+
)
|
|
705
778
|
|
|
706
779
|
synthesizedAudio = rawAudio
|
|
707
780
|
|
|
@@ -741,7 +814,17 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
741
814
|
|
|
742
815
|
logger.end()
|
|
743
816
|
|
|
744
|
-
const { rawAudio, timeline: outTimeline } = await AzureCognitiveServicesTTS.synthesize(
|
|
817
|
+
const { rawAudio, timeline: outTimeline } = await AzureCognitiveServicesTTS.synthesize(
|
|
818
|
+
text,
|
|
819
|
+
subscriptionKey,
|
|
820
|
+
serviceRegion,
|
|
821
|
+
language,
|
|
822
|
+
voice,
|
|
823
|
+
inputIsSSML,
|
|
824
|
+
ssmlPitch,
|
|
825
|
+
ssmlRate,
|
|
826
|
+
callbacks,
|
|
827
|
+
)
|
|
745
828
|
|
|
746
829
|
synthesizedAudio = rawAudio
|
|
747
830
|
timeline = outTimeline
|
|
@@ -777,7 +860,18 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
777
860
|
|
|
778
861
|
logger.end()
|
|
779
862
|
|
|
780
|
-
const { rawAudio } = await AwsPollyTTS.synthesize(
|
|
863
|
+
const { rawAudio } = await AwsPollyTTS.synthesize(
|
|
864
|
+
text,
|
|
865
|
+
undefined,
|
|
866
|
+
voice,
|
|
867
|
+
region,
|
|
868
|
+
accessKeyId,
|
|
869
|
+
secretAccessKey,
|
|
870
|
+
pollyEngine,
|
|
871
|
+
inputIsSSML,
|
|
872
|
+
lexiconNames,
|
|
873
|
+
callbacks,
|
|
874
|
+
)
|
|
781
875
|
|
|
782
876
|
synthesizedAudio = rawAudio
|
|
783
877
|
|
|
@@ -798,7 +892,13 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
798
892
|
|
|
799
893
|
logger.end();
|
|
800
894
|
|
|
801
|
-
synthesizedAudio = await OpenAICloudTTS.synthesize(
|
|
895
|
+
synthesizedAudio = await OpenAICloudTTS.synthesize(
|
|
896
|
+
text,
|
|
897
|
+
voice,
|
|
898
|
+
speed,
|
|
899
|
+
openAICloudTTSOptions,
|
|
900
|
+
callbacks,
|
|
901
|
+
)
|
|
802
902
|
|
|
803
903
|
shouldPostprocessSpeed = false
|
|
804
904
|
shouldPostprocessPitch = true
|
|
@@ -823,7 +923,13 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
823
923
|
|
|
824
924
|
logger.end()
|
|
825
925
|
|
|
826
|
-
const { rawAudio, timeline: outTimeline } = await ElevenLabsTTS.synthesize(
|
|
926
|
+
const { rawAudio, timeline: outTimeline } = await ElevenLabsTTS.synthesize(
|
|
927
|
+
text,
|
|
928
|
+
voiceId,
|
|
929
|
+
language,
|
|
930
|
+
engineOptions,
|
|
931
|
+
callbacks,
|
|
932
|
+
)
|
|
827
933
|
|
|
828
934
|
synthesizedAudio = rawAudio
|
|
829
935
|
timeline = outTimeline
|
|
@@ -851,7 +957,12 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
851
957
|
|
|
852
958
|
logger.end()
|
|
853
959
|
|
|
854
|
-
const { rawAudio } = await DeepgramTTS.synthesize(
|
|
960
|
+
const { rawAudio } = await DeepgramTTS.synthesize(
|
|
961
|
+
text,
|
|
962
|
+
modelId,
|
|
963
|
+
engineOptions,
|
|
964
|
+
callbacks,
|
|
965
|
+
)
|
|
855
966
|
|
|
856
967
|
synthesizedAudio = rawAudio
|
|
857
968
|
|
|
@@ -872,15 +983,28 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
872
983
|
|
|
873
984
|
const { rawAudio, timeline: segmentTimeline } =
|
|
874
985
|
await runOperationWithRetries(
|
|
875
|
-
() => GoogleTranslateTTS.synthesizeLongText(
|
|
876
|
-
|
|
986
|
+
() => GoogleTranslateTTS.synthesizeLongText(
|
|
987
|
+
text,
|
|
988
|
+
language,
|
|
989
|
+
options.googleTranslate?.tld,
|
|
990
|
+
options.sentenceEndPause,
|
|
991
|
+
options.segmentEndPause,
|
|
992
|
+
callbacks,
|
|
993
|
+
),
|
|
994
|
+
'Google Translate TTS',
|
|
995
|
+
callbacks)
|
|
877
996
|
|
|
878
997
|
synthesizedAudio = rawAudio
|
|
879
998
|
|
|
880
999
|
logger.start(`Generate word-level timestamps by individually aligning fragments`)
|
|
881
1000
|
const alignmentOptions: API.AlignmentOptions = extendDeep(options.alignment, { language })
|
|
882
1001
|
|
|
883
|
-
timeline = await API.alignSegments(
|
|
1002
|
+
timeline = await API.alignSegments(
|
|
1003
|
+
synthesizedAudio,
|
|
1004
|
+
segmentTimeline,
|
|
1005
|
+
alignmentOptions,
|
|
1006
|
+
{ ...callbacks, logLevel: 'warning' }
|
|
1007
|
+
)
|
|
884
1008
|
|
|
885
1009
|
shouldPostprocessSpeed = true
|
|
886
1010
|
shouldPostprocessPitch = true
|
|
@@ -925,8 +1049,17 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
925
1049
|
|
|
926
1050
|
const { rawAudio, timeline: edgeTimeline } =
|
|
927
1051
|
await runOperationWithRetries(
|
|
928
|
-
() => MicrosoftEdgeTTS.synthesize(
|
|
929
|
-
|
|
1052
|
+
() => MicrosoftEdgeTTS.synthesize(
|
|
1053
|
+
text,
|
|
1054
|
+
trustedClientToken!,
|
|
1055
|
+
voice,
|
|
1056
|
+
ssmlPitch,
|
|
1057
|
+
ssmlRate,
|
|
1058
|
+
undefined,
|
|
1059
|
+
callbacks,
|
|
1060
|
+
),
|
|
1061
|
+
'Microsoft Edge TTS',
|
|
1062
|
+
callbacks)
|
|
930
1063
|
|
|
931
1064
|
synthesizedAudio = rawAudio
|
|
932
1065
|
timeline = edgeTimeline
|
|
@@ -934,30 +1067,6 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
934
1067
|
break
|
|
935
1068
|
}
|
|
936
1069
|
|
|
937
|
-
case 'streamlabs-polly': {
|
|
938
|
-
if (inputIsSSML) {
|
|
939
|
-
throw new Error(`The Streamlabs Polly Engine engine doesn't support SSML inputs`)
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
const StreamlabsPollyTTS = await import('../synthesis/StreamlabsPollyTTS.js')
|
|
943
|
-
|
|
944
|
-
logger.end()
|
|
945
|
-
|
|
946
|
-
const { rawAudio, timeline: segmentTimeline } = await StreamlabsPollyTTS.synthesizeLongText(text, voice, language, options.sentenceEndPause, options.segmentEndPause)
|
|
947
|
-
|
|
948
|
-
synthesizedAudio = rawAudio
|
|
949
|
-
|
|
950
|
-
logger.start(`Generate word-level timestamps by individually aligning fragments`)
|
|
951
|
-
const alignmentOptions: API.AlignmentOptions = extendDeep(options.alignment, { language })
|
|
952
|
-
|
|
953
|
-
timeline = await API.alignSegments(synthesizedAudio, segmentTimeline, alignmentOptions)
|
|
954
|
-
|
|
955
|
-
shouldPostprocessSpeed = true
|
|
956
|
-
shouldPostprocessPitch = true
|
|
957
|
-
|
|
958
|
-
break
|
|
959
|
-
}
|
|
960
|
-
|
|
961
1070
|
default: {
|
|
962
1071
|
throw new Error(`Engine '${options.engine}' is not supported`)
|
|
963
1072
|
}
|
|
@@ -1003,7 +1112,12 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
1003
1112
|
alignmentOptions.dtw!.windowDuration = Math.max(5, Math.ceil(0.2 * getRawAudioDuration(synthesizedAudio)))
|
|
1004
1113
|
}
|
|
1005
1114
|
|
|
1006
|
-
const { wordTimeline } = await API.align(
|
|
1115
|
+
const { wordTimeline } = await API.align(
|
|
1116
|
+
synthesizedAudio,
|
|
1117
|
+
plainText,
|
|
1118
|
+
alignmentOptions,
|
|
1119
|
+
{ abortSignal: callbacks.abortSignal, logLevel: 'warning' },
|
|
1120
|
+
)
|
|
1007
1121
|
|
|
1008
1122
|
timeline = wordTimeline
|
|
1009
1123
|
|
|
@@ -1042,7 +1156,7 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
1042
1156
|
|
|
1043
1157
|
synthesizedAudio = await rubberband.stretchTimePitch(synthesizedAudio, timeStretchFactor, pitchShiftFactor, rubberbandOptions)
|
|
1044
1158
|
} else {
|
|
1045
|
-
throw new Error(`'${timePitchShiftingMethod}' is not a valid time and pitch shifting method
|
|
1159
|
+
throw new Error(`'${timePitchShiftingMethod}' is not a valid time and pitch shifting method.`)
|
|
1046
1160
|
}
|
|
1047
1161
|
|
|
1048
1162
|
if (timeStretchFactor != 1.0 && timeline) {
|
|
@@ -1056,7 +1170,7 @@ async function synthesizeSegment(text: string, options: SynthesisOptions) {
|
|
|
1056
1170
|
|
|
1057
1171
|
logger.end()
|
|
1058
1172
|
|
|
1059
|
-
logger.logDuration('Part synthesis time', startTimestamp, chalk.magentaBright)
|
|
1173
|
+
logger.logDuration('Part synthesis time', startTimestamp, 'info', chalk.magentaBright)
|
|
1060
1174
|
|
|
1061
1175
|
return { synthesizedAudio, timeline }
|
|
1062
1176
|
}
|
|
@@ -1099,11 +1213,11 @@ export type SynthesisEngine =
|
|
|
1099
1213
|
'espeak' | 'sam' | 'sapi' | 'msspeech' | 'coqui-server' |
|
|
1100
1214
|
'google-cloud' | 'microsoft-azure' | 'amazon-polly' |
|
|
1101
1215
|
'openai-cloud' | 'elevenlabs' | 'deepgram' |
|
|
1102
|
-
'google-translate' | 'microsoft-edge'
|
|
1216
|
+
'google-translate' | 'microsoft-edge'
|
|
1103
1217
|
|
|
1104
1218
|
export type TimePitchShiftingMethod = 'sonic' | 'rubberband'
|
|
1105
1219
|
|
|
1106
|
-
export interface SynthesisOptions {
|
|
1220
|
+
export interface SynthesisOptions extends API.OperationOptions {
|
|
1107
1221
|
engine?: SynthesisEngine
|
|
1108
1222
|
|
|
1109
1223
|
language?: string
|
|
@@ -1237,9 +1351,6 @@ export interface SynthesisOptions {
|
|
|
1237
1351
|
trustedClientToken?: string
|
|
1238
1352
|
pitchDeltaHz?: number
|
|
1239
1353
|
}
|
|
1240
|
-
|
|
1241
|
-
streamlabsPolly?: {
|
|
1242
|
-
},
|
|
1243
1354
|
}
|
|
1244
1355
|
|
|
1245
1356
|
export const defaultSynthesisOptions: SynthesisOptions = {
|
|
@@ -1384,18 +1495,16 @@ export const defaultSynthesisOptions: SynthesisOptions = {
|
|
|
1384
1495
|
|
|
1385
1496
|
pitchDeltaHz: undefined
|
|
1386
1497
|
},
|
|
1387
|
-
|
|
1388
|
-
streamlabsPolly: {
|
|
1389
|
-
},
|
|
1390
1498
|
}
|
|
1391
1499
|
|
|
1392
1500
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
1393
1501
|
// Voice list request
|
|
1394
1502
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
1395
|
-
export async function requestVoiceList(options: VoiceListRequestOptions): Promise<RequestVoiceListResult> {
|
|
1503
|
+
export async function requestVoiceList(options: VoiceListRequestOptions, callbacks?: VoiceListRequestCallbacks): Promise<RequestVoiceListResult> {
|
|
1396
1504
|
options = extendDeep(defaultVoiceListRequestOptions, options)
|
|
1505
|
+
callbacks = { logLevel: API.getGlobalLogLevel(), ...callbacks }
|
|
1397
1506
|
|
|
1398
|
-
const logger = new Logger()
|
|
1507
|
+
const logger = new Logger(callbacks.logLevel)
|
|
1399
1508
|
|
|
1400
1509
|
const cacheOptions = options.cache!
|
|
1401
1510
|
|
|
@@ -1416,7 +1525,7 @@ export async function requestVoiceList(options: VoiceListRequestOptions): Promis
|
|
|
1416
1525
|
case 'espeak': {
|
|
1417
1526
|
const EspeakTTS = await import('../synthesis/EspeakTTS.js')
|
|
1418
1527
|
|
|
1419
|
-
const voices = await EspeakTTS.listVoices()
|
|
1528
|
+
const voices = await EspeakTTS.listVoices(callbacks!)
|
|
1420
1529
|
|
|
1421
1530
|
voiceList = voices.map(voice => {
|
|
1422
1531
|
const languages = voice.languages.map(lang => normalizeLanguageCode(lang.name))
|
|
@@ -1531,7 +1640,7 @@ export async function requestVoiceList(options: VoiceListRequestOptions): Promis
|
|
|
1531
1640
|
throw new Error(`No Google Cloud API key provided`)
|
|
1532
1641
|
}
|
|
1533
1642
|
|
|
1534
|
-
const voices = await GoogleCloudTTS.getVoiceList(apiKey)
|
|
1643
|
+
const voices = await GoogleCloudTTS.getVoiceList(apiKey, callbacks!)
|
|
1535
1644
|
|
|
1536
1645
|
voiceList = voices.map(voice => ({
|
|
1537
1646
|
name: voice.name,
|
|
@@ -1591,7 +1700,7 @@ export async function requestVoiceList(options: VoiceListRequestOptions): Promis
|
|
|
1591
1700
|
throw new Error(`No Amazon Polly secret access key provided`)
|
|
1592
1701
|
}
|
|
1593
1702
|
|
|
1594
|
-
const voices = await AwsPollyTTS.getVoiceList(region, accessKeyId, secretAccessKey)
|
|
1703
|
+
const voices = await AwsPollyTTS.getVoiceList(region, accessKeyId, secretAccessKey, callbacks!)
|
|
1595
1704
|
|
|
1596
1705
|
for (const voice of voices) {
|
|
1597
1706
|
const languageCode = normalizeLanguageCode(voice.LanguageCode!)
|
|
@@ -1635,7 +1744,7 @@ export async function requestVoiceList(options: VoiceListRequestOptions): Promis
|
|
|
1635
1744
|
throw new Error(`No ElevenLabs API key provided`)
|
|
1636
1745
|
}
|
|
1637
1746
|
|
|
1638
|
-
voiceList = await ElevenLabsTTS.getVoiceList(apiKey)
|
|
1747
|
+
voiceList = await ElevenLabsTTS.getVoiceList(apiKey, callbacks!)
|
|
1639
1748
|
|
|
1640
1749
|
break
|
|
1641
1750
|
}
|
|
@@ -1675,8 +1784,9 @@ export async function requestVoiceList(options: VoiceListRequestOptions): Promis
|
|
|
1675
1784
|
|
|
1676
1785
|
const voices =
|
|
1677
1786
|
await runOperationWithRetries(
|
|
1678
|
-
() => MicrosoftEdgeTTS.getVoiceList(trustedClientToken),
|
|
1679
|
-
|
|
1787
|
+
() => MicrosoftEdgeTTS.getVoiceList(trustedClientToken, callbacks!),
|
|
1788
|
+
'Mircosoft Edge TTS voice list request',
|
|
1789
|
+
callbacks!)
|
|
1680
1790
|
|
|
1681
1791
|
voiceList = voices.map((voice: any) => ({
|
|
1682
1792
|
name: voice.Name,
|
|
@@ -1686,19 +1796,11 @@ export async function requestVoiceList(options: VoiceListRequestOptions): Promis
|
|
|
1686
1796
|
|
|
1687
1797
|
break
|
|
1688
1798
|
}
|
|
1689
|
-
|
|
1690
|
-
case 'streamlabs-polly': {
|
|
1691
|
-
const StreamlabsPollyTTS = await import('../synthesis/StreamlabsPollyTTS.js')
|
|
1692
|
-
|
|
1693
|
-
voiceList = StreamlabsPollyTTS.voiceList
|
|
1694
|
-
|
|
1695
|
-
break
|
|
1696
|
-
}
|
|
1697
1799
|
}
|
|
1698
1800
|
|
|
1699
1801
|
|
|
1700
1802
|
if (cacheFilePath) {
|
|
1701
|
-
await writeFileSafe(cacheFilePath,
|
|
1803
|
+
await writeFileSafe(cacheFilePath, stringifyAndFormatJson(voiceList))
|
|
1702
1804
|
}
|
|
1703
1805
|
|
|
1704
1806
|
return voiceList
|
|
@@ -1774,6 +1876,9 @@ export interface RequestVoiceListResult {
|
|
|
1774
1876
|
bestMatchingVoice: API.SynthesisVoice
|
|
1775
1877
|
}
|
|
1776
1878
|
|
|
1879
|
+
export interface VoiceListRequestCallbacks extends API.OperationCallbacks {
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1777
1882
|
export async function selectBestOfflineEngineForLanguage(language: string): Promise<SynthesisEngine> {
|
|
1778
1883
|
language = await normalizeIdentifierToLanguageCode(language)
|
|
1779
1884
|
|
|
@@ -1822,7 +1927,7 @@ export const defaultVoiceListRequestOptions: VoiceListRequestOptions = {
|
|
|
1822
1927
|
},
|
|
1823
1928
|
}
|
|
1824
1929
|
|
|
1825
|
-
export interface
|
|
1930
|
+
export interface SynthesisSegmentCallbackData {
|
|
1826
1931
|
index: number
|
|
1827
1932
|
total: number
|
|
1828
1933
|
audio: RawAudio | Uint8Array
|
|
@@ -1832,7 +1937,12 @@ export interface SynthesisSegmentEventData {
|
|
|
1832
1937
|
peakDecibelsSoFar: number
|
|
1833
1938
|
}
|
|
1834
1939
|
|
|
1835
|
-
export type
|
|
1940
|
+
export type SynthesisSegmentCallback = (data: SynthesisSegmentCallbackData) => Promise<void>
|
|
1941
|
+
|
|
1942
|
+
export interface SynthesisCallbacks extends API.OperationCallbacks {
|
|
1943
|
+
onSegment?: SynthesisSegmentCallback
|
|
1944
|
+
onSentence?: SynthesisSegmentCallback
|
|
1945
|
+
}
|
|
1836
1946
|
|
|
1837
1947
|
export interface SynthesisVoice {
|
|
1838
1948
|
name: string
|
|
@@ -1903,7 +2013,7 @@ export const synthesisEngines: EngineMetadata[] = [
|
|
|
1903
2013
|
{
|
|
1904
2014
|
id: 'coqui-server',
|
|
1905
2015
|
name: 'Coqui TTS',
|
|
1906
|
-
description: 'A
|
|
2016
|
+
description: 'A client for Coqui TTS server.',
|
|
1907
2017
|
type: 'server'
|
|
1908
2018
|
},
|
|
1909
2019
|
{
|
|
@@ -1954,11 +2064,5 @@ export const synthesisEngines: EngineMetadata[] = [
|
|
|
1954
2064
|
description: 'Unoffical text-to-speech API used by the Microsoft Edge browser.',
|
|
1955
2065
|
type: 'cloud'
|
|
1956
2066
|
},
|
|
1957
|
-
{
|
|
1958
|
-
id: 'streamlabs-polly',
|
|
1959
|
-
name: 'Streamlabs Polly',
|
|
1960
|
-
description: 'Unoffical text-to-speech API provided by Streamlabs.',
|
|
1961
|
-
type: 'cloud'
|
|
1962
|
-
},
|
|
1963
2067
|
]
|
|
1964
2068
|
|