@tscaps/engine 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -10
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/bidi/BidiAnalyzer.d.ts +23 -0
- package/dist/modules/bidi/BidiAnalyzer.d.ts.map +1 -0
- package/dist/modules/bidi/BidiAnalyzer.js +2 -0
- package/dist/modules/bidi/BidiAnalyzer.js.map +1 -0
- package/dist/modules/bidi/BidiCharacterClassifier.d.ts +13 -0
- package/dist/modules/bidi/BidiCharacterClassifier.d.ts.map +1 -0
- package/dist/modules/bidi/BidiCharacterClassifier.js +2 -0
- package/dist/modules/bidi/BidiCharacterClassifier.js.map +1 -0
- package/dist/modules/bidi/BidiJsAnalyzer.d.ts +14 -0
- package/dist/modules/bidi/BidiJsAnalyzer.d.ts.map +1 -0
- package/dist/modules/bidi/BidiJsAnalyzer.js +19 -0
- package/dist/modules/bidi/BidiJsAnalyzer.js.map +1 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts +8 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts.map +1 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.js +19 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.js.map +1 -0
- package/dist/modules/bidi/CursiveScriptDetector.d.ts +12 -0
- package/dist/modules/bidi/CursiveScriptDetector.d.ts.map +1 -0
- package/dist/modules/bidi/CursiveScriptDetector.js +20 -0
- package/dist/modules/bidi/CursiveScriptDetector.js.map +1 -0
- package/dist/modules/bidi/HorizontalSide.d.ts +18 -0
- package/dist/modules/bidi/HorizontalSide.d.ts.map +1 -0
- package/dist/modules/bidi/HorizontalSide.js +3 -0
- package/dist/modules/bidi/HorizontalSide.js.map +1 -0
- package/dist/modules/bidi/HorizontalSideResolver.d.ts +21 -0
- package/dist/modules/bidi/HorizontalSideResolver.d.ts.map +1 -0
- package/dist/modules/bidi/HorizontalSideResolver.js +27 -0
- package/dist/modules/bidi/HorizontalSideResolver.js.map +1 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts +24 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts.map +1 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js +34 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js.map +1 -0
- package/dist/modules/bidi/TextDirection.d.ts +9 -0
- package/dist/modules/bidi/TextDirection.d.ts.map +1 -0
- package/dist/modules/bidi/TextDirection.js +2 -0
- package/dist/modules/bidi/TextDirection.js.map +1 -0
- package/dist/modules/bidi/TextDirectionDetector.d.ts +12 -0
- package/dist/modules/bidi/TextDirectionDetector.d.ts.map +1 -0
- package/dist/modules/bidi/TextDirectionDetector.js +2 -0
- package/dist/modules/bidi/TextDirectionDetector.js.map +1 -0
- package/dist/modules/bidi/WordFragment.d.ts +34 -0
- package/dist/modules/bidi/WordFragment.d.ts.map +1 -0
- package/dist/modules/bidi/WordFragment.js +2 -0
- package/dist/modules/bidi/WordFragment.js.map +1 -0
- package/dist/modules/bidi/WordFragmenter.d.ts +43 -0
- package/dist/modules/bidi/WordFragmenter.d.ts.map +1 -0
- package/dist/modules/bidi/WordFragmenter.js +112 -0
- package/dist/modules/bidi/WordFragmenter.js.map +1 -0
- package/dist/modules/bidi/index.d.ts +14 -0
- package/dist/modules/bidi/index.d.ts.map +1 -0
- package/dist/modules/bidi/index.js +8 -0
- package/dist/modules/bidi/index.js.map +1 -0
- package/dist/modules/css/CssBlockSealer.d.ts +30 -0
- package/dist/modules/css/CssBlockSealer.d.ts.map +1 -0
- package/dist/modules/css/CssBlockSealer.js +64 -0
- package/dist/modules/css/CssBlockSealer.js.map +1 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts +13 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts.map +1 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.js +24 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.js.map +1 -0
- package/dist/modules/css/CssFilterReferenceScanner.d.ts +15 -0
- package/dist/modules/css/CssFilterReferenceScanner.d.ts.map +1 -0
- package/dist/modules/css/CssFilterReferenceScanner.js +22 -0
- package/dist/modules/css/CssFilterReferenceScanner.js.map +1 -0
- package/dist/modules/css/CssFragmentParser.d.ts +53 -0
- package/dist/modules/css/CssFragmentParser.d.ts.map +1 -0
- package/dist/modules/css/CssFragmentParser.js +127 -0
- package/dist/modules/css/CssFragmentParser.js.map +1 -0
- package/dist/modules/css/CssKeyframeNamespacer.d.ts +21 -0
- package/dist/modules/css/CssKeyframeNamespacer.d.ts.map +1 -0
- package/dist/modules/css/CssKeyframeNamespacer.js +48 -0
- package/dist/modules/css/CssKeyframeNamespacer.js.map +1 -0
- package/dist/modules/css/CssKeyframesScanner.d.ts +29 -0
- package/dist/modules/css/CssKeyframesScanner.d.ts.map +1 -0
- package/dist/modules/css/CssKeyframesScanner.js +102 -0
- package/dist/modules/css/CssKeyframesScanner.js.map +1 -0
- package/dist/modules/css/CssLayer.d.ts +20 -0
- package/dist/modules/css/CssLayer.d.ts.map +1 -0
- package/dist/modules/css/CssLayer.js +21 -0
- package/dist/modules/css/CssLayer.js.map +1 -0
- package/dist/modules/css/CssScoper.d.ts +31 -2
- package/dist/modules/css/CssScoper.d.ts.map +1 -1
- package/dist/modules/css/CssScoper.js +168 -79
- package/dist/modules/css/CssScoper.js.map +1 -1
- package/dist/modules/css/CssSelectorClassScanner.d.ts +25 -0
- package/dist/modules/css/CssSelectorClassScanner.d.ts.map +1 -0
- package/dist/modules/css/CssSelectorClassScanner.js +91 -0
- package/dist/modules/css/CssSelectorClassScanner.js.map +1 -0
- package/dist/modules/css/CssVarReferenceScanner.d.ts +16 -0
- package/dist/modules/css/CssVarReferenceScanner.d.ts.map +1 -0
- package/dist/modules/css/CssVarReferenceScanner.js +27 -0
- package/dist/modules/css/CssVarReferenceScanner.js.map +1 -0
- package/dist/modules/css/index.d.ts +9 -0
- package/dist/modules/css/index.d.ts.map +1 -1
- package/dist/modules/css/index.js +9 -0
- package/dist/modules/css/index.js.map +1 -1
- package/dist/modules/document/CssClass.d.ts +20 -0
- package/dist/modules/document/CssClass.d.ts.map +1 -0
- package/dist/modules/document/CssClass.js +21 -0
- package/dist/modules/document/CssClass.js.map +1 -0
- package/dist/modules/document/CssVariable.d.ts +21 -6
- package/dist/modules/document/CssVariable.d.ts.map +1 -1
- package/dist/modules/document/CssVariable.js +27 -5
- package/dist/modules/document/CssVariable.js.map +1 -1
- package/dist/modules/document/DataAttribute.d.ts +26 -0
- package/dist/modules/document/DataAttribute.d.ts.map +1 -0
- package/dist/modules/document/DataAttribute.js +27 -0
- package/dist/modules/document/DataAttribute.js.map +1 -0
- package/dist/modules/document/Decoration.d.ts +42 -0
- package/dist/modules/document/Decoration.d.ts.map +1 -0
- package/dist/modules/document/Decoration.js +52 -0
- package/dist/modules/document/Decoration.js.map +1 -0
- package/dist/modules/document/Document.d.ts.map +1 -1
- package/dist/modules/document/Document.js +0 -3
- package/dist/modules/document/Document.js.map +1 -1
- package/dist/modules/document/DocumentEditor.d.ts +51 -9
- package/dist/modules/document/DocumentEditor.d.ts.map +1 -1
- package/dist/modules/document/DocumentEditor.js +118 -26
- package/dist/modules/document/DocumentEditor.js.map +1 -1
- package/dist/modules/document/DocumentNodeId.d.ts +23 -0
- package/dist/modules/document/DocumentNodeId.d.ts.map +1 -0
- package/dist/modules/document/DocumentNodeId.js +31 -0
- package/dist/modules/document/DocumentNodeId.js.map +1 -0
- package/dist/modules/document/Line.d.ts +10 -7
- package/dist/modules/document/Line.d.ts.map +1 -1
- package/dist/modules/document/Line.js +13 -25
- package/dist/modules/document/Line.js.map +1 -1
- package/dist/modules/document/Section.d.ts +1 -8
- package/dist/modules/document/Section.d.ts.map +1 -1
- package/dist/modules/document/Section.js +4 -35
- package/dist/modules/document/Section.js.map +1 -1
- package/dist/modules/document/Segment.d.ts +24 -14
- package/dist/modules/document/Segment.d.ts.map +1 -1
- package/dist/modules/document/Segment.js +41 -23
- package/dist/modules/document/Segment.js.map +1 -1
- package/dist/modules/document/Word.d.ts +21 -8
- package/dist/modules/document/Word.d.ts.map +1 -1
- package/dist/modules/document/Word.js +34 -35
- package/dist/modules/document/Word.js.map +1 -1
- package/dist/modules/document/index.d.ts +5 -2
- package/dist/modules/document/index.d.ts.map +1 -1
- package/dist/modules/document/index.js +4 -1
- package/dist/modules/document/index.js.map +1 -1
- package/dist/modules/effect/CarryQuotesEffect.d.ts +1 -7
- package/dist/modules/effect/CarryQuotesEffect.d.ts.map +1 -1
- package/dist/modules/effect/CarryQuotesEffect.js +17 -30
- package/dist/modules/effect/CarryQuotesEffect.js.map +1 -1
- package/dist/modules/effect/GapFreeEffect.d.ts +15 -0
- package/dist/modules/effect/GapFreeEffect.d.ts.map +1 -1
- package/dist/modules/effect/GapFreeEffect.js +29 -4
- package/dist/modules/effect/GapFreeEffect.js.map +1 -1
- package/dist/modules/effect/RemovePunctuationEffect.d.ts +10 -2
- package/dist/modules/effect/RemovePunctuationEffect.d.ts.map +1 -1
- package/dist/modules/effect/RemovePunctuationEffect.js +26 -6
- package/dist/modules/effect/RemovePunctuationEffect.js.map +1 -1
- package/dist/modules/effect/SmartLowercaseEffect.d.ts +7 -6
- package/dist/modules/effect/SmartLowercaseEffect.d.ts.map +1 -1
- package/dist/modules/effect/SmartLowercaseEffect.js +11 -7
- package/dist/modules/effect/SmartLowercaseEffect.js.map +1 -1
- package/dist/modules/pipeline/RenderPipelineBuilder.d.ts +3 -3
- package/dist/modules/pipeline/RenderPipelineBuilder.d.ts.map +1 -1
- package/dist/modules/pipeline/RenderPipelineBuilder.js +13 -8
- package/dist/modules/pipeline/RenderPipelineBuilder.js.map +1 -1
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts +19 -25
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js +43 -717
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js.map +1 -1
- package/dist/modules/rendering/HorizontalPlacementResolver.d.ts +27 -0
- package/dist/modules/rendering/HorizontalPlacementResolver.d.ts.map +1 -0
- package/dist/modules/rendering/HorizontalPlacementResolver.js +31 -0
- package/dist/modules/rendering/HorizontalPlacementResolver.js.map +1 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts +10 -5
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/index.d.ts +16 -8
- package/dist/modules/rendering/index.d.ts.map +1 -1
- package/dist/modules/rendering/index.js +8 -2
- package/dist/modules/rendering/index.js.map +1 -1
- package/dist/modules/rendering/styles/BaselineCssComposer.d.ts +41 -0
- package/dist/modules/rendering/styles/BaselineCssComposer.d.ts.map +1 -0
- package/dist/modules/rendering/styles/BaselineCssComposer.js +64 -0
- package/dist/modules/rendering/styles/BaselineCssComposer.js.map +1 -0
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.d.ts +7 -0
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.d.ts.map +1 -0
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js +35 -0
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js.map +1 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.d.ts +28 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.d.ts.map +1 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.js +28 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.js.map +1 -0
- package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts +20 -0
- package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts.map +1 -0
- package/dist/modules/rendering/styles/InlineStyleEmitter.js +44 -0
- package/dist/modules/rendering/styles/InlineStyleEmitter.js.map +1 -0
- package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.d.ts +15 -0
- package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.d.ts.map +1 -0
- package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.js +33 -0
- package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.js.map +1 -0
- package/dist/modules/rendering/{VideoFrameLayerClass.d.ts → styles/VideoFrameLayerBaselineCss.d.ts} +3 -10
- package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.d.ts.map +1 -0
- package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js +15 -0
- package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js.map +1 -0
- package/dist/modules/rendering/subtitle/AbstractAnim.d.ts +13 -0
- package/dist/modules/rendering/subtitle/AbstractAnim.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/AbstractAnim.js +2 -0
- package/dist/modules/rendering/subtitle/AbstractAnim.js.map +1 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSession.d.ts +20 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSession.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSession.js +31 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSession.js.map +1 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts +21 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js +46 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js.map +1 -0
- package/dist/modules/rendering/subtitle/AnimationProbe.d.ts +39 -0
- package/dist/modules/rendering/subtitle/AnimationProbe.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/AnimationProbe.js +203 -0
- package/dist/modules/rendering/subtitle/AnimationProbe.js.map +1 -0
- package/dist/modules/rendering/subtitle/AssetGroupBuilder.d.ts +15 -0
- package/dist/modules/rendering/subtitle/AssetGroupBuilder.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/AssetGroupBuilder.js +26 -0
- package/dist/modules/rendering/subtitle/AssetGroupBuilder.js.map +1 -0
- package/dist/modules/rendering/subtitle/BatchPlan.d.ts +32 -0
- package/dist/modules/rendering/subtitle/BatchPlan.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/BatchPlan.js +2 -0
- package/dist/modules/rendering/subtitle/BatchPlan.js.map +1 -0
- package/dist/modules/rendering/subtitle/BatchPlanner.d.ts +32 -0
- package/dist/modules/rendering/subtitle/BatchPlanner.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/BatchPlanner.js +93 -0
- package/dist/modules/rendering/subtitle/BatchPlanner.js.map +1 -0
- package/dist/modules/rendering/subtitle/PreparedStyle.d.ts +36 -0
- package/dist/modules/rendering/subtitle/PreparedStyle.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/PreparedStyle.js +2 -0
- package/dist/modules/rendering/subtitle/PreparedStyle.js.map +1 -0
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.d.ts +31 -0
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.js +91 -0
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.js.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.d.ts +13 -0
- package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.js +24 -0
- package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.js.map +1 -0
- package/dist/modules/rendering/{SegmentPaintRegionResolver.d.ts → subtitle/SegmentPaintRegionResolver.d.ts} +1 -1
- package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.d.ts.map +1 -0
- package/dist/modules/rendering/{SegmentPaintRegionResolver.js → subtitle/SegmentPaintRegionResolver.js} +7 -4
- package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.js.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.d.ts +45 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.js +50 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.js.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts +108 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js +246 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts +40 -0
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js +132 -0
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts +48 -0
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js +143 -0
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.d.ts +17 -0
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.js +58 -0
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.js.map +1 -0
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts +20 -0
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js +30 -0
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js.map +1 -0
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.d.ts +42 -0
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js +121 -0
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js.map +1 -0
- package/dist/modules/rendering/types/AlignmentConfig.d.ts +33 -0
- package/dist/modules/rendering/types/AlignmentConfig.d.ts.map +1 -0
- package/dist/modules/rendering/types/AlignmentConfig.js +3 -0
- package/dist/modules/rendering/types/AlignmentConfig.js.map +1 -0
- package/dist/modules/rendering/types/BoxEdges.d.ts.map +1 -0
- package/dist/modules/rendering/types/BoxEdges.js.map +1 -0
- package/dist/modules/rendering/types/DecorationPlacementSide.d.ts +8 -0
- package/dist/modules/rendering/types/DecorationPlacementSide.d.ts.map +1 -0
- package/dist/modules/rendering/types/DecorationPlacementSide.js +2 -0
- package/dist/modules/rendering/types/DecorationPlacementSide.js.map +1 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.d.ts +23 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.d.ts.map +1 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.js +52 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.js.map +1 -0
- package/dist/modules/rendering/types/InlineStyleMap.d.ts.map +1 -0
- package/dist/modules/rendering/types/InlineStyleMap.js.map +1 -0
- package/dist/modules/rendering/{RenderingConfig.d.ts → types/RenderingConfig.d.ts} +8 -1
- package/dist/modules/rendering/types/RenderingConfig.d.ts.map +1 -0
- package/dist/modules/rendering/types/RenderingConfig.js.map +1 -0
- package/dist/modules/rendering/types/ScopedRenderOverride.d.ts +24 -0
- package/dist/modules/rendering/types/ScopedRenderOverride.d.ts.map +1 -0
- package/dist/modules/rendering/types/ScopedRenderOverride.js.map +1 -0
- package/dist/modules/rendering/types/VideoFrameSource.d.ts.map +1 -0
- package/dist/modules/rendering/types/VideoFrameSource.js.map +1 -0
- package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.d.ts +33 -0
- package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.js +100 -0
- package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/FixedTailLineSplitter.d.ts +29 -0
- package/dist/modules/splitting/FixedTailLineSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/FixedTailLineSplitter.js +43 -0
- package/dist/modules/splitting/FixedTailLineSplitter.js.map +1 -0
- package/dist/modules/splitting/index.d.ts +4 -0
- package/dist/modules/splitting/index.d.ts.map +1 -1
- package/dist/modules/splitting/index.js +2 -0
- package/dist/modules/splitting/index.js.map +1 -1
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts +53 -0
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js +133 -0
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts +20 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js +31 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts +21 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js +33 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCue.d.ts +18 -0
- package/dist/modules/subtitle-file/SubtitleCue.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCue.js +20 -0
- package/dist/modules/subtitle-file/SubtitleCue.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts +38 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.js +106 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.d.ts +17 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.js +2 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts +36 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.js +44 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.d.ts +11 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.js +2 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleRow.d.ts +11 -0
- package/dist/modules/subtitle-file/SubtitleRow.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleRow.js +14 -0
- package/dist/modules/subtitle-file/SubtitleRow.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleToken.d.ts +13 -0
- package/dist/modules/subtitle-file/SubtitleToken.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleToken.js +15 -0
- package/dist/modules/subtitle-file/SubtitleToken.js.map +1 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts +19 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js +24 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/Timecode.d.ts +20 -0
- package/dist/modules/subtitle-file/Timecode.d.ts.map +1 -0
- package/dist/modules/subtitle-file/Timecode.js +32 -0
- package/dist/modules/subtitle-file/Timecode.js.map +1 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts +22 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js +57 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts +21 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js +39 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/index.d.ts +10 -0
- package/dist/modules/subtitle-file/index.d.ts.map +1 -0
- package/dist/modules/subtitle-file/index.js +8 -0
- package/dist/modules/subtitle-file/index.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilter.d.ts +8 -1
- package/dist/modules/svg-filter/SvgFilter.d.ts.map +1 -1
- package/dist/modules/svg-filter/SvgFilter.js +9 -1
- package/dist/modules/svg-filter/SvgFilter.js.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js +9 -1
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts +44 -0
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.js +47 -0
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.js.map +1 -0
- package/dist/modules/svg-filter/index.d.ts +2 -0
- package/dist/modules/svg-filter/index.d.ts.map +1 -1
- package/dist/modules/svg-filter/index.js +1 -0
- package/dist/modules/svg-filter/index.js.map +1 -1
- package/dist/modules/tagging/PauseTagger.d.ts +24 -0
- package/dist/modules/tagging/PauseTagger.d.ts.map +1 -0
- package/dist/modules/tagging/PauseTagger.js +42 -0
- package/dist/modules/tagging/PauseTagger.js.map +1 -0
- package/dist/modules/tagging/RegexTagger.js +1 -1
- package/dist/modules/tagging/RegexTagger.js.map +1 -1
- package/dist/modules/tagging/SpanTagger.js +1 -1
- package/dist/modules/tagging/SpanTagger.js.map +1 -1
- package/dist/modules/tagging/StructureTagger.d.ts +1 -2
- package/dist/modules/tagging/StructureTagger.d.ts.map +1 -1
- package/dist/modules/tagging/StructureTagger.js +12 -11
- package/dist/modules/tagging/StructureTagger.js.map +1 -1
- package/dist/modules/tagging/WordlistTagger.js +1 -1
- package/dist/modules/tagging/WordlistTagger.js.map +1 -1
- package/dist/modules/tagging/index.d.ts +2 -0
- package/dist/modules/tagging/index.d.ts.map +1 -1
- package/dist/modules/tagging/index.js +1 -0
- package/dist/modules/tagging/index.js.map +1 -1
- package/dist/modules/tags/AndTagCondition.d.ts +10 -0
- package/dist/modules/tags/AndTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/AndTagCondition.js +14 -0
- package/dist/modules/tags/AndTagCondition.js.map +1 -0
- package/dist/modules/tags/HasTagCondition.d.ts +10 -0
- package/dist/modules/tags/HasTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/HasTagCondition.js +18 -0
- package/dist/modules/tags/HasTagCondition.js.map +1 -0
- package/dist/modules/tags/NotTagCondition.d.ts +10 -0
- package/dist/modules/tags/NotTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/NotTagCondition.js +14 -0
- package/dist/modules/tags/NotTagCondition.js.map +1 -0
- package/dist/modules/tags/OrTagCondition.d.ts +10 -0
- package/dist/modules/tags/OrTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/OrTagCondition.js +14 -0
- package/dist/modules/tags/OrTagCondition.js.map +1 -0
- package/dist/modules/{document/Tag.d.ts → tags/StructureTag.d.ts} +4 -10
- package/dist/modules/tags/StructureTag.d.ts.map +1 -0
- package/dist/modules/{document/Tag.js → tags/StructureTag.js} +4 -19
- package/dist/modules/tags/StructureTag.js.map +1 -0
- package/dist/modules/tags/Tag.d.ts +8 -0
- package/dist/modules/tags/Tag.d.ts.map +1 -0
- package/dist/modules/tags/Tag.js +16 -0
- package/dist/modules/tags/Tag.js.map +1 -0
- package/dist/modules/tags/TagCondition.d.ts +12 -0
- package/dist/modules/tags/TagCondition.d.ts.map +1 -0
- package/dist/modules/tags/TagCondition.js +2 -0
- package/dist/modules/tags/TagCondition.js.map +1 -0
- package/dist/modules/tags/TagConditionParser.d.ts +21 -0
- package/dist/modules/tags/TagConditionParser.d.ts.map +1 -0
- package/dist/modules/tags/TagConditionParser.js +75 -0
- package/dist/modules/tags/TagConditionParser.js.map +1 -0
- package/dist/modules/tags/index.d.ts +9 -0
- package/dist/modules/tags/index.d.ts.map +1 -0
- package/dist/modules/tags/index.js +8 -0
- package/dist/modules/tags/index.js.map +1 -0
- package/dist/modules/transcription/AudioDecoder.d.ts +9 -4
- package/dist/modules/transcription/AudioDecoder.d.ts.map +1 -1
- package/dist/modules/transcription/BatchedMonoResampler.d.ts +45 -0
- package/dist/modules/transcription/BatchedMonoResampler.d.ts.map +1 -0
- package/dist/modules/transcription/BatchedMonoResampler.js +116 -0
- package/dist/modules/transcription/BatchedMonoResampler.js.map +1 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.d.ts +38 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.d.ts.map +1 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.js +86 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.js.map +1 -0
- package/dist/modules/transcription/CueDocumentBuilder.d.ts +40 -0
- package/dist/modules/transcription/CueDocumentBuilder.d.ts.map +1 -0
- package/dist/modules/transcription/CueDocumentBuilder.js +77 -0
- package/dist/modules/transcription/CueDocumentBuilder.js.map +1 -0
- package/dist/modules/transcription/CueParseResult.d.ts +16 -0
- package/dist/modules/transcription/CueParseResult.d.ts.map +1 -0
- package/dist/modules/transcription/CueParseResult.js +2 -0
- package/dist/modules/transcription/CueParseResult.js.map +1 -0
- package/dist/modules/transcription/CueTextTokenizer.d.ts +10 -0
- package/dist/modules/transcription/CueTextTokenizer.d.ts.map +1 -0
- package/dist/modules/transcription/CueTextTokenizer.js +21 -0
- package/dist/modules/transcription/CueTextTokenizer.js.map +1 -0
- package/dist/modules/transcription/CueTimecodeReader.d.ts +19 -0
- package/dist/modules/transcription/CueTimecodeReader.d.ts.map +1 -0
- package/dist/modules/transcription/CueTimecodeReader.js +45 -0
- package/dist/modules/transcription/CueTimecodeReader.js.map +1 -0
- package/dist/modules/transcription/CueWordReader.d.ts +12 -0
- package/dist/modules/transcription/CueWordReader.d.ts.map +1 -0
- package/dist/modules/transcription/CueWordReader.js +2 -0
- package/dist/modules/transcription/CueWordReader.js.map +1 -0
- package/dist/modules/transcription/EstimatedCueWordReader.d.ts +16 -0
- package/dist/modules/transcription/EstimatedCueWordReader.d.ts.map +1 -0
- package/dist/modules/transcription/EstimatedCueWordReader.js +17 -0
- package/dist/modules/transcription/EstimatedCueWordReader.js.map +1 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.d.ts +43 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.d.ts.map +1 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.js +72 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.js.map +1 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts +27 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.js +76 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.js.map +1 -0
- package/dist/modules/transcription/ModelFileCache.d.ts +20 -0
- package/dist/modules/transcription/ModelFileCache.d.ts.map +1 -0
- package/dist/modules/transcription/ModelFileCache.js +2 -0
- package/dist/modules/transcription/ModelFileCache.js.map +1 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts +18 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts.map +1 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.js +18 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.js.map +1 -0
- package/dist/modules/transcription/SrtTranscriber.d.ts +24 -15
- package/dist/modules/transcription/SrtTranscriber.d.ts.map +1 -1
- package/dist/modules/transcription/SrtTranscriber.js +32 -90
- package/dist/modules/transcription/SrtTranscriber.js.map +1 -1
- package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts +22 -0
- package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts.map +1 -0
- package/dist/modules/transcription/SubtitleFileUnreadableError.js +22 -0
- package/dist/modules/transcription/SubtitleFileUnreadableError.js.map +1 -0
- package/dist/modules/transcription/TimestampedCueWordReader.d.ts +27 -0
- package/dist/modules/transcription/TimestampedCueWordReader.d.ts.map +1 -0
- package/dist/modules/transcription/TimestampedCueWordReader.js +52 -0
- package/dist/modules/transcription/TimestampedCueWordReader.js.map +1 -0
- package/dist/modules/transcription/Transcriber.d.ts +13 -0
- package/dist/modules/transcription/Transcriber.d.ts.map +1 -1
- package/dist/modules/transcription/TransformersRuntime.d.ts +50 -0
- package/dist/modules/transcription/TransformersRuntime.d.ts.map +1 -0
- package/dist/modules/transcription/TransformersRuntime.js +79 -0
- package/dist/modules/transcription/TransformersRuntime.js.map +1 -0
- package/dist/modules/transcription/VttTranscriber.d.ts +46 -0
- package/dist/modules/transcription/VttTranscriber.d.ts.map +1 -0
- package/dist/modules/transcription/VttTranscriber.js +80 -0
- package/dist/modules/transcription/VttTranscriber.js.map +1 -0
- package/dist/modules/transcription/WhisperChunkStitcher.d.ts +51 -0
- package/dist/modules/transcription/WhisperChunkStitcher.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperChunkStitcher.js +101 -0
- package/dist/modules/transcription/WhisperChunkStitcher.js.map +1 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts +16 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.js +16 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.js.map +1 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.d.ts +16 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.js +16 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.js.map +1 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts +61 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.js +102 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.js.map +1 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts +38 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js +94 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js.map +1 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts +15 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.js +15 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.js.map +1 -0
- package/dist/modules/transcription/WhisperTranscriber.d.ts +106 -7
- package/dist/modules/transcription/WhisperTranscriber.d.ts.map +1 -1
- package/dist/modules/transcription/WhisperTranscriber.js +312 -25
- package/dist/modules/transcription/WhisperTranscriber.js.map +1 -1
- package/dist/modules/transcription/WhisperWindowCoverage.d.ts +79 -0
- package/dist/modules/transcription/WhisperWindowCoverage.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperWindowCoverage.js +129 -0
- package/dist/modules/transcription/WhisperWindowCoverage.js.map +1 -0
- package/dist/modules/transcription/WordTimingEstimator.d.ts +14 -0
- package/dist/modules/transcription/WordTimingEstimator.d.ts.map +1 -0
- package/dist/modules/transcription/WordTimingEstimator.js +33 -0
- package/dist/modules/transcription/WordTimingEstimator.js.map +1 -0
- package/dist/modules/transcription/index.d.ts +9 -2
- package/dist/modules/transcription/index.d.ts.map +1 -1
- package/dist/modules/transcription/index.js +6 -1
- package/dist/modules/transcription/index.js.map +1 -1
- package/dist/modules/video/RenderJob.d.ts +17 -0
- package/dist/modules/video/RenderJob.d.ts.map +1 -1
- package/dist/modules/video/RenderTimeMap.d.ts +50 -0
- package/dist/modules/video/RenderTimeMap.d.ts.map +1 -0
- package/dist/modules/video/RenderTimeMap.js +90 -0
- package/dist/modules/video/RenderTimeMap.js.map +1 -0
- package/dist/modules/video/index.d.ts +8 -1
- package/dist/modules/video/index.d.ts.map +1 -1
- package/dist/modules/video/index.js +4 -0
- package/dist/modules/video/index.js.map +1 -1
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts +102 -0
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js +207 -0
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js.map +1 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts +12 -52
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js +25 -190
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js.map +1 -1
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts +7 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js +2 -2
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js.map +1 -1
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts +2 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js +8 -2
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js.map +1 -1
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts +3 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js +9 -2
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js.map +1 -1
- package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts +7 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts +4 -2
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js +33 -23
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js.map +1 -1
- package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts +9 -2
- package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts +5 -2
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js +8 -2
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js.map +1 -1
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.d.ts +35 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js +69 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js.map +1 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.d.ts +23 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.js +23 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/painter/FramePainter.d.ts +46 -0
- package/dist/modules/video/mediabunny/painter/FramePainter.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/painter/FramePainter.js +2 -0
- package/dist/modules/video/mediabunny/painter/FramePainter.js.map +1 -0
- package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts +24 -0
- package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/painter/TopLayerSource.js +2 -0
- package/dist/modules/video/mediabunny/painter/TopLayerSource.js.map +1 -0
- package/package.json +13 -10
- package/dist/modules/document/Tag.d.ts.map +0 -1
- package/dist/modules/document/Tag.js.map +0 -1
- package/dist/modules/rendering/AlignmentConfig.d.ts +0 -21
- package/dist/modules/rendering/AlignmentConfig.d.ts.map +0 -1
- package/dist/modules/rendering/AlignmentConfig.js +0 -2
- package/dist/modules/rendering/AlignmentConfig.js.map +0 -1
- package/dist/modules/rendering/BoxEdges.d.ts.map +0 -1
- package/dist/modules/rendering/BoxEdges.js.map +0 -1
- package/dist/modules/rendering/ElementRenderOverrides.d.ts +0 -15
- package/dist/modules/rendering/ElementRenderOverrides.d.ts.map +0 -1
- package/dist/modules/rendering/ElementRenderOverrides.js +0 -24
- package/dist/modules/rendering/ElementRenderOverrides.js.map +0 -1
- package/dist/modules/rendering/InlineStyleMap.d.ts.map +0 -1
- package/dist/modules/rendering/InlineStyleMap.js.map +0 -1
- package/dist/modules/rendering/RenderingConfig.d.ts.map +0 -1
- package/dist/modules/rendering/RenderingConfig.js.map +0 -1
- package/dist/modules/rendering/ScopedRenderOverride.d.ts +0 -19
- package/dist/modules/rendering/ScopedRenderOverride.d.ts.map +0 -1
- package/dist/modules/rendering/ScopedRenderOverride.js.map +0 -1
- package/dist/modules/rendering/SegmentPaintRegionResolver.d.ts.map +0 -1
- package/dist/modules/rendering/SegmentPaintRegionResolver.js.map +0 -1
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts +0 -58
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts.map +0 -1
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js +0 -132
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js.map +0 -1
- package/dist/modules/rendering/VideoFrameLayerClass.d.ts.map +0 -1
- package/dist/modules/rendering/VideoFrameLayerClass.js +0 -21
- package/dist/modules/rendering/VideoFrameLayerClass.js.map +0 -1
- package/dist/modules/rendering/VideoFrameSource.d.ts.map +0 -1
- package/dist/modules/rendering/VideoFrameSource.js.map +0 -1
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts +0 -13
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts.map +0 -1
- package/dist/modules/transcription/BrowserAudioDecoder.js +0 -34
- package/dist/modules/transcription/BrowserAudioDecoder.js.map +0 -1
- /package/dist/modules/rendering/{BoxEdges.d.ts → types/BoxEdges.d.ts} +0 -0
- /package/dist/modules/rendering/{BoxEdges.js → types/BoxEdges.js} +0 -0
- /package/dist/modules/rendering/{InlineStyleMap.d.ts → types/InlineStyleMap.d.ts} +0 -0
- /package/dist/modules/rendering/{InlineStyleMap.js → types/InlineStyleMap.js} +0 -0
- /package/dist/modules/rendering/{RenderingConfig.js → types/RenderingConfig.js} +0 -0
- /package/dist/modules/rendering/{ScopedRenderOverride.js → types/ScopedRenderOverride.js} +0 -0
- /package/dist/modules/rendering/{VideoFrameSource.d.ts → types/VideoFrameSource.d.ts} +0 -0
- /package/dist/modules/rendering/{VideoFrameSource.js → types/VideoFrameSource.js} +0 -0
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import { pipeline, env } from '@huggingface/transformers';
|
|
2
1
|
import { Document, Section, Segment, Line, Word, TimeFragment } from '../document/index';
|
|
2
|
+
import { TransformersRuntime } from '../transcription/TransformersRuntime';
|
|
3
|
+
import { WhisperDeviceUnavailableError } from '../transcription/WhisperDeviceUnavailableError';
|
|
4
|
+
import { WhisperInferenceFailedError } from '../transcription/WhisperInferenceFailedError';
|
|
5
|
+
import { WhisperInferenceProgressTracker } from '../transcription/WhisperInferenceProgressTracker';
|
|
6
|
+
import { WhisperWindowCoverage } from '../transcription/WhisperWindowCoverage';
|
|
7
|
+
import { WhisperLoopAbortLogitsProcessor } from '../transcription/WhisperLoopAbortLogitsProcessor';
|
|
8
|
+
import { LogitsProcessorListFactory } from '../transcription/LogitsProcessorListFactory';
|
|
9
|
+
import { WhisperChunkStitcher } from '../transcription/WhisperChunkStitcher';
|
|
10
|
+
import { WhisperModelLoadFailedError } from '../transcription/WhisperModelLoadFailedError';
|
|
3
11
|
export const WHISPER_SAMPLE_RATE = 16_000;
|
|
4
12
|
const MODEL_IDS = {
|
|
5
13
|
'tiny': 'onnx-community/whisper-tiny_timestamped',
|
|
6
14
|
'base': 'onnx-community/whisper-base_timestamped',
|
|
7
15
|
'small': 'onnx-community/whisper-small_timestamped',
|
|
16
|
+
'medium': 'onnx-community/whisper-medium_timestamped',
|
|
8
17
|
'distil-small.en': 'distil-whisper/distil-small.en',
|
|
9
18
|
'distil-medium.en': 'distil-whisper/distil-medium.en',
|
|
10
19
|
};
|
|
@@ -12,6 +21,7 @@ const CHUNK_CONFIG = {
|
|
|
12
21
|
'tiny': { chunk_length_s: 30, stride_length_s: 5 },
|
|
13
22
|
'base': { chunk_length_s: 30, stride_length_s: 5 },
|
|
14
23
|
'small': { chunk_length_s: 30, stride_length_s: 5 },
|
|
24
|
+
'medium': { chunk_length_s: 30, stride_length_s: 5 },
|
|
15
25
|
'distil-small.en': { chunk_length_s: 20, stride_length_s: 3 },
|
|
16
26
|
'distil-medium.en': { chunk_length_s: 20, stride_length_s: 3 },
|
|
17
27
|
};
|
|
@@ -25,23 +35,54 @@ const CHUNK_CONFIG = {
|
|
|
25
35
|
* from low-bit weights — bandwidth is the bottleneck there, so q4 gives a
|
|
26
36
|
* 2-4× win.
|
|
27
37
|
*
|
|
28
|
-
* On WASM we run
|
|
29
|
-
*
|
|
38
|
+
* On WASM we run q8. On a base-sized model the download drops from 278 MB
|
|
39
|
+
* (fp32) to 73 MB and end-to-end inference gets ~25% faster than fp32 on
|
|
40
|
+
* the same isolated worker — halved weight bandwidth beats the int8→fp32
|
|
41
|
+
* conversion cost by a comfortable margin. Whisper is quantization-
|
|
42
|
+
* tolerant (WER shift typically well under 1% absolute).
|
|
30
43
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
44
|
+
* q8 on the `_timestamped` exports crashes session creation under the
|
|
45
|
+
* `onnxruntime-web` dev build transformers.js@4.2.0 pins — the v4-runtime
|
|
46
|
+
* optimizer rewrites QDQ into MatMulNBits and demands scale tensors the
|
|
47
|
+
* older exports do not carry (transformers.js#1707, microsoft/
|
|
48
|
+
* onnxruntime#28306). The workspace overrides `onnxruntime-web` to 1.27.0,
|
|
49
|
+
* which carries the fix; the override goes away when transformers.js
|
|
50
|
+
* ships v4.3.0 with a bundled fix.
|
|
51
|
+
*
|
|
52
|
+
* fp16 on WASM crashes a *different* optimizer against the same older
|
|
53
|
+
* exports (`SimplifiedLayerNormFusion` aborts on a `PrecisionFreeCast`
|
|
54
|
+
* node name that never got inserted). Not covered by the ORT 1.27 fix
|
|
55
|
+
* above; deserves its own upstream issue.
|
|
56
|
+
*
|
|
57
|
+
* q4 on WASM was measured slower than fp32 with older tooling; not re-
|
|
58
|
+
* benchmarked and likely irrelevant given q8 already wins on both size
|
|
59
|
+
* and speed.
|
|
34
60
|
*
|
|
35
61
|
* The distil-whisper repos don't ship the dtypes WebGPU needs
|
|
36
62
|
* (huggingface/transformers.js#1317), so they stay on WASM at q8.
|
|
37
63
|
*/
|
|
38
64
|
const DTYPE_BY_DEVICE = {
|
|
39
|
-
'tiny': { wasm: '
|
|
40
|
-
'base': { wasm: '
|
|
41
|
-
'small': { wasm: '
|
|
65
|
+
'tiny': { wasm: 'q8', webgpu: { encoder_model: 'fp32', decoder_model_merged: 'q4' } },
|
|
66
|
+
'base': { wasm: 'q8', webgpu: { encoder_model: 'fp32', decoder_model_merged: 'q4' } },
|
|
67
|
+
'small': { wasm: 'q8', webgpu: { encoder_model: 'fp32', decoder_model_merged: 'q4' } },
|
|
68
|
+
'medium': { wasm: 'q8', webgpu: { encoder_model: 'fp32', decoder_model_merged: 'q4' } },
|
|
42
69
|
'distil-small.en': { wasm: 'q8', webgpu: null },
|
|
43
70
|
'distil-medium.en': { wasm: 'q8', webgpu: null },
|
|
44
71
|
};
|
|
72
|
+
// Whisper's decoder holds 448 positions, four of which the pipeline spends on
|
|
73
|
+
// the prefix tokens (start-of-transcript, language, task, timestamp mode), so
|
|
74
|
+
// 444 is the model's own generation ceiling. As a cap it is a no-op: it stops
|
|
75
|
+
// generation exactly where the model's `max_length: 448` already would.
|
|
76
|
+
//
|
|
77
|
+
// It is passed for its side effect. transformers.js only enters
|
|
78
|
+
// `_generate_with_seek` — Python's long-form seek loop — when `max_new_tokens`
|
|
79
|
+
// is absent. Layered over `chunk_length_s` windowing (in Python they are
|
|
80
|
+
// alternative long-form strategies, never combined), that loop re-decodes each
|
|
81
|
+
// window's leftover tail zero-padded back to a full 30 s mel, feeding the model
|
|
82
|
+
// long stretches of digital silence — a known hallucination trigger for
|
|
83
|
+
// Whisper. Passing the ceiling as an explicit cap opts out of the layering
|
|
84
|
+
// without changing any decoding limit.
|
|
85
|
+
const MAX_NEW_TOKENS_PER_WINDOW = 444;
|
|
45
86
|
// transformers.js fires both `progress` (per-file) and `progress_total`
|
|
46
87
|
// (aggregate across all files) on the same callback. The per-file event
|
|
47
88
|
// jumps each time a new file starts (it resets to 0), so we listen only
|
|
@@ -60,35 +101,150 @@ const AGGREGATE_LOAD_STATUS = 'progress_total';
|
|
|
60
101
|
* in a Web Worker (where browser audio APIs are unavailable) with a pre-
|
|
61
102
|
* decoded byte-stream decoder.
|
|
62
103
|
*
|
|
63
|
-
* Progress reporting is real-only
|
|
64
|
-
* download from HuggingFace
|
|
65
|
-
*
|
|
66
|
-
*
|
|
104
|
+
* Progress reporting is real-only for both stages. The loading stage
|
|
105
|
+
* tracks model weight download from HuggingFace. The inferring stage
|
|
106
|
+
* hooks a `WhisperTextStreamer` into `model.generate` so each
|
|
107
|
+
* pipeline-window boundary that Whisper predicts translates into an
|
|
108
|
+
* `[0, 1]` fraction of the audio processed so far. Clips short enough to
|
|
109
|
+
* fit in a single window emit no boundaries — the field stays at zero
|
|
110
|
+
* and the consumer can only render that as indeterminate.
|
|
111
|
+
*
|
|
112
|
+
* Coverage policy: every pipeline window's decoding is audited. A
|
|
113
|
+
* non-final window that ended by its own end-of-sequence but left
|
|
114
|
+
* audio before the next window's start gets one re-decode over real
|
|
115
|
+
* audio from that point. A window cut from outside — the repetition-
|
|
116
|
+
* loop guard or the token ceiling — is degenerate: its unclosed tail
|
|
117
|
+
* is dropped and its region is deliberately left untranscribed, never
|
|
118
|
+
* retried. A re-decode that degenerates too is discarded the same way.
|
|
119
|
+
* The final window is reported the same way when cut or stopped
|
|
120
|
+
* mid-segment; a clean close there is trusted as the end of speech.
|
|
67
121
|
*/
|
|
68
122
|
export class WhisperTranscriber {
|
|
69
123
|
decoder;
|
|
70
124
|
model;
|
|
71
125
|
device;
|
|
126
|
+
chunkStitcher;
|
|
127
|
+
transformers;
|
|
128
|
+
processorLists = null;
|
|
72
129
|
pipelinePromise = null;
|
|
73
|
-
constructor(decoder, { model = 'base', device = 'auto' } = {}) {
|
|
130
|
+
constructor(decoder, { model = 'base', device = 'auto' } = {}, modelFileCache) {
|
|
74
131
|
this.decoder = decoder;
|
|
75
132
|
this.model = model;
|
|
76
133
|
this.device = device;
|
|
77
|
-
|
|
134
|
+
const { chunk_length_s, stride_length_s } = CHUNK_CONFIG[model];
|
|
135
|
+
this.chunkStitcher = new WhisperChunkStitcher(chunk_length_s, stride_length_s);
|
|
136
|
+
this.transformers = new TransformersRuntime(modelFileCache);
|
|
78
137
|
}
|
|
79
138
|
onProgress;
|
|
139
|
+
onUntranscribedRegion;
|
|
80
140
|
async transcribe(audio, options) {
|
|
81
|
-
const transcriber = await this.
|
|
141
|
+
const transcriber = await this.loadPipelineOrFail();
|
|
82
142
|
const pcm = await this.decoder.decode(audio, WHISPER_SAMPLE_RATE);
|
|
83
|
-
this.onProgress?.({ stage: 'inferring' });
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
143
|
+
this.onProgress?.({ stage: 'inferring', progress: 0 });
|
|
144
|
+
const durationSeconds = pcm.length / WHISPER_SAMPLE_RATE;
|
|
145
|
+
const tracker = this.buildProgressTracker(durationSeconds);
|
|
146
|
+
const coverage = tracker ? new WhisperWindowCoverage() : null;
|
|
147
|
+
const loopGuard = this.buildLoopGuard(transcriber);
|
|
148
|
+
const streamer = tracker && coverage
|
|
149
|
+
? await this.buildProgressStreamer(transcriber, tracker, coverage, loopGuard)
|
|
150
|
+
: null;
|
|
151
|
+
const rawChunks = await this.runInferenceOrFail(transcriber, pcm, options, streamer, loopGuard);
|
|
152
|
+
const mainChunks = this.chunkStitcher.stitch(rawChunks, durationSeconds);
|
|
153
|
+
const gaps = tracker && coverage ? this.detectUncoveredGaps(tracker, coverage, durationSeconds) : [];
|
|
154
|
+
const finalChunks = gaps.length === 0
|
|
155
|
+
? mainChunks
|
|
156
|
+
: await this.redecodeGaps(transcriber, pcm, mainChunks, gaps, options);
|
|
157
|
+
this.onProgress?.({ stage: 'inferring', progress: 1 });
|
|
158
|
+
return this.buildDocument(finalChunks);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Builds the progress tracker for this audio, or `null` when a single
|
|
162
|
+
* pipeline window covers everything — no window boundary is ever
|
|
163
|
+
* reported then, so the progress bar stays indeterminate.
|
|
164
|
+
*/
|
|
165
|
+
buildProgressTracker(audioDurationSeconds) {
|
|
166
|
+
const { chunk_length_s, stride_length_s } = CHUNK_CONFIG[this.model];
|
|
167
|
+
if (audioDurationSeconds <= chunk_length_s)
|
|
168
|
+
return null;
|
|
169
|
+
return new WhisperInferenceProgressTracker(audioDurationSeconds, chunk_length_s, stride_length_s);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Builds a `WhisperTextStreamer` that translates Whisper's per-window
|
|
173
|
+
* timestamp emissions into `[0, 1]` inference progress and feeds the
|
|
174
|
+
* per-window coverage record.
|
|
175
|
+
*
|
|
176
|
+
* `on_finalize` fires at the end of every `model.generate` call — one
|
|
177
|
+
* per pipeline window while the long-form layering stays opted out —
|
|
178
|
+
* which makes it the exact window delimiter the coverage record needs.
|
|
179
|
+
* It is deliberately not wired to progress: the terminal `progress: 1`
|
|
180
|
+
* can only come from the caller, after the whole call returns.
|
|
181
|
+
*/
|
|
182
|
+
async buildProgressStreamer(transcriber, tracker, coverage, loopGuard) {
|
|
183
|
+
const { WhisperTextStreamer } = await this.transformers.load();
|
|
184
|
+
const tokenizer = transcriber.tokenizer;
|
|
185
|
+
return new WhisperTextStreamer(tokenizer, {
|
|
186
|
+
on_chunk_start: (timeWithinChunk) => coverage.recordTimestamp(timeWithinChunk),
|
|
187
|
+
on_chunk_end: (timeWithinChunk) => {
|
|
188
|
+
coverage.recordTimestamp(timeWithinChunk);
|
|
189
|
+
const progress = tracker.observeChunkEnd(timeWithinChunk);
|
|
190
|
+
this.onProgress?.({ stage: 'inferring', progress });
|
|
191
|
+
},
|
|
192
|
+
on_finalize: () => coverage.windowEnded(loopGuard?.consumeFired() ?? false),
|
|
193
|
+
token_callback_function: () => coverage.recordToken(),
|
|
194
|
+
// Silences the default `stdout_write` fallback in TextStreamer,
|
|
195
|
+
// which prints every decoded token to the console.
|
|
196
|
+
callback_function: () => { },
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Builds the anti-loop guard for a generation, or `null` when the
|
|
201
|
+
* model's end-of-sequence token cannot be located — the guard can
|
|
202
|
+
* only abort by forcing that token.
|
|
203
|
+
*/
|
|
204
|
+
buildLoopGuard(transcriber) {
|
|
205
|
+
const model = transcriber.model;
|
|
206
|
+
const raw = model?.generation_config?.eos_token_id ?? model?.config?.eos_token_id;
|
|
207
|
+
const endOfSequenceTokenId = Array.isArray(raw) ? raw[0] : raw;
|
|
208
|
+
if (typeof endOfSequenceTokenId !== 'number') {
|
|
209
|
+
console.warn('[whisper] end-of-sequence token id not found; running without the loop guard.');
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
return new WhisperLoopAbortLogitsProcessor(endOfSequenceTokenId);
|
|
213
|
+
}
|
|
214
|
+
async loadPipelineOrFail() {
|
|
215
|
+
try {
|
|
216
|
+
return await this.loadPipeline();
|
|
217
|
+
}
|
|
218
|
+
catch (cause) {
|
|
219
|
+
if (cause instanceof WhisperDeviceUnavailableError)
|
|
220
|
+
throw cause;
|
|
221
|
+
throw new WhisperModelLoadFailedError('Whisper pipeline could not be loaded.', { cause });
|
|
222
|
+
}
|
|
88
223
|
}
|
|
224
|
+
async runInferenceOrFail(transcriber, pcm, options, streamer, loopGuard) {
|
|
225
|
+
try {
|
|
226
|
+
console.time('whisper.inference');
|
|
227
|
+
const result = (await transcriber(pcm, await this.buildPipelineOptions(options, streamer, loopGuard)));
|
|
228
|
+
console.timeEnd('whisper.inference');
|
|
229
|
+
return result.chunks ?? [];
|
|
230
|
+
}
|
|
231
|
+
catch (cause) {
|
|
232
|
+
throw new WhisperInferenceFailedError('Whisper inference call rejected.', { cause });
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Loads the pipeline once and reuses it for every later call.
|
|
237
|
+
*
|
|
238
|
+
* A failed load is *not* kept. The weights arrive over the network
|
|
239
|
+
* and the common failure is a transfer that dies partway, which the
|
|
240
|
+
* next attempt may well complete; caching the rejection would make
|
|
241
|
+
* every retry fail instantly without ever reaching the network
|
|
242
|
+
* again, leaving a reload as the only way out.
|
|
243
|
+
*/
|
|
89
244
|
loadPipeline() {
|
|
90
245
|
if (this.pipelinePromise === null) {
|
|
91
|
-
|
|
246
|
+
const attempt = (async () => {
|
|
247
|
+
const { pipeline } = await this.transformers.load();
|
|
92
248
|
const device = await this.resolveDevice();
|
|
93
249
|
console.log(`Using device "${device}" for Whisper model "${this.model}".`);
|
|
94
250
|
const dtype = DTYPE_BY_DEVICE[this.model][device];
|
|
@@ -98,6 +254,11 @@ export class WhisperTranscriber {
|
|
|
98
254
|
progress_callback: (data) => this.handleLoadProgress(data),
|
|
99
255
|
});
|
|
100
256
|
})();
|
|
257
|
+
attempt.catch(() => {
|
|
258
|
+
if (this.pipelinePromise === attempt)
|
|
259
|
+
this.pipelinePromise = null;
|
|
260
|
+
});
|
|
261
|
+
this.pipelinePromise = attempt;
|
|
101
262
|
}
|
|
102
263
|
return this.pipelinePromise;
|
|
103
264
|
}
|
|
@@ -107,10 +268,10 @@ export class WhisperTranscriber {
|
|
|
107
268
|
return 'wasm';
|
|
108
269
|
if (this.device === 'webgpu') {
|
|
109
270
|
if (!webgpuSupportedByModel) {
|
|
110
|
-
throw new
|
|
271
|
+
throw new WhisperDeviceUnavailableError(`Whisper model "${this.model}" does not ship WebGPU artefacts.`);
|
|
111
272
|
}
|
|
112
273
|
if (!(await this.isWebGPUAvailable())) {
|
|
113
|
-
throw new
|
|
274
|
+
throw new WhisperDeviceUnavailableError('WebGPU is not exposed by this browser.');
|
|
114
275
|
}
|
|
115
276
|
return 'webgpu';
|
|
116
277
|
}
|
|
@@ -130,15 +291,29 @@ export class WhisperTranscriber {
|
|
|
130
291
|
return false;
|
|
131
292
|
}
|
|
132
293
|
}
|
|
133
|
-
buildPipelineOptions(options) {
|
|
294
|
+
async buildPipelineOptions(options, streamer, loopGuard) {
|
|
134
295
|
return {
|
|
135
296
|
sampling_rate: WHISPER_SAMPLE_RATE,
|
|
136
297
|
return_timestamps: 'word',
|
|
298
|
+
max_new_tokens: MAX_NEW_TOKENS_PER_WINDOW,
|
|
137
299
|
language: options?.language ?? null,
|
|
138
300
|
task: 'transcribe',
|
|
139
301
|
...CHUNK_CONFIG[this.model],
|
|
302
|
+
...(streamer ? { streamer } : {}),
|
|
303
|
+
...(loopGuard ? { logits_processor: await this.buildProcessorList(loopGuard) } : {}),
|
|
140
304
|
};
|
|
141
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* The factory is built from the loaded library, so it is reached
|
|
308
|
+
* through the same load the pipeline came from rather than held from
|
|
309
|
+
* construction. By the time any generation runs, that load is settled.
|
|
310
|
+
*/
|
|
311
|
+
async buildProcessorList(loopGuard) {
|
|
312
|
+
if (this.processorLists === null) {
|
|
313
|
+
this.processorLists = new LogitsProcessorListFactory(await this.transformers.load());
|
|
314
|
+
}
|
|
315
|
+
return this.processorLists.build(loopGuard);
|
|
316
|
+
}
|
|
142
317
|
handleLoadProgress(data) {
|
|
143
318
|
if (data.status === AGGREGATE_LOAD_STATUS && data.progress !== undefined) {
|
|
144
319
|
this.onProgress?.({
|
|
@@ -147,6 +322,118 @@ export class WhisperTranscriber {
|
|
|
147
322
|
});
|
|
148
323
|
}
|
|
149
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* The audio regions the main pass left uncovered. Empty when the
|
|
327
|
+
* number of generation passes does not match the expected window
|
|
328
|
+
* layout — that means the underlying pipeline changed its long-form
|
|
329
|
+
* behaviour and per-window attribution can no longer be trusted.
|
|
330
|
+
*/
|
|
331
|
+
detectUncoveredGaps(tracker, coverage, durationSeconds) {
|
|
332
|
+
const expectedWindows = tracker.windowLayout.length;
|
|
333
|
+
if (coverage.windowsObserved !== expectedWindows) {
|
|
334
|
+
console.warn(`[whisper] expected ${expectedWindows} pipeline windows but observed ` +
|
|
335
|
+
`${coverage.windowsObserved} generation passes; skipping coverage rescue.`);
|
|
336
|
+
return [];
|
|
337
|
+
}
|
|
338
|
+
const gaps = coverage.uncoveredGaps(tracker.advanceSeconds, MAX_NEW_TOKENS_PER_WINDOW);
|
|
339
|
+
const finalGap = coverage.finalWindowGap(tracker.advanceSeconds, MAX_NEW_TOKENS_PER_WINDOW, durationSeconds);
|
|
340
|
+
return finalGap ? [...gaps, finalGap] : gaps;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Replaces the content of every uncovered gap. The main pass's words
|
|
344
|
+
* inside a gap come from tokens past their window's last closed
|
|
345
|
+
* segment — the same unclosed tail the reference Whisper decoder
|
|
346
|
+
* discards before re-decoding — so they are dropped. Dropping is safe
|
|
347
|
+
* because the word-timestamp alignment is monotonic in token order:
|
|
348
|
+
* no word of a closed segment lands past that segment's end.
|
|
349
|
+
*
|
|
350
|
+
* A rescuable gap gets one extra pass over real audio. A
|
|
351
|
+
* non-rescuable gap does not — its region is reported and left
|
|
352
|
+
* untranscribed rather than retried.
|
|
353
|
+
*/
|
|
354
|
+
async redecodeGaps(transcriber, pcm, main, gaps, options) {
|
|
355
|
+
const kept = main.filter((chunk) => !this.isInsideAnyGap(chunk, gaps));
|
|
356
|
+
const rescued = [];
|
|
357
|
+
for (const gap of gaps) {
|
|
358
|
+
if (!gap.rescuable) {
|
|
359
|
+
console.warn(`[whisper] window ended without trustworthy coverage; leaving ` +
|
|
360
|
+
`[${gap.startSeconds.toFixed(2)}s, ${gap.endSeconds.toFixed(2)}s] untranscribed.`);
|
|
361
|
+
this.reportUntranscribed(gap);
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
rescued.push(...await this.rescueGap(transcriber, pcm, gap, options));
|
|
365
|
+
}
|
|
366
|
+
return this.mergeChunks(kept, rescued);
|
|
367
|
+
}
|
|
368
|
+
isInsideAnyGap(chunk, gaps) {
|
|
369
|
+
const anchor = chunk.timestamp[0] ?? chunk.timestamp[1];
|
|
370
|
+
if (anchor === null)
|
|
371
|
+
return false;
|
|
372
|
+
return gaps.some((gap) => anchor >= gap.startSeconds && anchor < gap.endSeconds);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Runs one extra decoding pass over a full window of real audio
|
|
376
|
+
* starting at the gap and keeps the words that fall inside it. Words
|
|
377
|
+
* past the gap's end are dropped — the next pipeline window already
|
|
378
|
+
* covers that region.
|
|
379
|
+
*
|
|
380
|
+
* Best-effort by design: the main transcription is already in hand, so
|
|
381
|
+
* a failed rescue logs and contributes nothing instead of failing the
|
|
382
|
+
* whole call.
|
|
383
|
+
*/
|
|
384
|
+
async rescueGap(transcriber, pcm, gap, options) {
|
|
385
|
+
const { chunk_length_s } = CHUNK_CONFIG[this.model];
|
|
386
|
+
const label = `[${gap.startSeconds.toFixed(2)}s, ${gap.endSeconds.toFixed(2)}s]`;
|
|
387
|
+
console.warn(`[whisper] window closed early; re-decoding ${label} from real audio.`);
|
|
388
|
+
try {
|
|
389
|
+
const startSample = Math.floor(gap.startSeconds * WHISPER_SAMPLE_RATE);
|
|
390
|
+
const endSample = Math.min(pcm.length, startSample + chunk_length_s * WHISPER_SAMPLE_RATE);
|
|
391
|
+
const slice = pcm.subarray(startSample, endSample);
|
|
392
|
+
const rescueGuard = this.buildLoopGuard(transcriber);
|
|
393
|
+
const result = (await transcriber(slice, await this.buildPipelineOptions(options, null, rescueGuard)));
|
|
394
|
+
if (rescueGuard?.consumeFired()) {
|
|
395
|
+
console.warn(`[whisper] rescue for ${label} degenerated as well; leaving the region untranscribed.`);
|
|
396
|
+
this.reportUntranscribed(gap);
|
|
397
|
+
return [];
|
|
398
|
+
}
|
|
399
|
+
const recovered = this.chunksWithinGap(result.chunks ?? [], gap);
|
|
400
|
+
console.log(`[whisper] rescue recovered ${recovered.length} words for ${label}.`);
|
|
401
|
+
return recovered;
|
|
402
|
+
}
|
|
403
|
+
catch (cause) {
|
|
404
|
+
console.warn('[whisper] gap rescue failed; keeping the main transcription only.', cause);
|
|
405
|
+
this.reportUntranscribed(gap);
|
|
406
|
+
return [];
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
reportUntranscribed(gap) {
|
|
410
|
+
this.onUntranscribedRegion?.({ startSeconds: gap.startSeconds, endSeconds: gap.endSeconds });
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Shifts slice-relative rescue chunks to absolute time and keeps the
|
|
414
|
+
* ones anchored inside the gap. A chunk with no usable timestamp
|
|
415
|
+
* cannot be placed and is dropped.
|
|
416
|
+
*/
|
|
417
|
+
chunksWithinGap(chunks, gap) {
|
|
418
|
+
return chunks
|
|
419
|
+
.map(({ text, timestamp: [start, end] }) => ({
|
|
420
|
+
text,
|
|
421
|
+
timestamp: [
|
|
422
|
+
start === null ? null : start + gap.startSeconds,
|
|
423
|
+
end === null ? null : end + gap.startSeconds,
|
|
424
|
+
],
|
|
425
|
+
}))
|
|
426
|
+
.filter(({ timestamp: [start, end] }) => {
|
|
427
|
+
const anchor = start ?? end;
|
|
428
|
+
return anchor !== null && anchor < gap.endSeconds;
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
mergeChunks(main, rescued) {
|
|
432
|
+
if (rescued.length === 0)
|
|
433
|
+
return main;
|
|
434
|
+
const anchor = ({ timestamp: [start, end] }) => start ?? end ?? 0;
|
|
435
|
+
return [...main, ...rescued].sort((a, b) => anchor(a) - anchor(b));
|
|
436
|
+
}
|
|
150
437
|
buildDocument(chunks) {
|
|
151
438
|
const words = chunks
|
|
152
439
|
.map(({ text, timestamp: [start, end] }) => new Word({ text: text.trim(), time: new TimeFragment(start ?? 0, end ?? start ?? 0) }))
|
|
@@ -1 +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;AAC1D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAQ/F,MAAM,CAAC,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O,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,79 @@
|
|
|
1
|
+
/** An audio region, in absolute seconds, that no pipeline window transcribed. */
|
|
2
|
+
export interface CoverageGap {
|
|
3
|
+
startSeconds: number;
|
|
4
|
+
endSeconds: number;
|
|
5
|
+
/**
|
|
6
|
+
* Whether one re-decode over real audio may recover the region.
|
|
7
|
+
* False when the window's output was cut from outside — loop guard
|
|
8
|
+
* or token ceiling — because retrying reproduces the failure, and
|
|
9
|
+
* for final-window gaps, where re-decoding trailing audio risks
|
|
10
|
+
* hallucinating words over silence.
|
|
11
|
+
*/
|
|
12
|
+
rescuable: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Records what the decoder did in each pipeline window — how far its
|
|
16
|
+
* last real segment got, how many tokens it emitted, whether the loop
|
|
17
|
+
* guard cut it, whether it stopped mid-segment — and answers which
|
|
18
|
+
* audio regions were left uncovered.
|
|
19
|
+
*
|
|
20
|
+
* Segment boundaries are counted with window-local parity: within one
|
|
21
|
+
* window the decoder strictly alternates open / close starting at
|
|
22
|
+
* open, so odd-numbered events open a segment and even-numbered ones
|
|
23
|
+
* close it. The upstream streamer's own open/close labels are not
|
|
24
|
+
* trusted — its alternation state carries across windows, so one
|
|
25
|
+
* window that stops mid-segment mislabels every event that follows.
|
|
26
|
+
*
|
|
27
|
+
* Only segments whose close timestamp is strictly greater than their
|
|
28
|
+
* open timestamp count as "closed". A degenerate repetition loop can
|
|
29
|
+
* emit `<|t|>text<|t|>` pairs at a single timestamp forever — trusting
|
|
30
|
+
* those bogus closes leaves the whole loop tail looking legitimate
|
|
31
|
+
* and defeats every downstream cutoff.
|
|
32
|
+
*/
|
|
33
|
+
export declare class WhisperWindowCoverage {
|
|
34
|
+
private readonly windows;
|
|
35
|
+
private currentLastClosedEnd;
|
|
36
|
+
private currentTokenCount;
|
|
37
|
+
private currentTimestampEvents;
|
|
38
|
+
private currentOpenTimestamp;
|
|
39
|
+
/** Feeds one segment-boundary timestamp, relative to the current window. */
|
|
40
|
+
recordTimestamp(timeWithinWindow: number): void;
|
|
41
|
+
private isOpenEvent;
|
|
42
|
+
private isRealClose;
|
|
43
|
+
/** Counts one generated token towards the current window. */
|
|
44
|
+
recordToken(): void;
|
|
45
|
+
/** Marks the end of the current window's generation pass. */
|
|
46
|
+
windowEnded(abortedByLoopGuard: boolean): void;
|
|
47
|
+
/** Number of generation passes observed so far. */
|
|
48
|
+
get windowsObserved(): number;
|
|
49
|
+
/**
|
|
50
|
+
* The uncovered regions among non-final windows. A window whose
|
|
51
|
+
* trustworthy coverage ends before the pipeline's window advance
|
|
52
|
+
* leaves the audio from that point up to the next window's start
|
|
53
|
+
* transcribed by nobody.
|
|
54
|
+
*
|
|
55
|
+
* A window is degenerate when the loop guard cut it or its token
|
|
56
|
+
* count reached `tokenCeiling` — either way it did not end by its
|
|
57
|
+
* own end-of-sequence, and its gap is not rescuable.
|
|
58
|
+
*/
|
|
59
|
+
uncoveredGaps(advanceSeconds: number, tokenCeiling: number): CoverageGap[];
|
|
60
|
+
/**
|
|
61
|
+
* The uncovered tail of the final window, or `null` when there is
|
|
62
|
+
* nothing trustworthy to report. Reported only when that window's
|
|
63
|
+
* generation was cut from outside or stopped mid-segment. A clean
|
|
64
|
+
* close is trusted as the genuine end of speech: with no following
|
|
65
|
+
* window, an early-but-clean close cannot be told apart from a video
|
|
66
|
+
* that simply ends in silence. Never rescuable.
|
|
67
|
+
*/
|
|
68
|
+
finalWindowGap(advanceSeconds: number, tokenCeiling: number, audioEndSeconds: number): CoverageGap | null;
|
|
69
|
+
private isDegenerate;
|
|
70
|
+
/**
|
|
71
|
+
* Where the window's trustworthy coverage ends. A clean window that
|
|
72
|
+
* closed no segment reports `null`: re-decoding its identical input
|
|
73
|
+
* is deterministic and would reproduce the same empty result. A
|
|
74
|
+
* degenerate window with no closed segment still gaps from zero —
|
|
75
|
+
* its region gets dropped, not re-decoded.
|
|
76
|
+
*/
|
|
77
|
+
private gapStartFor;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=WhisperWindowCoverage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WhisperWindowCoverage.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/WhisperWindowCoverage.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,sBAAsB,CAAK;IACnC,OAAO,CAAC,oBAAoB,CAAuB;IAEnD,4EAA4E;IAC5E,eAAe,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI;IAY/C,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,WAAW;IAInB,6DAA6D;IAC7D,WAAW,IAAI,IAAI;IAInB,6DAA6D;IAC7D,WAAW,CAAC,kBAAkB,EAAE,OAAO,GAAG,IAAI;IAa9C,mDAAmD;IACnD,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED;;;;;;;;;OASG;IACH,aAAa,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,WAAW,EAAE;IAiB1E;;;;;;;OAOG;IACH,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAUzG,OAAO,CAAC,YAAY;IAIpB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;CAIpB"}
|