@tscaps/engine 0.1.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 +21 -0
- package/README.md +349 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/css/BrowserCssResourceEmbedder.d.ts +5 -0
- package/dist/modules/css/BrowserCssResourceEmbedder.d.ts.map +1 -0
- package/dist/modules/css/BrowserCssResourceEmbedder.js +41 -0
- package/dist/modules/css/BrowserCssResourceEmbedder.js.map +1 -0
- package/dist/modules/css/CssMinifier.d.ts +12 -0
- package/dist/modules/css/CssMinifier.d.ts.map +1 -0
- package/dist/modules/css/CssMinifier.js +47 -0
- package/dist/modules/css/CssMinifier.js.map +1 -0
- package/dist/modules/css/CssResourceEmbedder.d.ts +4 -0
- package/dist/modules/css/CssResourceEmbedder.d.ts.map +1 -0
- package/dist/modules/css/CssResourceEmbedder.js +2 -0
- package/dist/modules/css/CssResourceEmbedder.js.map +1 -0
- package/dist/modules/css/CssScoper.d.ts +16 -0
- package/dist/modules/css/CssScoper.d.ts.map +1 -0
- package/dist/modules/css/CssScoper.js +109 -0
- package/dist/modules/css/CssScoper.js.map +1 -0
- package/dist/modules/css/NoopCssResourceEmbedder.d.ts +12 -0
- package/dist/modules/css/NoopCssResourceEmbedder.d.ts.map +1 -0
- package/dist/modules/css/NoopCssResourceEmbedder.js +13 -0
- package/dist/modules/css/NoopCssResourceEmbedder.js.map +1 -0
- package/dist/modules/css/index.d.ts +6 -0
- package/dist/modules/css/index.d.ts.map +1 -0
- package/dist/modules/css/index.js +5 -0
- package/dist/modules/css/index.js.map +1 -0
- package/dist/modules/document/CssVariable.d.ts +46 -0
- package/dist/modules/document/CssVariable.d.ts.map +1 -0
- package/dist/modules/document/CssVariable.js +47 -0
- package/dist/modules/document/CssVariable.js.map +1 -0
- package/dist/modules/document/Document.d.ts +43 -0
- package/dist/modules/document/Document.d.ts.map +1 -0
- package/dist/modules/document/Document.js +86 -0
- package/dist/modules/document/Document.js.map +1 -0
- package/dist/modules/document/DocumentEditor.d.ts +111 -0
- package/dist/modules/document/DocumentEditor.d.ts.map +1 -0
- package/dist/modules/document/DocumentEditor.js +555 -0
- package/dist/modules/document/DocumentEditor.js.map +1 -0
- package/dist/modules/document/Letter.d.ts +17 -0
- package/dist/modules/document/Letter.d.ts.map +1 -0
- package/dist/modules/document/Letter.js +17 -0
- package/dist/modules/document/Letter.js.map +1 -0
- package/dist/modules/document/Line.d.ts +31 -0
- package/dist/modules/document/Line.d.ts.map +1 -0
- package/dist/modules/document/Line.js +94 -0
- package/dist/modules/document/Line.js.map +1 -0
- package/dist/modules/document/LineState.d.ts +6 -0
- package/dist/modules/document/LineState.d.ts.map +1 -0
- package/dist/modules/document/LineState.js +7 -0
- package/dist/modules/document/LineState.js.map +1 -0
- package/dist/modules/document/NarrationPace.d.ts +20 -0
- package/dist/modules/document/NarrationPace.d.ts.map +1 -0
- package/dist/modules/document/NarrationPace.js +60 -0
- package/dist/modules/document/NarrationPace.js.map +1 -0
- package/dist/modules/document/Section.d.ts +45 -0
- package/dist/modules/document/Section.d.ts.map +1 -0
- package/dist/modules/document/Section.js +94 -0
- package/dist/modules/document/Section.js.map +1 -0
- package/dist/modules/document/Segment.d.ts +40 -0
- package/dist/modules/document/Segment.d.ts.map +1 -0
- package/dist/modules/document/Segment.js +85 -0
- package/dist/modules/document/Segment.js.map +1 -0
- package/dist/modules/document/Tag.d.ts +24 -0
- package/dist/modules/document/Tag.d.ts.map +1 -0
- package/dist/modules/document/Tag.js +37 -0
- package/dist/modules/document/Tag.js.map +1 -0
- package/dist/modules/document/TimeFragment.d.ts +11 -0
- package/dist/modules/document/TimeFragment.d.ts.map +1 -0
- package/dist/modules/document/TimeFragment.js +29 -0
- package/dist/modules/document/TimeFragment.js.map +1 -0
- package/dist/modules/document/Word.d.ts +40 -0
- package/dist/modules/document/Word.d.ts.map +1 -0
- package/dist/modules/document/Word.js +114 -0
- package/dist/modules/document/Word.js.map +1 -0
- package/dist/modules/document/WordState.d.ts +6 -0
- package/dist/modules/document/WordState.d.ts.map +1 -0
- package/dist/modules/document/WordState.js +7 -0
- package/dist/modules/document/WordState.js.map +1 -0
- package/dist/modules/document/index.d.ts +14 -0
- package/dist/modules/document/index.d.ts.map +1 -0
- package/dist/modules/document/index.js +14 -0
- package/dist/modules/document/index.js.map +1 -0
- package/dist/modules/effect/CarryQuotesEffect.d.ts +47 -0
- package/dist/modules/effect/CarryQuotesEffect.d.ts.map +1 -0
- package/dist/modules/effect/CarryQuotesEffect.js +181 -0
- package/dist/modules/effect/CarryQuotesEffect.js.map +1 -0
- package/dist/modules/effect/Effect.d.ts +16 -0
- package/dist/modules/effect/Effect.d.ts.map +1 -0
- package/dist/modules/effect/Effect.js +2 -0
- package/dist/modules/effect/Effect.js.map +1 -0
- package/dist/modules/effect/GapFreeEffect.d.ts +24 -0
- package/dist/modules/effect/GapFreeEffect.d.ts.map +1 -0
- package/dist/modules/effect/GapFreeEffect.js +67 -0
- package/dist/modules/effect/GapFreeEffect.js.map +1 -0
- package/dist/modules/effect/RemovePunctuationEffect.d.ts +21 -0
- package/dist/modules/effect/RemovePunctuationEffect.d.ts.map +1 -0
- package/dist/modules/effect/RemovePunctuationEffect.js +52 -0
- package/dist/modules/effect/RemovePunctuationEffect.js.map +1 -0
- package/dist/modules/effect/SmartLowercaseEffect.d.ts +21 -0
- package/dist/modules/effect/SmartLowercaseEffect.d.ts.map +1 -0
- package/dist/modules/effect/SmartLowercaseEffect.js +45 -0
- package/dist/modules/effect/SmartLowercaseEffect.js.map +1 -0
- package/dist/modules/effect/SmartPunctuationEffect.d.ts +25 -0
- package/dist/modules/effect/SmartPunctuationEffect.d.ts.map +1 -0
- package/dist/modules/effect/SmartPunctuationEffect.js +68 -0
- package/dist/modules/effect/SmartPunctuationEffect.js.map +1 -0
- package/dist/modules/effect/index.d.ts +7 -0
- package/dist/modules/effect/index.d.ts.map +1 -0
- package/dist/modules/effect/index.js +6 -0
- package/dist/modules/effect/index.js.map +1 -0
- package/dist/modules/pipeline/PipelineProgress.d.ts +30 -0
- package/dist/modules/pipeline/PipelineProgress.d.ts.map +1 -0
- package/dist/modules/pipeline/PipelineProgress.js +2 -0
- package/dist/modules/pipeline/PipelineProgress.js.map +1 -0
- package/dist/modules/pipeline/RenderPipeline.d.ts +105 -0
- package/dist/modules/pipeline/RenderPipeline.d.ts.map +1 -0
- package/dist/modules/pipeline/RenderPipeline.js +232 -0
- package/dist/modules/pipeline/RenderPipeline.js.map +1 -0
- package/dist/modules/pipeline/RenderPipelineBuilder.d.ts +143 -0
- package/dist/modules/pipeline/RenderPipelineBuilder.d.ts.map +1 -0
- package/dist/modules/pipeline/RenderPipelineBuilder.js +317 -0
- package/dist/modules/pipeline/RenderPipelineBuilder.js.map +1 -0
- package/dist/modules/pipeline/index.d.ts +6 -0
- package/dist/modules/pipeline/index.d.ts.map +1 -0
- package/dist/modules/pipeline/index.js +3 -0
- package/dist/modules/pipeline/index.js.map +1 -0
- package/dist/modules/profiling/Profiler.d.ts +115 -0
- package/dist/modules/profiling/Profiler.d.ts.map +1 -0
- package/dist/modules/profiling/Profiler.js +316 -0
- package/dist/modules/profiling/Profiler.js.map +1 -0
- package/dist/modules/profiling/index.d.ts +2 -0
- package/dist/modules/profiling/index.d.ts.map +1 -0
- package/dist/modules/profiling/index.js +2 -0
- package/dist/modules/profiling/index.js.map +1 -0
- package/dist/modules/rendering/AlignmentConfig.d.ts +21 -0
- package/dist/modules/rendering/AlignmentConfig.d.ts.map +1 -0
- package/dist/modules/rendering/AlignmentConfig.js +2 -0
- package/dist/modules/rendering/AlignmentConfig.js.map +1 -0
- package/dist/modules/rendering/BoxEdges.d.ts +8 -0
- package/dist/modules/rendering/BoxEdges.d.ts.map +1 -0
- package/dist/modules/rendering/BoxEdges.js +2 -0
- package/dist/modules/rendering/BoxEdges.js.map +1 -0
- package/dist/modules/rendering/BrowserOverlayFrameRenderer.d.ts +12 -0
- package/dist/modules/rendering/BrowserOverlayFrameRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/BrowserOverlayFrameRenderer.js +31 -0
- package/dist/modules/rendering/BrowserOverlayFrameRenderer.js.map +1 -0
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts +57 -0
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js +775 -0
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js.map +1 -0
- package/dist/modules/rendering/ElementRenderOverrides.d.ts +15 -0
- package/dist/modules/rendering/ElementRenderOverrides.d.ts.map +1 -0
- package/dist/modules/rendering/ElementRenderOverrides.js +24 -0
- package/dist/modules/rendering/ElementRenderOverrides.js.map +1 -0
- package/dist/modules/rendering/InlineStyleMap.d.ts +9 -0
- package/dist/modules/rendering/InlineStyleMap.d.ts.map +1 -0
- package/dist/modules/rendering/InlineStyleMap.js +2 -0
- package/dist/modules/rendering/InlineStyleMap.js.map +1 -0
- package/dist/modules/rendering/LayeredSubtitleFrame.d.ts +20 -0
- package/dist/modules/rendering/LayeredSubtitleFrame.d.ts.map +1 -0
- package/dist/modules/rendering/LayeredSubtitleFrame.js +36 -0
- package/dist/modules/rendering/LayeredSubtitleFrame.js.map +1 -0
- package/dist/modules/rendering/OverlayFrameRenderer.d.ts +27 -0
- package/dist/modules/rendering/OverlayFrameRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/OverlayFrameRenderer.js +2 -0
- package/dist/modules/rendering/OverlayFrameRenderer.js.map +1 -0
- package/dist/modules/rendering/RenderingConfig.d.ts +22 -0
- package/dist/modules/rendering/RenderingConfig.d.ts.map +1 -0
- package/dist/modules/rendering/RenderingConfig.js +2 -0
- package/dist/modules/rendering/RenderingConfig.js.map +1 -0
- package/dist/modules/rendering/ScopedRenderOverride.d.ts +19 -0
- package/dist/modules/rendering/ScopedRenderOverride.d.ts.map +1 -0
- package/dist/modules/rendering/ScopedRenderOverride.js +2 -0
- package/dist/modules/rendering/ScopedRenderOverride.js.map +1 -0
- package/dist/modules/rendering/SegmentPaintRegionResolver.d.ts +41 -0
- package/dist/modules/rendering/SegmentPaintRegionResolver.d.ts.map +1 -0
- package/dist/modules/rendering/SegmentPaintRegionResolver.js +47 -0
- package/dist/modules/rendering/SegmentPaintRegionResolver.js.map +1 -0
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts +58 -0
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts.map +1 -0
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js +132 -0
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js.map +1 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts +111 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.js +2 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.js.map +1 -0
- package/dist/modules/rendering/VideoFrameLayerClass.d.ts +21 -0
- package/dist/modules/rendering/VideoFrameLayerClass.d.ts.map +1 -0
- package/dist/modules/rendering/VideoFrameLayerClass.js +21 -0
- package/dist/modules/rendering/VideoFrameLayerClass.js.map +1 -0
- package/dist/modules/rendering/VideoFrameSource.d.ts +29 -0
- package/dist/modules/rendering/VideoFrameSource.d.ts.map +1 -0
- package/dist/modules/rendering/VideoFrameSource.js +2 -0
- package/dist/modules/rendering/VideoFrameSource.js.map +1 -0
- package/dist/modules/rendering/index.d.ts +14 -0
- package/dist/modules/rendering/index.d.ts.map +1 -0
- package/dist/modules/rendering/index.js +6 -0
- package/dist/modules/rendering/index.js.map +1 -0
- package/dist/modules/splitting/BalancedLineSplitter.d.ts +24 -0
- package/dist/modules/splitting/BalancedLineSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/BalancedLineSplitter.js +81 -0
- package/dist/modules/splitting/BalancedLineSplitter.js.map +1 -0
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.d.ts +31 -0
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.js +99 -0
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.js.map +1 -0
- package/dist/modules/splitting/BoundarySegmentSplitter.d.ts +19 -0
- package/dist/modules/splitting/BoundarySegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/BoundarySegmentSplitter.js +38 -0
- package/dist/modules/splitting/BoundarySegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/CompositeSegmentSplitter.d.ts +8 -0
- package/dist/modules/splitting/CompositeSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/CompositeSegmentSplitter.js +12 -0
- package/dist/modules/splitting/CompositeSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.d.ts +56 -0
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.d.ts.map +1 -0
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.js +197 -0
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.js.map +1 -0
- package/dist/modules/splitting/GraphemeWordSplitter.d.ts +11 -0
- package/dist/modules/splitting/GraphemeWordSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/GraphemeWordSplitter.js +12 -0
- package/dist/modules/splitting/GraphemeWordSplitter.js.map +1 -0
- package/dist/modules/splitting/LimitByCharsSegmentSplitter.d.ts +15 -0
- package/dist/modules/splitting/LimitByCharsSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/LimitByCharsSegmentSplitter.js +64 -0
- package/dist/modules/splitting/LimitByCharsSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/LimitByScaledCharsSegmentSplitter.d.ts +30 -0
- package/dist/modules/splitting/LimitByScaledCharsSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/LimitByScaledCharsSegmentSplitter.js +66 -0
- package/dist/modules/splitting/LimitByScaledCharsSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/LimitByWordsSegmentSplitter.d.ts +12 -0
- package/dist/modules/splitting/LimitByWordsSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/LimitByWordsSegmentSplitter.js +25 -0
- package/dist/modules/splitting/LimitByWordsSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/LineSplitter.d.ts +10 -0
- package/dist/modules/splitting/LineSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/LineSplitter.js +2 -0
- package/dist/modules/splitting/LineSplitter.js.map +1 -0
- package/dist/modules/splitting/PauseBasedSegmentSplitter.d.ts +24 -0
- package/dist/modules/splitting/PauseBasedSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/PauseBasedSegmentSplitter.js +43 -0
- package/dist/modules/splitting/PauseBasedSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/SegmentSplitter.d.ts +10 -0
- package/dist/modules/splitting/SegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/SegmentSplitter.js +2 -0
- package/dist/modules/splitting/SegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/SpeakerChangeSegmentSplitter.d.ts +17 -0
- package/dist/modules/splitting/SpeakerChangeSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/SpeakerChangeSegmentSplitter.js +46 -0
- package/dist/modules/splitting/SpeakerChangeSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/TextMeasurer.d.ts +15 -0
- package/dist/modules/splitting/TextMeasurer.d.ts.map +1 -0
- package/dist/modules/splitting/TextMeasurer.js +2 -0
- package/dist/modules/splitting/TextMeasurer.js.map +1 -0
- package/dist/modules/splitting/WordSplitter.d.ts +8 -0
- package/dist/modules/splitting/WordSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/WordSplitter.js +2 -0
- package/dist/modules/splitting/WordSplitter.js.map +1 -0
- package/dist/modules/splitting/index.d.ts +24 -0
- package/dist/modules/splitting/index.d.ts.map +1 -0
- package/dist/modules/splitting/index.js +12 -0
- package/dist/modules/splitting/index.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilter.d.ts +16 -0
- package/dist/modules/svg-filter/SvgFilter.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilter.js +28 -0
- package/dist/modules/svg-filter/SvgFilter.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterBundle.d.ts +16 -0
- package/dist/modules/svg-filter/SvgFilterBundle.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterBundle.js +20 -0
- package/dist/modules/svg-filter/SvgFilterBundle.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.d.ts +16 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.js +25 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts +21 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js +50 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterLengthResolver.d.ts +17 -0
- package/dist/modules/svg-filter/SvgFilterLengthResolver.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterLengthResolver.js +27 -0
- package/dist/modules/svg-filter/SvgFilterLengthResolver.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScope.d.ts +18 -0
- package/dist/modules/svg-filter/SvgFilterScope.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScope.js +28 -0
- package/dist/modules/svg-filter/SvgFilterScope.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScopeProvider.d.ts +52 -0
- package/dist/modules/svg-filter/SvgFilterScopeProvider.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScopeProvider.js +2 -0
- package/dist/modules/svg-filter/SvgFilterScopeProvider.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScoper.d.ts +60 -0
- package/dist/modules/svg-filter/SvgFilterScoper.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScoper.js +58 -0
- package/dist/modules/svg-filter/SvgFilterScoper.js.map +1 -0
- package/dist/modules/svg-filter/index.d.ts +10 -0
- package/dist/modules/svg-filter/index.d.ts.map +1 -0
- package/dist/modules/svg-filter/index.js +8 -0
- package/dist/modules/svg-filter/index.js.map +1 -0
- package/dist/modules/tagging/RegexTagger.d.ts +11 -0
- package/dist/modules/tagging/RegexTagger.d.ts.map +1 -0
- package/dist/modules/tagging/RegexTagger.js +32 -0
- package/dist/modules/tagging/RegexTagger.js.map +1 -0
- package/dist/modules/tagging/SpanTagger.d.ts +25 -0
- package/dist/modules/tagging/SpanTagger.d.ts.map +1 -0
- package/dist/modules/tagging/SpanTagger.js +73 -0
- package/dist/modules/tagging/SpanTagger.js.map +1 -0
- package/dist/modules/tagging/StructureTagger.d.ts +20 -0
- package/dist/modules/tagging/StructureTagger.d.ts.map +1 -0
- package/dist/modules/tagging/StructureTagger.js +74 -0
- package/dist/modules/tagging/StructureTagger.js.map +1 -0
- package/dist/modules/tagging/Tagger.d.ts +5 -0
- package/dist/modules/tagging/Tagger.d.ts.map +1 -0
- package/dist/modules/tagging/Tagger.js +5 -0
- package/dist/modules/tagging/Tagger.js.map +1 -0
- package/dist/modules/tagging/WordlistTagger.d.ts +11 -0
- package/dist/modules/tagging/WordlistTagger.d.ts.map +1 -0
- package/dist/modules/tagging/WordlistTagger.js +31 -0
- package/dist/modules/tagging/WordlistTagger.js.map +1 -0
- package/dist/modules/tagging/index.d.ts +6 -0
- package/dist/modules/tagging/index.d.ts.map +1 -0
- package/dist/modules/tagging/index.js +6 -0
- package/dist/modules/tagging/index.js.map +1 -0
- package/dist/modules/transcription/AudioDecoder.d.ts +11 -0
- package/dist/modules/transcription/AudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/AudioDecoder.js +2 -0
- package/dist/modules/transcription/AudioDecoder.js.map +1 -0
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts +13 -0
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/BrowserAudioDecoder.js +34 -0
- package/dist/modules/transcription/BrowserAudioDecoder.js.map +1 -0
- package/dist/modules/transcription/PassthroughTranscriber.d.ts +20 -0
- package/dist/modules/transcription/PassthroughTranscriber.d.ts.map +1 -0
- package/dist/modules/transcription/PassthroughTranscriber.js +23 -0
- package/dist/modules/transcription/PassthroughTranscriber.js.map +1 -0
- package/dist/modules/transcription/PreDecodedAudioDecoder.d.ts +12 -0
- package/dist/modules/transcription/PreDecodedAudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/PreDecodedAudioDecoder.js +14 -0
- package/dist/modules/transcription/PreDecodedAudioDecoder.js.map +1 -0
- package/dist/modules/transcription/SrtTranscriber.d.ts +33 -0
- package/dist/modules/transcription/SrtTranscriber.d.ts.map +1 -0
- package/dist/modules/transcription/SrtTranscriber.js +111 -0
- package/dist/modules/transcription/SrtTranscriber.js.map +1 -0
- package/dist/modules/transcription/Transcriber.d.ts +23 -0
- package/dist/modules/transcription/Transcriber.d.ts.map +1 -0
- package/dist/modules/transcription/Transcriber.js +2 -0
- package/dist/modules/transcription/Transcriber.js.map +1 -0
- package/dist/modules/transcription/WhisperTranscriber.d.ts +44 -0
- package/dist/modules/transcription/WhisperTranscriber.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperTranscriber.js +162 -0
- package/dist/modules/transcription/WhisperTranscriber.js.map +1 -0
- package/dist/modules/transcription/index.d.ts +8 -0
- package/dist/modules/transcription/index.d.ts.map +1 -0
- package/dist/modules/transcription/index.js +6 -0
- package/dist/modules/transcription/index.js.map +1 -0
- package/dist/modules/video/RenderJob.d.ts +95 -0
- package/dist/modules/video/RenderJob.d.ts.map +1 -0
- package/dist/modules/video/RenderJob.js +2 -0
- package/dist/modules/video/RenderJob.js.map +1 -0
- package/dist/modules/video/VideoRenderer.d.ts +5 -0
- package/dist/modules/video/VideoRenderer.d.ts.map +1 -0
- package/dist/modules/video/VideoRenderer.js +2 -0
- package/dist/modules/video/VideoRenderer.js.map +1 -0
- package/dist/modules/video/index.d.ts +33 -0
- package/dist/modules/video/index.d.ts.map +1 -0
- package/dist/modules/video/index.js +17 -0
- package/dist/modules/video/index.js.map +1 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts +69 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js +206 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridge.d.ts +24 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridge.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridge.js +2 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridge.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts +20 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.js +2 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.d.ts +11 -0
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js +32 -0
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/DiscardAudioTrackBridge.d.ts +12 -0
- package/dist/modules/video/mediabunny/audio/DiscardAudioTrackBridge.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/DiscardAudioTrackBridge.js +14 -0
- package/dist/modules/video/mediabunny/audio/DiscardAudioTrackBridge.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts +28 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js +52 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts +25 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js +52 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js.map +1 -0
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.d.ts +32 -0
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.js +60 -0
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.js.map +1 -0
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.d.ts +27 -0
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.js +72 -0
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.js.map +1 -0
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.d.ts +32 -0
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.js +2 -0
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.js.map +1 -0
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.d.ts +25 -0
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.js +37 -0
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.js.map +1 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts +32 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.js +2 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.js.map +1 -0
- package/dist/modules/video/mediabunny/codec/DefaultCodecPolicy.d.ts +59 -0
- package/dist/modules/video/mediabunny/codec/DefaultCodecPolicy.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/codec/DefaultCodecPolicy.js +110 -0
- package/dist/modules/video/mediabunny/codec/DefaultCodecPolicy.js.map +1 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.d.ts +27 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.js +44 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.js.map +1 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory.d.ts +10 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory.js +15 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoder.d.ts +29 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoder.js +2 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoder.js.map +1 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoderFactory.d.ts +16 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoderFactory.js +2 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts +25 -0
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js +74 -0
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/CustomWebCodecsVideoFrameDecoder.d.ts +26 -0
- package/dist/modules/video/mediabunny/frame/CustomWebCodecsVideoFrameDecoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/CustomWebCodecsVideoFrameDecoder.js +147 -0
- package/dist/modules/video/mediabunny/frame/CustomWebCodecsVideoFrameDecoder.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.d.ts +12 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.js +25 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts +30 -0
- package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/FrameCompositor.js +2 -0
- package/dist/modules/video/mediabunny/frame/FrameCompositor.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder.d.ts +44 -0
- package/dist/modules/video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder.js +334 -0
- package/dist/modules/video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts +10 -0
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js +17 -0
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoder.d.ts +30 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoder.js +2 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoder.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.d.ts +22 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.js +2 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsVideoFrameDecoder.d.ts +17 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsVideoFrameDecoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsVideoFrameDecoder.js +48 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsVideoFrameDecoder.js.map +1 -0
- package/dist/modules/video/mediabunny/output/MediaBunnyOutputTargetBuilder.d.ts +11 -0
- package/dist/modules/video/mediabunny/output/MediaBunnyOutputTargetBuilder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/output/MediaBunnyOutputTargetBuilder.js +22 -0
- package/dist/modules/video/mediabunny/output/MediaBunnyOutputTargetBuilder.js.map +1 -0
- package/dist/modules/video/mediabunny/output/OutputTargetBuilder.d.ts +27 -0
- package/dist/modules/video/mediabunny/output/OutputTargetBuilder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/output/OutputTargetBuilder.js +2 -0
- package/dist/modules/video/mediabunny/output/OutputTargetBuilder.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AudioDecoder } from '../transcription/AudioDecoder';
|
|
2
|
+
/**
|
|
3
|
+
* Decodes any browser-decodable audio or video Blob into mono Float32Array
|
|
4
|
+
* PCM at the target sample rate via Web Audio. Main-thread only — Worker
|
|
5
|
+
* contexts have no `AudioContext` or `OfflineAudioContext`. The decode
|
|
6
|
+
* and resample work happens in the browser's audio engine asynchronously
|
|
7
|
+
* and does not appreciably block JS.
|
|
8
|
+
*/
|
|
9
|
+
export declare class BrowserAudioDecoder implements AudioDecoder {
|
|
10
|
+
decode(audio: Blob, targetSampleRate: number): Promise<Float32Array>;
|
|
11
|
+
private resample;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=BrowserAudioDecoder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserAudioDecoder.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/BrowserAudioDecoder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAExE;;;;;;GAMG;AACH,qBAAa,mBAAoB,YAAW,YAAY;IAChD,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;YAW5D,QAAQ;CAavB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decodes any browser-decodable audio or video Blob into mono Float32Array
|
|
3
|
+
* PCM at the target sample rate via Web Audio. Main-thread only — Worker
|
|
4
|
+
* contexts have no `AudioContext` or `OfflineAudioContext`. The decode
|
|
5
|
+
* and resample work happens in the browser's audio engine asynchronously
|
|
6
|
+
* and does not appreciably block JS.
|
|
7
|
+
*/
|
|
8
|
+
export class BrowserAudioDecoder {
|
|
9
|
+
async decode(audio, targetSampleRate) {
|
|
10
|
+
const arrayBuffer = await audio.arrayBuffer();
|
|
11
|
+
const ctx = new AudioContext();
|
|
12
|
+
try {
|
|
13
|
+
const audioBuffer = await ctx.decodeAudioData(arrayBuffer);
|
|
14
|
+
return await this.resample(audioBuffer, targetSampleRate);
|
|
15
|
+
}
|
|
16
|
+
finally {
|
|
17
|
+
await ctx.close();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async resample(audioBuffer, targetSampleRate) {
|
|
21
|
+
if (audioBuffer.sampleRate === targetSampleRate && audioBuffer.numberOfChannels === 1) {
|
|
22
|
+
return audioBuffer.getChannelData(0);
|
|
23
|
+
}
|
|
24
|
+
const sampleCount = Math.ceil(audioBuffer.duration * targetSampleRate);
|
|
25
|
+
const offlineCtx = new OfflineAudioContext(1, sampleCount, targetSampleRate);
|
|
26
|
+
const source = offlineCtx.createBufferSource();
|
|
27
|
+
source.buffer = audioBuffer;
|
|
28
|
+
source.connect(offlineCtx.destination);
|
|
29
|
+
source.start();
|
|
30
|
+
const resampled = await offlineCtx.startRendering();
|
|
31
|
+
return resampled.getChannelData(0);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=BrowserAudioDecoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserAudioDecoder.js","sourceRoot":"","sources":["../../../src/modules/transcription/BrowserAudioDecoder.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,OAAO,mBAAmB;IAC9B,KAAK,CAAC,MAAM,CAAC,KAAW,EAAE,gBAAwB;QAChD,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,GAAG,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;YAC3D,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;QAC5D,CAAC;gBAAS,CAAC;YACT,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,QAAQ,CAAC,WAAwB,EAAE,gBAAwB;QACvE,IAAI,WAAW,CAAC,UAAU,KAAK,gBAAgB,IAAI,WAAW,CAAC,gBAAgB,KAAK,CAAC,EAAE,CAAC;YACtF,OAAO,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACvC,CAAC;QACD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,gBAAgB,CAAC,CAAC;QACvE,MAAM,UAAU,GAAG,IAAI,mBAAmB,CAAC,CAAC,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;QAC7E,MAAM,MAAM,GAAG,UAAU,CAAC,kBAAkB,EAAE,CAAC;QAC/C,MAAM,CAAC,MAAM,GAAG,WAAW,CAAC;QAC5B,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACvC,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,cAAc,EAAE,CAAC;QACpD,OAAO,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Document } from '../document/index';
|
|
2
|
+
import type { Transcriber, TranscriberOptions, TranscriberProgressEvent } from '../transcription/Transcriber';
|
|
3
|
+
/**
|
|
4
|
+
* Returns a Document supplied up front instead of running any audio
|
|
5
|
+
* analysis. Lets a caller drive a transcription-shaped pipeline starting
|
|
6
|
+
* from a Document they already have — typical when the document came
|
|
7
|
+
* from an earlier run, an external pipeline, or a hand-built fixture —
|
|
8
|
+
* without changing the orchestrator's shape.
|
|
9
|
+
*
|
|
10
|
+
* Emits a single `inferring` progress event with `progress: 1` so
|
|
11
|
+
* listeners that mirror a real transcriber see the same event shape
|
|
12
|
+
* and don't have to special-case the bypass.
|
|
13
|
+
*/
|
|
14
|
+
export declare class PassthroughTranscriber implements Transcriber {
|
|
15
|
+
private readonly document;
|
|
16
|
+
onProgress?: (event: TranscriberProgressEvent) => void;
|
|
17
|
+
constructor(document: Document);
|
|
18
|
+
transcribe(_audio: Blob, _options?: TranscriberOptions): Promise<Document>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=PassthroughTranscriber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PassthroughTranscriber.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/PassthroughTranscriber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,qBAAa,sBAAuB,YAAW,WAAW;IAG5C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAFrC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC;gBAE1B,QAAQ,EAAE,QAAQ;IAEzC,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAIjF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a Document supplied up front instead of running any audio
|
|
3
|
+
* analysis. Lets a caller drive a transcription-shaped pipeline starting
|
|
4
|
+
* from a Document they already have — typical when the document came
|
|
5
|
+
* from an earlier run, an external pipeline, or a hand-built fixture —
|
|
6
|
+
* without changing the orchestrator's shape.
|
|
7
|
+
*
|
|
8
|
+
* Emits a single `inferring` progress event with `progress: 1` so
|
|
9
|
+
* listeners that mirror a real transcriber see the same event shape
|
|
10
|
+
* and don't have to special-case the bypass.
|
|
11
|
+
*/
|
|
12
|
+
export class PassthroughTranscriber {
|
|
13
|
+
document;
|
|
14
|
+
onProgress;
|
|
15
|
+
constructor(document) {
|
|
16
|
+
this.document = document;
|
|
17
|
+
}
|
|
18
|
+
async transcribe(_audio, _options) {
|
|
19
|
+
this.onProgress?.({ stage: 'inferring', progress: 1 });
|
|
20
|
+
return this.document;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=PassthroughTranscriber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PassthroughTranscriber.js","sourceRoot":"","sources":["../../../src/modules/transcription/PassthroughTranscriber.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;GAUG;AACH,MAAM,OAAO,sBAAsB;IAGJ;IAF7B,UAAU,CAA6C;IAEvD,YAA6B,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;IAAG,CAAC;IAEnD,KAAK,CAAC,UAAU,CAAC,MAAY,EAAE,QAA6B;QAC1D,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AudioDecoder } from '../transcription/AudioDecoder';
|
|
2
|
+
/**
|
|
3
|
+
* Reads a Blob whose bytes are already a Float32Array of mono PCM at the
|
|
4
|
+
* agreed sample rate. The blob carries no metadata — the caller and the
|
|
5
|
+
* decoder share the targetSampleRate by convention. Useful in Worker
|
|
6
|
+
* contexts where browser audio decoding APIs are unavailable: a main-thread
|
|
7
|
+
* caller decodes once, then ships the raw PCM bytes as a Blob.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PreDecodedAudioDecoder implements AudioDecoder {
|
|
10
|
+
decode(audio: Blob, _targetSampleRate: number): Promise<Float32Array>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=PreDecodedAudioDecoder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreDecodedAudioDecoder.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/PreDecodedAudioDecoder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAExE;;;;;;GAMG;AACH,qBAAa,sBAAuB,YAAW,YAAY;IACnD,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;CAI5E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads a Blob whose bytes are already a Float32Array of mono PCM at the
|
|
3
|
+
* agreed sample rate. The blob carries no metadata — the caller and the
|
|
4
|
+
* decoder share the targetSampleRate by convention. Useful in Worker
|
|
5
|
+
* contexts where browser audio decoding APIs are unavailable: a main-thread
|
|
6
|
+
* caller decodes once, then ships the raw PCM bytes as a Blob.
|
|
7
|
+
*/
|
|
8
|
+
export class PreDecodedAudioDecoder {
|
|
9
|
+
async decode(audio, _targetSampleRate) {
|
|
10
|
+
const buffer = await audio.arrayBuffer();
|
|
11
|
+
return new Float32Array(buffer);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=PreDecodedAudioDecoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreDecodedAudioDecoder.js","sourceRoot":"","sources":["../../../src/modules/transcription/PreDecodedAudioDecoder.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,OAAO,sBAAsB;IACjC,KAAK,CAAC,MAAM,CAAC,KAAW,EAAE,iBAAyB;QACjD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE,CAAC;QACzC,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Document } from '../document/Document';
|
|
2
|
+
import type { Transcriber, TranscriberOptions, TranscriberProgressEvent } from '../transcription/Transcriber';
|
|
3
|
+
/**
|
|
4
|
+
* Builds a Document by parsing a SubRip (SRT) caption file. Each cue
|
|
5
|
+
* becomes one `Segment` carrying the cue's full time range; the cue's
|
|
6
|
+
* text (multi-line entries joined with a space, formatting tags
|
|
7
|
+
* stripped) becomes one `Line` whose `Word` timings are spread across
|
|
8
|
+
* the cue range proportionally to character length, so each word
|
|
9
|
+
* lights up in sequence rather than all at once.
|
|
10
|
+
*
|
|
11
|
+
* The audio Blob passed to `transcribe` is ignored. Useful when the
|
|
12
|
+
* caption text and timing are already known — burning a hand-authored
|
|
13
|
+
* SRT into a video, replaying captions from a previous run, etc.
|
|
14
|
+
*
|
|
15
|
+
* Throws when a timecode is malformed; returns an empty Document when
|
|
16
|
+
* the source contains no parseable cues.
|
|
17
|
+
*/
|
|
18
|
+
export declare class SrtTranscriber implements Transcriber {
|
|
19
|
+
private readonly source;
|
|
20
|
+
onProgress?: (event: TranscriberProgressEvent) => void;
|
|
21
|
+
constructor(source: string);
|
|
22
|
+
transcribe(_audio: Blob, _options?: TranscriberOptions): Promise<Document>;
|
|
23
|
+
private buildDocumentFromSource;
|
|
24
|
+
private parseCues;
|
|
25
|
+
private parseCueBlock;
|
|
26
|
+
private findTimecodeLineIndex;
|
|
27
|
+
private parseTimecodeLine;
|
|
28
|
+
private toSeconds;
|
|
29
|
+
private normalizeCueText;
|
|
30
|
+
private buildSegmentFromCue;
|
|
31
|
+
private distributeWordsAcrossCueRange;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=SrtTranscriber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SrtTranscriber.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/SrtTranscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAMtD,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,oCAAoC,CAAC;AAa5C;;;;;;;;;;;;;;GAcG;AACH,qBAAa,cAAe,YAAW,WAAW;IAGpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC;gBAE1B,MAAM,EAAE,MAAM;IAErC,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAKhF,OAAO,CAAC,uBAAuB;IAM/B,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,6BAA6B;CAoBtC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Document } from '../document/Document';
|
|
2
|
+
import { Section } from '../document/Section';
|
|
3
|
+
import { Segment } from '../document/Segment';
|
|
4
|
+
import { Line } from '../document/Line';
|
|
5
|
+
import { Word } from '../document/Word';
|
|
6
|
+
import { TimeFragment } from '../document/TimeFragment';
|
|
7
|
+
const SRT_TIMECODE_RE = /^(\d{1,2}):(\d{2}):(\d{2})[,.](\d{1,3})\s*-->\s*(\d{1,2}):(\d{2}):(\d{2})[,.](\d{1,3})/;
|
|
8
|
+
const FORMATTING_TAG_RE = /<[^>]+>|\{[^}]+\}/g;
|
|
9
|
+
const BOM_RE = /^\uFEFF/;
|
|
10
|
+
/**
|
|
11
|
+
* Builds a Document by parsing a SubRip (SRT) caption file. Each cue
|
|
12
|
+
* becomes one `Segment` carrying the cue's full time range; the cue's
|
|
13
|
+
* text (multi-line entries joined with a space, formatting tags
|
|
14
|
+
* stripped) becomes one `Line` whose `Word` timings are spread across
|
|
15
|
+
* the cue range proportionally to character length, so each word
|
|
16
|
+
* lights up in sequence rather than all at once.
|
|
17
|
+
*
|
|
18
|
+
* The audio Blob passed to `transcribe` is ignored. Useful when the
|
|
19
|
+
* caption text and timing are already known — burning a hand-authored
|
|
20
|
+
* SRT into a video, replaying captions from a previous run, etc.
|
|
21
|
+
*
|
|
22
|
+
* Throws when a timecode is malformed; returns an empty Document when
|
|
23
|
+
* the source contains no parseable cues.
|
|
24
|
+
*/
|
|
25
|
+
export class SrtTranscriber {
|
|
26
|
+
source;
|
|
27
|
+
onProgress;
|
|
28
|
+
constructor(source) {
|
|
29
|
+
this.source = source;
|
|
30
|
+
}
|
|
31
|
+
async transcribe(_audio, _options) {
|
|
32
|
+
this.onProgress?.({ stage: 'inferring', progress: 1 });
|
|
33
|
+
return this.buildDocumentFromSource(this.source);
|
|
34
|
+
}
|
|
35
|
+
buildDocumentFromSource(source) {
|
|
36
|
+
const segments = this.parseCues(source).map((cue) => this.buildSegmentFromCue(cue));
|
|
37
|
+
const section = new Section({ segments, kind: '' });
|
|
38
|
+
return new Document({ sections: [section] });
|
|
39
|
+
}
|
|
40
|
+
parseCues(source) {
|
|
41
|
+
const normalized = source.replace(BOM_RE, '').replace(/\r\n?/g, '\n').trim();
|
|
42
|
+
if (normalized.length === 0)
|
|
43
|
+
return [];
|
|
44
|
+
return normalized
|
|
45
|
+
.split(/\n{2,}/)
|
|
46
|
+
.map((block) => this.parseCueBlock(block))
|
|
47
|
+
.filter((cue) => cue !== null);
|
|
48
|
+
}
|
|
49
|
+
parseCueBlock(block) {
|
|
50
|
+
const lines = block.split('\n').map((l) => l.trim()).filter((l) => l.length > 0);
|
|
51
|
+
if (lines.length === 0)
|
|
52
|
+
return null;
|
|
53
|
+
const timecodeLineIndex = this.findTimecodeLineIndex(lines);
|
|
54
|
+
if (timecodeLineIndex === -1) {
|
|
55
|
+
throw new Error(`SRT block has no timecode line: ${JSON.stringify(block)}`);
|
|
56
|
+
}
|
|
57
|
+
const range = this.parseTimecodeLine(lines[timecodeLineIndex]);
|
|
58
|
+
const text = this.normalizeCueText(lines.slice(timecodeLineIndex + 1));
|
|
59
|
+
if (text.length === 0)
|
|
60
|
+
return null;
|
|
61
|
+
return { startSeconds: range.startSeconds, endSeconds: range.endSeconds, text };
|
|
62
|
+
}
|
|
63
|
+
findTimecodeLineIndex(lines) {
|
|
64
|
+
return lines.findIndex((line) => SRT_TIMECODE_RE.test(line));
|
|
65
|
+
}
|
|
66
|
+
parseTimecodeLine(line) {
|
|
67
|
+
const match = SRT_TIMECODE_RE.exec(line);
|
|
68
|
+
if (match === null)
|
|
69
|
+
throw new Error(`Malformed SRT timecode: ${JSON.stringify(line)}`);
|
|
70
|
+
const startSeconds = this.toSeconds(match[1], match[2], match[3], match[4]);
|
|
71
|
+
const endSeconds = this.toSeconds(match[5], match[6], match[7], match[8]);
|
|
72
|
+
if (endSeconds < startSeconds) {
|
|
73
|
+
throw new Error(`SRT timecode ends before it starts: ${JSON.stringify(line)}`);
|
|
74
|
+
}
|
|
75
|
+
return { startSeconds, endSeconds };
|
|
76
|
+
}
|
|
77
|
+
toSeconds(hours, minutes, seconds, milliseconds) {
|
|
78
|
+
return (Number(hours) * 3600 +
|
|
79
|
+
Number(minutes) * 60 +
|
|
80
|
+
Number(seconds) +
|
|
81
|
+
Number(milliseconds.padEnd(3, '0')) / 1000);
|
|
82
|
+
}
|
|
83
|
+
normalizeCueText(textLines) {
|
|
84
|
+
return textLines.join(' ').replace(FORMATTING_TAG_RE, '').replace(/\s+/g, ' ').trim();
|
|
85
|
+
}
|
|
86
|
+
buildSegmentFromCue(cue) {
|
|
87
|
+
const tokens = cue.text.split(/\s+/).filter((token) => token.length > 0);
|
|
88
|
+
if (tokens.length === 0) {
|
|
89
|
+
return new Segment({ lines: [new Line({ words: [] })] });
|
|
90
|
+
}
|
|
91
|
+
const words = this.distributeWordsAcrossCueRange(tokens, cue.startSeconds, cue.endSeconds);
|
|
92
|
+
return new Segment({ lines: [new Line({ words })] });
|
|
93
|
+
}
|
|
94
|
+
distributeWordsAcrossCueRange(tokens, startSeconds, endSeconds) {
|
|
95
|
+
const totalWeight = tokens.reduce((sum, token) => sum + token.length, 0);
|
|
96
|
+
const cueDuration = endSeconds - startSeconds;
|
|
97
|
+
if (totalWeight === 0 || cueDuration <= 0) {
|
|
98
|
+
return tokens.map((token) => new Word({ text: token, time: new TimeFragment(startSeconds, endSeconds) }));
|
|
99
|
+
}
|
|
100
|
+
const words = [];
|
|
101
|
+
let elapsedWeight = 0;
|
|
102
|
+
for (const token of tokens) {
|
|
103
|
+
const wordStart = startSeconds + (elapsedWeight / totalWeight) * cueDuration;
|
|
104
|
+
elapsedWeight += token.length;
|
|
105
|
+
const wordEnd = startSeconds + (elapsedWeight / totalWeight) * cueDuration;
|
|
106
|
+
words.push(new Word({ text: token, time: new TimeFragment(wordStart, wordEnd) }));
|
|
107
|
+
}
|
|
108
|
+
return words;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=SrtTranscriber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SrtTranscriber.js","sourceRoot":"","sources":["../../../src/modules/transcription/SrtTranscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAO9D,MAAM,eAAe,GACnB,wFAAwF,CAAC;AAC3F,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAC/C,MAAM,MAAM,GAAG,SAAS,CAAC;A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AG,WAAW,CAAC;YAC7E,aAAa,IAAI,KAAK,CAAC,MAAM,CAAC;YAC9B,MAAM,OAAO,GAAG,YAAY,GAAG,CAAC,aAAa,GAAG,WAAW,CAAC,GAAG,WAAW,CAAC;YAC3E,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Document } from '../document/index';
|
|
2
|
+
export interface TranscriberOptions {
|
|
3
|
+
language?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Progress signal emitted by a `Transcriber`. The `loading` stage covers
|
|
7
|
+
* model or asset acquisition and reports a real `[0, 1]` value. The
|
|
8
|
+
* `inferring` stage covers the actual transcription pass and may carry a
|
|
9
|
+
* real progress value when the underlying implementation exposes one;
|
|
10
|
+
* many do not, in which case the field is omitted.
|
|
11
|
+
*/
|
|
12
|
+
export type TranscriberProgressEvent = {
|
|
13
|
+
stage: 'loading';
|
|
14
|
+
progress: number;
|
|
15
|
+
} | {
|
|
16
|
+
stage: 'inferring';
|
|
17
|
+
progress?: number;
|
|
18
|
+
};
|
|
19
|
+
export interface Transcriber {
|
|
20
|
+
onProgress?: (event: TranscriberProgressEvent) => void;
|
|
21
|
+
transcribe(audio: Blob, options?: TranscriberOptions): Promise<Document>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=Transcriber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Transcriber.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/Transcriber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAChC;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9C,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC;IACvD,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Transcriber.js","sourceRoot":"","sources":["../../../src/modules/transcription/Transcriber.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Document } from '../document/index';
|
|
2
|
+
import type { AudioDecoder } from '../transcription/AudioDecoder';
|
|
3
|
+
import type { Transcriber, TranscriberOptions, TranscriberProgressEvent } from '../transcription/Transcriber';
|
|
4
|
+
export declare const WHISPER_SAMPLE_RATE = 16000;
|
|
5
|
+
export type WhisperModel = 'tiny' | 'base' | 'small' | 'distil-small.en' | 'distil-medium.en';
|
|
6
|
+
export type WhisperDevice = 'auto' | 'wasm' | 'webgpu';
|
|
7
|
+
export interface WhisperTranscriberConfig {
|
|
8
|
+
model?: WhisperModel;
|
|
9
|
+
device?: WhisperDevice;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Client-side Whisper transcriber, powered by @huggingface/transformers.js.
|
|
13
|
+
* Model weights are downloaded from HuggingFace Hub and cached in the browser
|
|
14
|
+
* on first use.
|
|
15
|
+
*
|
|
16
|
+
* The default `device: 'auto'` probes for WebGPU at load time and falls back
|
|
17
|
+
* to WASM.
|
|
18
|
+
*
|
|
19
|
+
* Audio decoding is delegated to an injected AudioDecoder so this class can
|
|
20
|
+
* run in any context: on the main thread with a Web-Audio-backed decoder, or
|
|
21
|
+
* in a Web Worker (where browser audio APIs are unavailable) with a pre-
|
|
22
|
+
* decoded byte-stream decoder.
|
|
23
|
+
*
|
|
24
|
+
* Progress reporting is real-only: the loading stage tracks model weight
|
|
25
|
+
* download from HuggingFace; the inferring stage emits a single boundary
|
|
26
|
+
* event when inference begins, since the underlying pipeline exposes no
|
|
27
|
+
* usable per-chunk hook in v4.
|
|
28
|
+
*/
|
|
29
|
+
export declare class WhisperTranscriber implements Transcriber {
|
|
30
|
+
private readonly decoder;
|
|
31
|
+
private readonly model;
|
|
32
|
+
private readonly device;
|
|
33
|
+
private pipelinePromise;
|
|
34
|
+
constructor(decoder: AudioDecoder, { model, device }?: WhisperTranscriberConfig);
|
|
35
|
+
onProgress?: (event: TranscriberProgressEvent) => void;
|
|
36
|
+
transcribe(audio: Blob, options?: TranscriberOptions): Promise<Document>;
|
|
37
|
+
private loadPipeline;
|
|
38
|
+
private resolveDevice;
|
|
39
|
+
private isWebGPUAvailable;
|
|
40
|
+
private buildPipelineOptions;
|
|
41
|
+
private handleLoadProgress;
|
|
42
|
+
private buildDocument;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=WhisperTranscriber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WhisperTranscriber.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/WhisperTranscriber.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAA8C,MAAM,yBAAyB,CAAC;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,oCAAoC,CAAC;AAE5C,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,iBAAiB,GACjB,kBAAkB,CAAC;AAEvB,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEvD,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AA2DD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,kBAAmB,YAAW,WAAW;IAMlD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAL1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IACvC,OAAO,CAAC,eAAe,CAA4C;gBAGhD,OAAO,EAAE,YAAY,EACtC,EAAE,KAAc,EAAE,MAAe,EAAE,GAAE,wBAA6B;IAOpE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAEjD,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAe9E,OAAO,CAAC,YAAY;YAoBN,aAAa;YAoBb,iBAAiB;IAW/B,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,aAAa;CAatB"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { pipeline, env } from '@huggingface/transformers';
|
|
2
|
+
import { Document, Section, Segment, Line, Word, TimeFragment } from '../document/index';
|
|
3
|
+
export const WHISPER_SAMPLE_RATE = 16_000;
|
|
4
|
+
const MODEL_IDS = {
|
|
5
|
+
'tiny': 'onnx-community/whisper-tiny_timestamped',
|
|
6
|
+
'base': 'onnx-community/whisper-base_timestamped',
|
|
7
|
+
'small': 'onnx-community/whisper-small_timestamped',
|
|
8
|
+
'distil-small.en': 'distil-whisper/distil-small.en',
|
|
9
|
+
'distil-medium.en': 'distil-whisper/distil-medium.en',
|
|
10
|
+
};
|
|
11
|
+
const CHUNK_CONFIG = {
|
|
12
|
+
'tiny': { chunk_length_s: 30, stride_length_s: 5 },
|
|
13
|
+
'base': { chunk_length_s: 30, stride_length_s: 5 },
|
|
14
|
+
'small': { chunk_length_s: 30, stride_length_s: 5 },
|
|
15
|
+
'distil-small.en': { chunk_length_s: 20, stride_length_s: 3 },
|
|
16
|
+
'distil-medium.en': { chunk_length_s: 20, stride_length_s: 3 },
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Per-model dtype table indexed by resolved device. `webgpu: null` means the
|
|
20
|
+
* model's repository does not ship a dtype that works on WebGPU and the
|
|
21
|
+
* model must run on WASM.
|
|
22
|
+
*
|
|
23
|
+
* On WebGPU we quantize the decoder to q4 (encoder stays fp32; Whisper is
|
|
24
|
+
* very sensitive to encoder quantization). The GPU's compute units benefit
|
|
25
|
+
* from low-bit weights — bandwidth is the bottleneck there, so q4 gives a
|
|
26
|
+
* 2-4× win.
|
|
27
|
+
*
|
|
28
|
+
* On WASM we run everything at fp32. Counter-intuitively, q4 is SLOWER
|
|
29
|
+
* than fp32 on WASM for Whisper-base-sized models.
|
|
30
|
+
*
|
|
31
|
+
* INT8 dtypes (`q8`, `int8`, `uint8`) are also unusable on WASM for a
|
|
32
|
+
* separate reason — see huggingface/transformers.js#1635.
|
|
33
|
+
* If #1635 ever closes, q8 on WASM is worth re-benchmarking.
|
|
34
|
+
*
|
|
35
|
+
* The distil-whisper repos don't ship the dtypes WebGPU needs
|
|
36
|
+
* (huggingface/transformers.js#1317), so they stay on WASM at q8.
|
|
37
|
+
*/
|
|
38
|
+
const DTYPE_BY_DEVICE = {
|
|
39
|
+
'tiny': { wasm: 'fp32', webgpu: { encoder_model: 'fp32', decoder_model_merged: 'q4' } },
|
|
40
|
+
'base': { wasm: 'fp32', webgpu: { encoder_model: 'fp32', decoder_model_merged: 'q4' } },
|
|
41
|
+
'small': { wasm: 'fp32', webgpu: { encoder_model: 'fp32', decoder_model_merged: 'q4' } },
|
|
42
|
+
'distil-small.en': { wasm: 'q8', webgpu: null },
|
|
43
|
+
'distil-medium.en': { wasm: 'q8', webgpu: null },
|
|
44
|
+
};
|
|
45
|
+
// transformers.js fires both `progress` (per-file) and `progress_total`
|
|
46
|
+
// (aggregate across all files) on the same callback. The per-file event
|
|
47
|
+
// jumps each time a new file starts (it resets to 0), so we listen only
|
|
48
|
+
// to the aggregate. See @huggingface/transformers `DefaultProgressCallback`.
|
|
49
|
+
const AGGREGATE_LOAD_STATUS = 'progress_total';
|
|
50
|
+
/**
|
|
51
|
+
* Client-side Whisper transcriber, powered by @huggingface/transformers.js.
|
|
52
|
+
* Model weights are downloaded from HuggingFace Hub and cached in the browser
|
|
53
|
+
* on first use.
|
|
54
|
+
*
|
|
55
|
+
* The default `device: 'auto'` probes for WebGPU at load time and falls back
|
|
56
|
+
* to WASM.
|
|
57
|
+
*
|
|
58
|
+
* Audio decoding is delegated to an injected AudioDecoder so this class can
|
|
59
|
+
* run in any context: on the main thread with a Web-Audio-backed decoder, or
|
|
60
|
+
* in a Web Worker (where browser audio APIs are unavailable) with a pre-
|
|
61
|
+
* decoded byte-stream decoder.
|
|
62
|
+
*
|
|
63
|
+
* Progress reporting is real-only: the loading stage tracks model weight
|
|
64
|
+
* download from HuggingFace; the inferring stage emits a single boundary
|
|
65
|
+
* event when inference begins, since the underlying pipeline exposes no
|
|
66
|
+
* usable per-chunk hook in v4.
|
|
67
|
+
*/
|
|
68
|
+
export class WhisperTranscriber {
|
|
69
|
+
decoder;
|
|
70
|
+
model;
|
|
71
|
+
device;
|
|
72
|
+
pipelinePromise = null;
|
|
73
|
+
constructor(decoder, { model = 'base', device = 'auto' } = {}) {
|
|
74
|
+
this.decoder = decoder;
|
|
75
|
+
this.model = model;
|
|
76
|
+
this.device = device;
|
|
77
|
+
env.allowLocalModels = false;
|
|
78
|
+
}
|
|
79
|
+
onProgress;
|
|
80
|
+
async transcribe(audio, options) {
|
|
81
|
+
const transcriber = await this.loadPipeline();
|
|
82
|
+
const pcm = await this.decoder.decode(audio, WHISPER_SAMPLE_RATE);
|
|
83
|
+
this.onProgress?.({ stage: 'inferring' });
|
|
84
|
+
console.time('whisper.inference');
|
|
85
|
+
const result = (await transcriber(pcm, this.buildPipelineOptions(options)));
|
|
86
|
+
console.timeEnd('whisper.inference');
|
|
87
|
+
return this.buildDocument(result.chunks ?? []);
|
|
88
|
+
}
|
|
89
|
+
loadPipeline() {
|
|
90
|
+
if (this.pipelinePromise === null) {
|
|
91
|
+
this.pipelinePromise = (async () => {
|
|
92
|
+
const device = await this.resolveDevice();
|
|
93
|
+
console.log(`Using device "${device}" for Whisper model "${this.model}".`);
|
|
94
|
+
const dtype = DTYPE_BY_DEVICE[this.model][device];
|
|
95
|
+
return pipeline('automatic-speech-recognition', MODEL_IDS[this.model], {
|
|
96
|
+
device,
|
|
97
|
+
dtype: dtype,
|
|
98
|
+
progress_callback: (data) => this.handleLoadProgress(data),
|
|
99
|
+
});
|
|
100
|
+
})();
|
|
101
|
+
}
|
|
102
|
+
return this.pipelinePromise;
|
|
103
|
+
}
|
|
104
|
+
async resolveDevice() {
|
|
105
|
+
const webgpuSupportedByModel = DTYPE_BY_DEVICE[this.model].webgpu !== null;
|
|
106
|
+
if (this.device === 'wasm')
|
|
107
|
+
return 'wasm';
|
|
108
|
+
if (this.device === 'webgpu') {
|
|
109
|
+
if (!webgpuSupportedByModel) {
|
|
110
|
+
throw new Error(`Whisper model "${this.model}" does not support WebGPU; use 'wasm' or 'auto'.`);
|
|
111
|
+
}
|
|
112
|
+
if (!(await this.isWebGPUAvailable())) {
|
|
113
|
+
throw new Error('WebGPU is not available in this browser. Ensure WebGPU is enabled and supported by your browser. Otherwise, switch to CPU in Advanced settings.');
|
|
114
|
+
}
|
|
115
|
+
return 'webgpu';
|
|
116
|
+
}
|
|
117
|
+
if (!webgpuSupportedByModel)
|
|
118
|
+
return 'wasm';
|
|
119
|
+
return (await this.isWebGPUAvailable()) ? 'webgpu' : 'wasm';
|
|
120
|
+
}
|
|
121
|
+
async isWebGPUAvailable() {
|
|
122
|
+
try {
|
|
123
|
+
const gpu = navigator.gpu;
|
|
124
|
+
if (!gpu)
|
|
125
|
+
return false;
|
|
126
|
+
const adapter = await gpu.requestAdapter();
|
|
127
|
+
return adapter !== null;
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
buildPipelineOptions(options) {
|
|
134
|
+
return {
|
|
135
|
+
sampling_rate: WHISPER_SAMPLE_RATE,
|
|
136
|
+
return_timestamps: 'word',
|
|
137
|
+
language: options?.language ?? null,
|
|
138
|
+
task: 'transcribe',
|
|
139
|
+
...CHUNK_CONFIG[this.model],
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
handleLoadProgress(data) {
|
|
143
|
+
if (data.status === AGGREGATE_LOAD_STATUS && data.progress !== undefined) {
|
|
144
|
+
this.onProgress?.({
|
|
145
|
+
stage: 'loading',
|
|
146
|
+
progress: data.progress / 100,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
buildDocument(chunks) {
|
|
151
|
+
const words = chunks
|
|
152
|
+
.map(({ text, timestamp: [start, end] }) => new Word({ text: text.trim(), time: new TimeFragment(start ?? 0, end ?? start ?? 0) }))
|
|
153
|
+
.filter((w) => w.text.length > 0);
|
|
154
|
+
return new Document({
|
|
155
|
+
sections: [new Section({
|
|
156
|
+
segments: [new Segment({ lines: [new Line({ words })] })],
|
|
157
|
+
kind: '',
|
|
158
|
+
})],
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=WhisperTranscriber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WhisperTranscriber.js","sourceRoot":"","sources":["../../../src/modules/transcription/WhisperTranscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;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,EAAE,IAAI,YAAY,CAAC,KAAK,IAAI,CAAC,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC,CACvF;aACA,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpC,OAAO,IAAI,QAAQ,CAAC;YAClB,QAAQ,EAAE,CAAC,IAAI,OAAO,CAAC;oBACrB,QAAQ,EAAE,CAAC,IAAI,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;oBACzD,IAAI,EAAE,EAAE;iBACT,CAAC,CAAC;SACJ,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { Transcriber, TranscriberOptions, TranscriberProgressEvent, } from '../transcription/Transcriber';
|
|
2
|
+
export type { AudioDecoder } from '../transcription/AudioDecoder';
|
|
3
|
+
export { PreDecodedAudioDecoder } from '../transcription/PreDecodedAudioDecoder';
|
|
4
|
+
export { BrowserAudioDecoder } from '../transcription/BrowserAudioDecoder';
|
|
5
|
+
export { PassthroughTranscriber } from '../transcription/PassthroughTranscriber';
|
|
6
|
+
export { SrtTranscriber } from '../transcription/SrtTranscriber';
|
|
7
|
+
export { WhisperTranscriber, WHISPER_SAMPLE_RATE, type WhisperModel, type WhisperDevice, type WhisperTranscriberConfig, } from '../transcription/WhisperTranscriber';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,wBAAwB,GAC9B,MAAM,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { PreDecodedAudioDecoder } from '../transcription/PreDecodedAudioDecoder';
|
|
2
|
+
export { BrowserAudioDecoder } from '../transcription/BrowserAudioDecoder';
|
|
3
|
+
export { PassthroughTranscriber } from '../transcription/PassthroughTranscriber';
|
|
4
|
+
export { SrtTranscriber } from '../transcription/SrtTranscriber';
|
|
5
|
+
export { WhisperTranscriber, WHISPER_SAMPLE_RATE, } from '../transcription/WhisperTranscriber';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/transcription/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GAIpB,MAAM,2CAA2C,CAAC"}
|