@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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type * as Transformers from '@huggingface/transformers';
|
|
2
|
+
import type { LogitsProcessorList } from '@huggingface/transformers';
|
|
3
|
+
import type { WhisperLoopAbortLogitsProcessor } from '../transcription/WhisperLoopAbortLogitsProcessor';
|
|
4
|
+
/**
|
|
5
|
+
* Builds the logits-processor list a generation is handed, out of the
|
|
6
|
+
* inference library's base classes.
|
|
7
|
+
*
|
|
8
|
+
* The two subclasses below are defined here, against a module passed in,
|
|
9
|
+
* rather than at the top of their own files against a static import.
|
|
10
|
+
* `extends` runs when a module loads, so a subclass of a library class
|
|
11
|
+
* makes that library a load-time dependency of every file that can reach
|
|
12
|
+
* it — which is the whole package, through its entry point. Everything
|
|
13
|
+
* that does not need the base class stays outside: the loop guard holds
|
|
14
|
+
* its own detection and this only dresses it.
|
|
15
|
+
*
|
|
16
|
+
* Both classes are built once and reused. They close over nothing per
|
|
17
|
+
* call, and rebuilding them would give the pipeline a different
|
|
18
|
+
* `constructor` identity each time, which is exactly what the list's
|
|
19
|
+
* replacement rule compares.
|
|
20
|
+
*/
|
|
21
|
+
export declare class LogitsProcessorListFactory {
|
|
22
|
+
private readonly module;
|
|
23
|
+
private listClass;
|
|
24
|
+
private guardClass;
|
|
25
|
+
constructor(module: typeof Transformers);
|
|
26
|
+
/** A list holding `guard`, ready to be passed as `logits_processor`. */
|
|
27
|
+
build(guard: WhisperLoopAbortLogitsProcessor): LogitsProcessorList;
|
|
28
|
+
/**
|
|
29
|
+
* A processor list whose `push` replaces any already-held processor of
|
|
30
|
+
* the same class instead of appending a duplicate.
|
|
31
|
+
*
|
|
32
|
+
* The ASR pipeline reuses one options object across every window of a
|
|
33
|
+
* long transcription, and Whisper's `generate` pushes a fresh set of
|
|
34
|
+
* internal processors into the provided list on every call. On a plain
|
|
35
|
+
* list those pile up — window N would run N copies of each internal
|
|
36
|
+
* processor. Replacement reproduces the fresh-list semantics the
|
|
37
|
+
* library assumes: the newest instance wins.
|
|
38
|
+
*/
|
|
39
|
+
private replacingList;
|
|
40
|
+
/** Presents the loop guard as the processor shape the pipeline calls. */
|
|
41
|
+
private guardAdapter;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=LogitsProcessorListFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogitsProcessorListFactory.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/LogitsProcessorListFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,YAAY,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAmB,mBAAmB,EAAU,MAAM,2BAA2B,CAAC;AAC9F,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wDAAwD,CAAC;AAE9G;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,0BAA0B;IAIzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,OAAO,CAAC,SAAS,CAAgD;IACjE,OAAO,CAAC,UAAU,CAAkF;gBAEvE,MAAM,EAAE,OAAO,YAAY;IAExD,wEAAwE;IACxE,KAAK,CAAC,KAAK,EAAE,+BAA+B,GAAG,mBAAmB;IAMlE;;;;;;;;;;OAUG;IACH,OAAO,CAAC,aAAa;IAerB,yEAAyE;IACzE,OAAO,CAAC,YAAY;CAcrB"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the logits-processor list a generation is handed, out of the
|
|
3
|
+
* inference library's base classes.
|
|
4
|
+
*
|
|
5
|
+
* The two subclasses below are defined here, against a module passed in,
|
|
6
|
+
* rather than at the top of their own files against a static import.
|
|
7
|
+
* `extends` runs when a module loads, so a subclass of a library class
|
|
8
|
+
* makes that library a load-time dependency of every file that can reach
|
|
9
|
+
* it — which is the whole package, through its entry point. Everything
|
|
10
|
+
* that does not need the base class stays outside: the loop guard holds
|
|
11
|
+
* its own detection and this only dresses it.
|
|
12
|
+
*
|
|
13
|
+
* Both classes are built once and reused. They close over nothing per
|
|
14
|
+
* call, and rebuilding them would give the pipeline a different
|
|
15
|
+
* `constructor` identity each time, which is exactly what the list's
|
|
16
|
+
* replacement rule compares.
|
|
17
|
+
*/
|
|
18
|
+
export class LogitsProcessorListFactory {
|
|
19
|
+
module;
|
|
20
|
+
listClass = null;
|
|
21
|
+
guardClass = null;
|
|
22
|
+
constructor(module) {
|
|
23
|
+
this.module = module;
|
|
24
|
+
}
|
|
25
|
+
/** A list holding `guard`, ready to be passed as `logits_processor`. */
|
|
26
|
+
build(guard) {
|
|
27
|
+
const list = new (this.replacingList())();
|
|
28
|
+
list.push(new (this.guardAdapter())(guard));
|
|
29
|
+
return list;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A processor list whose `push` replaces any already-held processor of
|
|
33
|
+
* the same class instead of appending a duplicate.
|
|
34
|
+
*
|
|
35
|
+
* The ASR pipeline reuses one options object across every window of a
|
|
36
|
+
* long transcription, and Whisper's `generate` pushes a fresh set of
|
|
37
|
+
* internal processors into the provided list on every call. On a plain
|
|
38
|
+
* list those pile up — window N would run N copies of each internal
|
|
39
|
+
* processor. Replacement reproduces the fresh-list semantics the
|
|
40
|
+
* library assumes: the newest instance wins.
|
|
41
|
+
*/
|
|
42
|
+
replacingList() {
|
|
43
|
+
if (this.listClass === null) {
|
|
44
|
+
this.listClass = class extends this.module.LogitsProcessorList {
|
|
45
|
+
push(item) {
|
|
46
|
+
const existing = this.processors.findIndex((held) => held.constructor === item.constructor);
|
|
47
|
+
if (existing >= 0)
|
|
48
|
+
this.processors.splice(existing, 1);
|
|
49
|
+
super.push(item);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return this.listClass;
|
|
54
|
+
}
|
|
55
|
+
/** Presents the loop guard as the processor shape the pipeline calls. */
|
|
56
|
+
guardAdapter() {
|
|
57
|
+
if (this.guardClass === null) {
|
|
58
|
+
this.guardClass = class extends this.module.LogitsProcessor {
|
|
59
|
+
guard;
|
|
60
|
+
constructor(guard) {
|
|
61
|
+
super();
|
|
62
|
+
this.guard = guard;
|
|
63
|
+
}
|
|
64
|
+
_call(inputIds, logits) {
|
|
65
|
+
return this.guard.apply(inputIds, logits);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return this.guardClass;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=LogitsProcessorListFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogitsProcessorListFactory.js","sourceRoot":"","sources":["../../../src/modules/transcription/LogitsProcessorListFactory.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,0BAA0B;IAIR;IAHrB,SAAS,GAA2C,IAAI,CAAC;IACzD,UAAU,GAA6E,IAAI,CAAC;IAEpG,YAA6B,MAA2B;QAA3B,WAAM,GAAN,MAAM,CAAqB;IAAG,CAAC;IAE5D,wEAAwE;IACxE,KAAK,CAAC,KAAsC;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC;QAC1C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;OAUG;IACK,aAAa;QACnB,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;YAC5B,IAAI,CAAC,SAAS,GAAG,KAAM,SAAQ,IAAI,CAAC,MAAM,CAAC,mBAAmB;gBACnD,IAAI,CAAC,IAAqB;oBACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CACxC,CAAC,IAAqB,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,CACjE,CAAC;oBACF,IAAI,QAAQ,IAAI,CAAC;wBAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;oBACvD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACnB,CAAC;aACF,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,yEAAyE;IACjE,YAAY;QAClB,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;YAC7B,IAAI,CAAC,UAAU,GAAG,KAAM,SAAQ,IAAI,CAAC,MAAM,CAAC,eAAe;gBAC5B;gBAA7B,YAA6B,KAAsC;oBACjE,KAAK,EAAE,CAAC;oBADmB,UAAK,GAAL,KAAK,CAAiC;gBAEnE,CAAC;gBAED,KAAK,CAAC,QAAoB,EAAE,MAAc;oBACxC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAC5C,CAAC;aACF,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AudioDecoder } from '../transcription/AudioDecoder';
|
|
2
|
+
/**
|
|
3
|
+
* Decodes an audio/video Blob to mono `Float32Array` PCM at the
|
|
4
|
+
* requested sample rate by demuxing the container with mediabunny and
|
|
5
|
+
* iterating the primary audio track through {@link AudioSampleSink}.
|
|
6
|
+
* Downmixes and resamples in fixed-size batches via
|
|
7
|
+
* {@link BatchedMonoResampler} so peak memory is bounded by one batch
|
|
8
|
+
* of source-rate audio plus the pre-sized target buffer, not by the
|
|
9
|
+
* whole track — a long video no longer holds ~4× its useful PCM size
|
|
10
|
+
* in transient buffers on the way to the worker.
|
|
11
|
+
*
|
|
12
|
+
* Main-thread only — `OfflineAudioContext` is not available inside
|
|
13
|
+
* Worker contexts.
|
|
14
|
+
*
|
|
15
|
+
* A codec the current browser cannot decode surfaces as a
|
|
16
|
+
* `DOMException` named `NotSupportedError`, following the WebCodecs
|
|
17
|
+
* convention. Any other underlying mediabunny / WebCodecs failure is
|
|
18
|
+
* re-thrown verbatim so callers can inspect its `name` / `cause` to
|
|
19
|
+
* classify the reason.
|
|
20
|
+
*/
|
|
21
|
+
export declare class MediaBunnyAudioDecoder implements AudioDecoder {
|
|
22
|
+
decode(audio: Blob, targetSampleRate: number, onProgress?: (progress: number) => void): Promise<Float32Array>;
|
|
23
|
+
private decodeInput;
|
|
24
|
+
private streamMonoInto;
|
|
25
|
+
private progressAt;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=MediaBunnyAudioDecoder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaBunnyAudioDecoder.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/MediaBunnyAudioDecoder.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAGxE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,sBAAuB,YAAW,YAAY;IACnD,MAAM,CACV,KAAK,EAAE,IAAI,EACX,gBAAgB,EAAE,MAAM,EACxB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GACtC,OAAO,CAAC,YAAY,CAAC;YASV,WAAW;YAuBX,cAAc;IAmB5B,OAAO,CAAC,UAAU;CAQnB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ALL_FORMATS, AudioSampleSink, BlobSource, Input, } from 'mediabunny';
|
|
2
|
+
import { BatchedMonoResampler } from '../transcription/BatchedMonoResampler';
|
|
3
|
+
/**
|
|
4
|
+
* Decodes an audio/video Blob to mono `Float32Array` PCM at the
|
|
5
|
+
* requested sample rate by demuxing the container with mediabunny and
|
|
6
|
+
* iterating the primary audio track through {@link AudioSampleSink}.
|
|
7
|
+
* Downmixes and resamples in fixed-size batches via
|
|
8
|
+
* {@link BatchedMonoResampler} so peak memory is bounded by one batch
|
|
9
|
+
* of source-rate audio plus the pre-sized target buffer, not by the
|
|
10
|
+
* whole track — a long video no longer holds ~4× its useful PCM size
|
|
11
|
+
* in transient buffers on the way to the worker.
|
|
12
|
+
*
|
|
13
|
+
* Main-thread only — `OfflineAudioContext` is not available inside
|
|
14
|
+
* Worker contexts.
|
|
15
|
+
*
|
|
16
|
+
* A codec the current browser cannot decode surfaces as a
|
|
17
|
+
* `DOMException` named `NotSupportedError`, following the WebCodecs
|
|
18
|
+
* convention. Any other underlying mediabunny / WebCodecs failure is
|
|
19
|
+
* re-thrown verbatim so callers can inspect its `name` / `cause` to
|
|
20
|
+
* classify the reason.
|
|
21
|
+
*/
|
|
22
|
+
export class MediaBunnyAudioDecoder {
|
|
23
|
+
async decode(audio, targetSampleRate, onProgress) {
|
|
24
|
+
const input = new Input({ formats: ALL_FORMATS, source: new BlobSource(audio) });
|
|
25
|
+
try {
|
|
26
|
+
return await this.decodeInput(input, targetSampleRate, onProgress);
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
input.dispose();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async decodeInput(input, targetSampleRate, onProgress) {
|
|
33
|
+
const track = await input.getPrimaryAudioTrack();
|
|
34
|
+
if (!track)
|
|
35
|
+
return new Float32Array(0);
|
|
36
|
+
if (!(await track.canDecode())) {
|
|
37
|
+
const codec = await track.getCodec();
|
|
38
|
+
throw new DOMException(`Audio codec is not supported by this browser: ${codec ?? 'unknown'}`, 'NotSupportedError');
|
|
39
|
+
}
|
|
40
|
+
const durationSeconds = await track.computeDuration();
|
|
41
|
+
if (durationSeconds <= 0)
|
|
42
|
+
return new Float32Array(0);
|
|
43
|
+
const target = new Float32Array(Math.max(1, Math.ceil(durationSeconds * targetSampleRate)));
|
|
44
|
+
const resampler = new BatchedMonoResampler(target, targetSampleRate);
|
|
45
|
+
const written = await this.streamMonoInto(track, resampler, durationSeconds, onProgress);
|
|
46
|
+
return target.subarray(0, written);
|
|
47
|
+
}
|
|
48
|
+
async streamMonoInto(track, resampler, durationSeconds, onProgress) {
|
|
49
|
+
const sink = new AudioSampleSink(track);
|
|
50
|
+
for await (const sample of sink.samples(0)) {
|
|
51
|
+
try {
|
|
52
|
+
await resampler.append(sample);
|
|
53
|
+
if (onProgress)
|
|
54
|
+
onProgress(this.progressAt(sample, durationSeconds));
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
sample.close();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (onProgress)
|
|
61
|
+
onProgress(1);
|
|
62
|
+
return resampler.flush();
|
|
63
|
+
}
|
|
64
|
+
progressAt(sample, durationSeconds) {
|
|
65
|
+
const decodedSeconds = sample.timestamp + sample.numberOfFrames / sample.sampleRate;
|
|
66
|
+
if (durationSeconds <= 0)
|
|
67
|
+
return 0;
|
|
68
|
+
const ratio = decodedSeconds / durationSeconds;
|
|
69
|
+
if (ratio < 0)
|
|
70
|
+
return 0;
|
|
71
|
+
if (ratio > 1)
|
|
72
|
+
return 1;
|
|
73
|
+
return ratio;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=MediaBunnyAudioDecoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaBunnyAudioDecoder.js","sourceRoot":"","sources":["../../../src/modules/transcription/MediaBunnyAudioDecoder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,eAAe,EACf,UAAU,EACV,KAAK,GAGN,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,sBAAsB;IACjC,KAAK,CAAC,MAAM,CACV,KAAW,EACX,gBAAwB,EACxB,UAAuC;QAEvC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACjF,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,gBAAgB,EAAE,UAAU,CAAC,CAAC;QACrE,CAAC;gBAAS,CAAC;YACT,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,WAAW,CACvB,KAAY,EACZ,gBAAwB,EACxB,UAAuC;QAEvC,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,oBAAoB,EAAE,CAAC;QACjD,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,IAAI,YAAY,CACpB,iDAAiD,KAAK,IAAI,SAAS,EAAE,EACrE,mBAAmB,CACpB,CAAC;QACJ,CAAC;QACD,MAAM,eAAe,GAAG,MAAM,KAAK,CAAC,eAAe,EAAE,CAAC;QACtD,IAAI,eAAe,IAAI,CAAC;YAAE,OAAO,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;QAErD,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;QAC5F,MAAM,SAAS,GAAG,IAAI,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;QACzF,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAEO,KAAK,CAAC,cAAc,CAC1B,KAAsB,EACtB,SAA+B,EAC/B,eAAuB,EACvB,UAAuC;QAEvC,MAAM,IAAI,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;QACxC,IAAI,KAAK,EAAE,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC;gBACH,MAAM,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC/B,IAAI,UAAU;oBAAE,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;YACvE,CAAC;oBAAS,CAAC;gBACT,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,CAAC;QACH,CAAC;QACD,IAAI,UAAU;YAAE,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9B,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAEO,UAAU,CAAC,MAAmB,EAAE,eAAuB;QAC7D,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC;QACpF,IAAI,eAAe,IAAI,CAAC;YAAE,OAAO,CAAC,CAAC;QACnC,MAAM,KAAK,GAAG,cAAc,GAAG,eAAe,CAAC;QAC/C,IAAI,KAAK,GAAG,CAAC;YAAE,OAAO,CAAC,CAAC;QACxB,IAAI,KAAK,GAAG,CAAC;YAAE,OAAO,CAAC,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local store for the model files a transcriber downloads, so a later
|
|
3
|
+
* run reads them back instead of fetching them again.
|
|
4
|
+
*
|
|
5
|
+
* Both operations are best-effort by contract: a store that cannot
|
|
6
|
+
* answer reports a miss, and a store that cannot keep a file resolves
|
|
7
|
+
* anyway. Neither ever rejects. Losing the copy costs a download on
|
|
8
|
+
* the next run, which is worth far less than the transcription in
|
|
9
|
+
* flight.
|
|
10
|
+
*
|
|
11
|
+
* Keys are opaque strings chosen by the caller and must round-trip
|
|
12
|
+
* verbatim between `put` and `match`.
|
|
13
|
+
*/
|
|
14
|
+
export interface ModelFileCache {
|
|
15
|
+
/** The stored file, or `undefined` when this key was never kept. */
|
|
16
|
+
match(key: string): Promise<Response | undefined>;
|
|
17
|
+
/** Keeps `response` under `key`, replacing nothing already there. */
|
|
18
|
+
put(key: string, response: Response): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ModelFileCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModelFileCache.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/ModelFileCache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;IAElD,qEAAqE;IACrE,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModelFileCache.js","sourceRoot":"","sources":["../../../src/modules/transcription/ModelFileCache.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Raised when the runtime exposes no place to keep model files, so
|
|
3
|
+
* every run has to download them again.
|
|
4
|
+
*
|
|
5
|
+
* The Cache Storage API is restricted to secure contexts and withheld
|
|
6
|
+
* altogether by some privacy modes, so a page served over plain HTTP
|
|
7
|
+
* from anything other than localhost has nowhere to put them.
|
|
8
|
+
*
|
|
9
|
+
* The `.name` string is set explicitly, and exposed as `ERROR_NAME` on
|
|
10
|
+
* the class, so consumers can recognise the failure across a Worker
|
|
11
|
+
* boundary (where structured cloning preserves the string fields but
|
|
12
|
+
* not the class identity) with a single source of truth.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ModelFileCacheUnavailableError extends Error {
|
|
15
|
+
static readonly ERROR_NAME = "ModelFileCacheUnavailableError";
|
|
16
|
+
readonly name = "ModelFileCacheUnavailableError";
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ModelFileCacheUnavailableError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModelFileCacheUnavailableError.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/ModelFileCacheUnavailableError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,qBAAa,8BAA+B,SAAQ,KAAK;IACvD,MAAM,CAAC,QAAQ,CAAC,UAAU,oCAAoC;IAC9D,QAAQ,CAAC,IAAI,oCAA6C;CAC3D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Raised when the runtime exposes no place to keep model files, so
|
|
3
|
+
* every run has to download them again.
|
|
4
|
+
*
|
|
5
|
+
* The Cache Storage API is restricted to secure contexts and withheld
|
|
6
|
+
* altogether by some privacy modes, so a page served over plain HTTP
|
|
7
|
+
* from anything other than localhost has nowhere to put them.
|
|
8
|
+
*
|
|
9
|
+
* The `.name` string is set explicitly, and exposed as `ERROR_NAME` on
|
|
10
|
+
* the class, so consumers can recognise the failure across a Worker
|
|
11
|
+
* boundary (where structured cloning preserves the string fields but
|
|
12
|
+
* not the class identity) with a single source of truth.
|
|
13
|
+
*/
|
|
14
|
+
export class ModelFileCacheUnavailableError extends Error {
|
|
15
|
+
static ERROR_NAME = 'ModelFileCacheUnavailableError';
|
|
16
|
+
name = ModelFileCacheUnavailableError.ERROR_NAME;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ModelFileCacheUnavailableError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModelFileCacheUnavailableError.js","sourceRoot":"","sources":["../../../src/modules/transcription/ModelFileCacheUnavailableError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IACvD,MAAM,CAAU,UAAU,GAAG,gCAAgC,CAAC;IACrD,IAAI,GAAG,8BAA8B,CAAC,UAAU,CAAC"}
|
|
@@ -1,33 +1,42 @@
|
|
|
1
|
-
import { Document } from '../document/Document';
|
|
1
|
+
import type { Document } from '../document/Document';
|
|
2
2
|
import type { Transcriber, TranscriberOptions, TranscriberProgressEvent } from '../transcription/Transcriber';
|
|
3
3
|
/**
|
|
4
4
|
* Builds a Document by parsing a SubRip (SRT) caption file. Each cue
|
|
5
5
|
* becomes one `Segment` carrying the cue's full time range; the cue's
|
|
6
6
|
* text (multi-line entries joined with a space, formatting tags
|
|
7
|
-
* stripped) becomes one `Line
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* stripped) becomes one `Line`.
|
|
8
|
+
*
|
|
9
|
+
* SubRip times nothing below a cue, so word timings are shared out
|
|
10
|
+
* across the cue in proportion to how long each word is to write. Each
|
|
11
|
+
* word lights up in sequence rather than all at once, but where one
|
|
12
|
+
* begins is a guess, not something the file said.
|
|
10
13
|
*
|
|
11
14
|
* The audio Blob passed to `transcribe` is ignored. Useful when the
|
|
12
15
|
* caption text and timing are already known — burning a hand-authored
|
|
13
16
|
* SRT into a video, replaying captions from a previous run, etc.
|
|
14
17
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
18
|
+
* A block that carries no timecode is skipped and announced through
|
|
19
|
+
* `onSkippedCueBlock`, so a single broken cue costs its own text and
|
|
20
|
+
* nothing else. Throws only when the file has blocks and none of them
|
|
21
|
+
* could be read, or when a timecode itself is malformed.
|
|
22
|
+
*
|
|
23
|
+
* Builds its own collaborators rather than receiving them. The
|
|
24
|
+
* constructor is the surface a consumer of the engine reaches for, and
|
|
25
|
+
* it asks for a source and nothing else, so this class is where the
|
|
26
|
+
* parsing side is assembled rather than a participant in someone
|
|
27
|
+
* else's assembly.
|
|
17
28
|
*/
|
|
18
29
|
export declare class SrtTranscriber implements Transcriber {
|
|
19
30
|
private readonly source;
|
|
20
31
|
onProgress?: (event: TranscriberProgressEvent) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Fired once per block left out of the document, before
|
|
34
|
+
* `transcribe` resolves, carrying the block verbatim.
|
|
35
|
+
*/
|
|
36
|
+
onSkippedCueBlock?: (block: string) => void;
|
|
37
|
+
private readonly documentBuilder;
|
|
38
|
+
private readonly wordReader;
|
|
21
39
|
constructor(source: string);
|
|
22
40
|
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
41
|
}
|
|
33
42
|
//# sourceMappingURL=SrtTranscriber.d.ts.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"SrtTranscriber.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/SrtTranscriber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAM3D,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,cAAe,YAAW,WAAW;IAepC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAdnC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAEvD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAmD;IACnF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAGzB;gBAE2B,MAAM,EAAE,MAAM;IAErC,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAMjF"}
|
|
@@ -1,111 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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/;
|
|
1
|
+
import { CueDocumentBuilder } from '../transcription/CueDocumentBuilder';
|
|
2
|
+
import { CueTextTokenizer } from '../transcription/CueTextTokenizer';
|
|
3
|
+
import { CueTimecodeReader } from '../transcription/CueTimecodeReader';
|
|
4
|
+
import { EstimatedCueWordReader } from '../transcription/EstimatedCueWordReader';
|
|
5
|
+
import { WordTimingEstimator } from '../transcription/WordTimingEstimator';
|
|
10
6
|
/**
|
|
11
7
|
* Builds a Document by parsing a SubRip (SRT) caption file. Each cue
|
|
12
8
|
* becomes one `Segment` carrying the cue's full time range; the cue's
|
|
13
9
|
* text (multi-line entries joined with a space, formatting tags
|
|
14
|
-
* stripped) becomes one `Line
|
|
15
|
-
*
|
|
16
|
-
*
|
|
10
|
+
* stripped) becomes one `Line`.
|
|
11
|
+
*
|
|
12
|
+
* SubRip times nothing below a cue, so word timings are shared out
|
|
13
|
+
* across the cue in proportion to how long each word is to write. Each
|
|
14
|
+
* word lights up in sequence rather than all at once, but where one
|
|
15
|
+
* begins is a guess, not something the file said.
|
|
17
16
|
*
|
|
18
17
|
* The audio Blob passed to `transcribe` is ignored. Useful when the
|
|
19
18
|
* caption text and timing are already known — burning a hand-authored
|
|
20
19
|
* SRT into a video, replaying captions from a previous run, etc.
|
|
21
20
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* A block that carries no timecode is skipped and announced through
|
|
22
|
+
* `onSkippedCueBlock`, so a single broken cue costs its own text and
|
|
23
|
+
* nothing else. Throws only when the file has blocks and none of them
|
|
24
|
+
* could be read, or when a timecode itself is malformed.
|
|
25
|
+
*
|
|
26
|
+
* Builds its own collaborators rather than receiving them. The
|
|
27
|
+
* constructor is the surface a consumer of the engine reaches for, and
|
|
28
|
+
* it asks for a source and nothing else, so this class is where the
|
|
29
|
+
* parsing side is assembled rather than a participant in someone
|
|
30
|
+
* else's assembly.
|
|
24
31
|
*/
|
|
25
32
|
export class SrtTranscriber {
|
|
26
33
|
source;
|
|
27
34
|
onProgress;
|
|
35
|
+
/**
|
|
36
|
+
* Fired once per block left out of the document, before
|
|
37
|
+
* `transcribe` resolves, carrying the block verbatim.
|
|
38
|
+
*/
|
|
39
|
+
onSkippedCueBlock;
|
|
40
|
+
documentBuilder = new CueDocumentBuilder(new CueTimecodeReader());
|
|
41
|
+
wordReader = new EstimatedCueWordReader(new CueTextTokenizer(), new WordTimingEstimator());
|
|
28
42
|
constructor(source) {
|
|
29
43
|
this.source = source;
|
|
30
44
|
}
|
|
31
45
|
async transcribe(_audio, _options) {
|
|
32
46
|
this.onProgress?.({ stage: 'inferring', progress: 1 });
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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;
|
|
47
|
+
const result = this.documentBuilder.build(this.source, this.wordReader);
|
|
48
|
+
for (const block of result.skippedBlocks)
|
|
49
|
+
this.onSkippedCueBlock?.(block);
|
|
50
|
+
return result.document;
|
|
109
51
|
}
|
|
110
52
|
}
|
|
111
53
|
//# sourceMappingURL=SrtTranscriber.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SrtTranscriber.js","sourceRoot":"","sources":["../../../src/modules/transcription/SrtTranscriber.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SrtTranscriber.js","sourceRoot":"","sources":["../../../src/modules/transcription/SrtTranscriber.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAOjF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,cAAc;IAeI;IAd7B,UAAU,CAA6C;IAEvD;;;OAGG;IACH,iBAAiB,CAA2B;IAE3B,eAAe,GAAG,IAAI,kBAAkB,CAAC,IAAI,iBAAiB,EAAE,CAAC,CAAC;IAClE,UAAU,GAAG,IAAI,sBAAsB,CACtD,IAAI,gBAAgB,EAAE,EACtB,IAAI,mBAAmB,EAAE,CAC1B,CAAC;IAEF,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,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,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACxE,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,aAAa;YAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,KAAK,CAAC,CAAC;QAC1E,OAAO,MAAM,CAAC,QAAQ,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Raised when a caption file yielded no cues at all and at least one
|
|
3
|
+
* of its blocks was unreadable.
|
|
4
|
+
*
|
|
5
|
+
* Skipping the odd broken block leaves a usable file behind; skipping
|
|
6
|
+
* every block does not, and handing back an empty transcript would
|
|
7
|
+
* read as "this file said nothing" rather than "this file could not
|
|
8
|
+
* be understood".
|
|
9
|
+
*
|
|
10
|
+
* A file that is genuinely empty is not this: it yields an empty
|
|
11
|
+
* document, because there is nothing to misread.
|
|
12
|
+
*
|
|
13
|
+
* The `.name` string is set explicitly, and exposed as `ERROR_NAME` on
|
|
14
|
+
* the class, so consumers can recognise the failure across a Worker
|
|
15
|
+
* boundary (where structured cloning preserves the string fields but
|
|
16
|
+
* not the class identity) with a single source of truth.
|
|
17
|
+
*/
|
|
18
|
+
export declare class SubtitleFileUnreadableError extends Error {
|
|
19
|
+
static readonly ERROR_NAME = "SubtitleFileUnreadableError";
|
|
20
|
+
readonly name = "SubtitleFileUnreadableError";
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=SubtitleFileUnreadableError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleFileUnreadableError.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/SubtitleFileUnreadableError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,MAAM,CAAC,QAAQ,CAAC,UAAU,iCAAiC;IAC3D,QAAQ,CAAC,IAAI,iCAA0C;CACxD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Raised when a caption file yielded no cues at all and at least one
|
|
3
|
+
* of its blocks was unreadable.
|
|
4
|
+
*
|
|
5
|
+
* Skipping the odd broken block leaves a usable file behind; skipping
|
|
6
|
+
* every block does not, and handing back an empty transcript would
|
|
7
|
+
* read as "this file said nothing" rather than "this file could not
|
|
8
|
+
* be understood".
|
|
9
|
+
*
|
|
10
|
+
* A file that is genuinely empty is not this: it yields an empty
|
|
11
|
+
* document, because there is nothing to misread.
|
|
12
|
+
*
|
|
13
|
+
* The `.name` string is set explicitly, and exposed as `ERROR_NAME` on
|
|
14
|
+
* the class, so consumers can recognise the failure across a Worker
|
|
15
|
+
* boundary (where structured cloning preserves the string fields but
|
|
16
|
+
* not the class identity) with a single source of truth.
|
|
17
|
+
*/
|
|
18
|
+
export class SubtitleFileUnreadableError extends Error {
|
|
19
|
+
static ERROR_NAME = 'SubtitleFileUnreadableError';
|
|
20
|
+
name = SubtitleFileUnreadableError.ERROR_NAME;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=SubtitleFileUnreadableError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleFileUnreadableError.js","sourceRoot":"","sources":["../../../src/modules/transcription/SubtitleFileUnreadableError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IACpD,MAAM,CAAU,UAAU,GAAG,6BAA6B,CAAC;IAClD,IAAI,GAAG,2BAA2B,CAAC,UAAU,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Word } from '../document/Word';
|
|
2
|
+
import type { CueTextTokenizer } from '../transcription/CueTextTokenizer';
|
|
3
|
+
import type { CueTimecodeReader } from '../transcription/CueTimecodeReader';
|
|
4
|
+
import type { CueWordReader } from '../transcription/CueWordReader';
|
|
5
|
+
import type { WordTimingEstimator } from '../transcription/WordTimingEstimator';
|
|
6
|
+
/**
|
|
7
|
+
* Reads a cue from a format that can mark, inside the cue's own text,
|
|
8
|
+
* when a word is spoken — WebVTT does this so a caption can be revealed
|
|
9
|
+
* word by word without being broken into an entry per word.
|
|
10
|
+
*
|
|
11
|
+
* Each mark cuts the cue into a stretch that runs until the next mark,
|
|
12
|
+
* and the words of a stretch share it out between them. A mark before
|
|
13
|
+
* every word therefore yields the timing the file recorded; a mark
|
|
14
|
+
* every few words yields those, with the words between them estimated.
|
|
15
|
+
* A cue carrying no marks at all is one stretch, which is the same
|
|
16
|
+
* answer a format without marks would give.
|
|
17
|
+
*/
|
|
18
|
+
export declare class TimestampedCueWordReader implements CueWordReader {
|
|
19
|
+
private readonly tokenizer;
|
|
20
|
+
private readonly timecodeReader;
|
|
21
|
+
private readonly estimator;
|
|
22
|
+
constructor(tokenizer: CueTextTokenizer, timecodeReader: CueTimecodeReader, estimator: WordTimingEstimator);
|
|
23
|
+
read(text: string, startSeconds: number, endSeconds: number): ReadonlyArray<Word>;
|
|
24
|
+
private cutIntoStretches;
|
|
25
|
+
private positionOf;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=TimestampedCueWordReader.d.ts.map
|