@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,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consumes mediabunny {@link AudioSample}s in source order, downmixes
|
|
3
|
+
* each to mono, and writes resampled frames into a caller-owned target
|
|
4
|
+
* buffer at monotonically increasing offsets.
|
|
5
|
+
*
|
|
6
|
+
* Batches source-rate frames in a fixed-size internal buffer so the
|
|
7
|
+
* whole track never sits in memory at once. Each full batch is
|
|
8
|
+
* resampled through a fresh `OfflineAudioContext` and copied straight
|
|
9
|
+
* into the target — a track of any length peaks at one batch worth of
|
|
10
|
+
* source-rate PCM plus the target buffer, instead of the full-track
|
|
11
|
+
* source-rate buffer the collect-then-resample approach needed. On a
|
|
12
|
+
* 60-minute 48 kHz mono source that is ~5.7 MB per batch instead of
|
|
13
|
+
* ~690 MB across the whole run.
|
|
14
|
+
*
|
|
15
|
+
* The source sample rate is discovered on the first appended sample —
|
|
16
|
+
* `AudioSample.sampleRate` is stable across a single mediabunny track.
|
|
17
|
+
* The target sample rate is fixed at construction. When the two match
|
|
18
|
+
* the batch bypasses `OfflineAudioContext` and is copied verbatim.
|
|
19
|
+
*
|
|
20
|
+
* The target buffer is written up to its own capacity; any tail beyond
|
|
21
|
+
* that is silently discarded, so the caller's pre-size determines the
|
|
22
|
+
* ceiling. `flush` returns the actual number of frames written and the
|
|
23
|
+
* caller can `subarray(0, written)` to trim any pre-sizing slack.
|
|
24
|
+
*/
|
|
25
|
+
export class BatchedMonoResampler {
|
|
26
|
+
target;
|
|
27
|
+
targetSampleRate;
|
|
28
|
+
static BATCH_SECONDS = 30;
|
|
29
|
+
batch = new Float32Array(0);
|
|
30
|
+
batchFrames = 0;
|
|
31
|
+
sourceSampleRate = 0;
|
|
32
|
+
channelScratch = new Float32Array(0);
|
|
33
|
+
targetOffset = 0;
|
|
34
|
+
constructor(target, targetSampleRate) {
|
|
35
|
+
this.target = target;
|
|
36
|
+
this.targetSampleRate = targetSampleRate;
|
|
37
|
+
}
|
|
38
|
+
async append(sample) {
|
|
39
|
+
if (this.sourceSampleRate === 0)
|
|
40
|
+
this.initFromFirstSample(sample);
|
|
41
|
+
const frames = sample.numberOfFrames;
|
|
42
|
+
if (frames === 0)
|
|
43
|
+
return;
|
|
44
|
+
this.ensureBatchCapacityFor(this.batchFrames + frames);
|
|
45
|
+
this.mixSampleIntoBatch(sample, this.batchFrames);
|
|
46
|
+
this.batchFrames += frames;
|
|
47
|
+
if (this.batchFrames >= this.batch.length)
|
|
48
|
+
await this.emitBatch();
|
|
49
|
+
}
|
|
50
|
+
async flush() {
|
|
51
|
+
if (this.batchFrames > 0)
|
|
52
|
+
await this.emitBatch();
|
|
53
|
+
return this.targetOffset;
|
|
54
|
+
}
|
|
55
|
+
initFromFirstSample(sample) {
|
|
56
|
+
this.sourceSampleRate = sample.sampleRate;
|
|
57
|
+
this.batch = new Float32Array(this.sourceSampleRate * BatchedMonoResampler.BATCH_SECONDS);
|
|
58
|
+
}
|
|
59
|
+
ensureBatchCapacityFor(needed) {
|
|
60
|
+
if (this.batch.length >= needed)
|
|
61
|
+
return;
|
|
62
|
+
const grown = new Float32Array(needed);
|
|
63
|
+
grown.set(this.batch.subarray(0, this.batchFrames));
|
|
64
|
+
this.batch = grown;
|
|
65
|
+
}
|
|
66
|
+
async emitBatch() {
|
|
67
|
+
const source = this.batch.subarray(0, this.batchFrames);
|
|
68
|
+
const resampled = this.sourceSampleRate === this.targetSampleRate
|
|
69
|
+
? source
|
|
70
|
+
: await this.resampleBatch(source);
|
|
71
|
+
this.writeIntoTarget(resampled);
|
|
72
|
+
this.batchFrames = 0;
|
|
73
|
+
}
|
|
74
|
+
async resampleBatch(source) {
|
|
75
|
+
const targetFrames = Math.max(1, Math.ceil(source.length * this.targetSampleRate / this.sourceSampleRate));
|
|
76
|
+
const ctx = new OfflineAudioContext(1, targetFrames, this.targetSampleRate);
|
|
77
|
+
const buffer = ctx.createBuffer(1, source.length, this.sourceSampleRate);
|
|
78
|
+
buffer.getChannelData(0).set(source);
|
|
79
|
+
const node = ctx.createBufferSource();
|
|
80
|
+
node.buffer = buffer;
|
|
81
|
+
node.connect(ctx.destination);
|
|
82
|
+
node.start();
|
|
83
|
+
const rendered = await ctx.startRendering();
|
|
84
|
+
return rendered.getChannelData(0);
|
|
85
|
+
}
|
|
86
|
+
writeIntoTarget(source) {
|
|
87
|
+
const room = this.target.length - this.targetOffset;
|
|
88
|
+
if (room <= 0)
|
|
89
|
+
return;
|
|
90
|
+
const writeLen = Math.min(source.length, room);
|
|
91
|
+
this.target.set(source.subarray(0, writeLen), this.targetOffset);
|
|
92
|
+
this.targetOffset += writeLen;
|
|
93
|
+
}
|
|
94
|
+
mixSampleIntoBatch(sample, writeOffset) {
|
|
95
|
+
const frames = sample.numberOfFrames;
|
|
96
|
+
const channels = sample.numberOfChannels;
|
|
97
|
+
const target = this.batch.subarray(writeOffset, writeOffset + frames);
|
|
98
|
+
if (channels <= 1) {
|
|
99
|
+
sample.copyTo(target, { planeIndex: 0, format: 'f32-planar' });
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (this.channelScratch.length < frames)
|
|
103
|
+
this.channelScratch = new Float32Array(frames);
|
|
104
|
+
const scratch = this.channelScratch.subarray(0, frames);
|
|
105
|
+
sample.copyTo(target, { planeIndex: 0, format: 'f32-planar' });
|
|
106
|
+
for (let channel = 1; channel < channels; channel += 1) {
|
|
107
|
+
sample.copyTo(scratch, { planeIndex: channel, format: 'f32-planar' });
|
|
108
|
+
for (let frame = 0; frame < frames; frame += 1)
|
|
109
|
+
target[frame] += scratch[frame];
|
|
110
|
+
}
|
|
111
|
+
const inverseChannels = 1 / channels;
|
|
112
|
+
for (let frame = 0; frame < frames; frame += 1)
|
|
113
|
+
target[frame] *= inverseChannels;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=BatchedMonoResampler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BatchedMonoResampler.js","sourceRoot":"","sources":["../../../src/modules/transcription/BatchedMonoResampler.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAu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,CAAC;QAED,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,MAAM;YAAE,IAAI,CAAC,cAAc,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;QACxF,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACxD,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;QAC/D,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;YACvD,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;YACtE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;gBAAE,MAAM,CAAC,KAAK,CAAE,IAAI,OAAO,CAAC,KAAK,CAAE,CAAC;QACpF,CAAC;QACD,MAAM,eAAe,GAAG,CAAC,GAAG,QAAQ,CAAC;QACrC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;YAAE,MAAM,CAAC,KAAK,CAAE,IAAI,eAAe,CAAC;IACpF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ModelFileCache } from '../transcription/ModelFileCache';
|
|
2
|
+
/**
|
|
3
|
+
* Keeps model files in the browser's Cache Storage.
|
|
4
|
+
*
|
|
5
|
+
* Browsers refuse this write far more often than one would expect —
|
|
6
|
+
* an origin over its quota, a private window, a page outside a secure
|
|
7
|
+
* context — and every refusal costs the next run a full re-download of
|
|
8
|
+
* hundreds of megabytes with nothing on screen to explain it. The
|
|
9
|
+
* refusal is therefore handed to `onKeepFailure` instead of being
|
|
10
|
+
* swallowed, while the run in flight carries on regardless: the files
|
|
11
|
+
* are already in memory and the transcription does not need them kept.
|
|
12
|
+
*
|
|
13
|
+
* Only the first refusal of an instance's lifetime is announced. A
|
|
14
|
+
* model is several files and the condition behind a refusal applies to
|
|
15
|
+
* all of them, so the rest would say the same thing again.
|
|
16
|
+
*/
|
|
17
|
+
export declare class CacheStorageModelFileCache implements ModelFileCache {
|
|
18
|
+
private readonly onKeepFailure;
|
|
19
|
+
private static readonly CACHE_NAME;
|
|
20
|
+
private opening;
|
|
21
|
+
private failureAnnounced;
|
|
22
|
+
/**
|
|
23
|
+
* @param onKeepFailure Called at most once per instance, with the
|
|
24
|
+
* refusal that stopped a file from being kept.
|
|
25
|
+
*/
|
|
26
|
+
constructor(onKeepFailure: (error: unknown) => void);
|
|
27
|
+
match(key: string): Promise<Response | undefined>;
|
|
28
|
+
put(key: string, response: Response): Promise<void>;
|
|
29
|
+
private announce;
|
|
30
|
+
/**
|
|
31
|
+
* Resolves to `null` when this runtime has no Cache Storage at all,
|
|
32
|
+
* which is a standing condition rather than a transient one — hence
|
|
33
|
+
* the single attempt, reused by every later call.
|
|
34
|
+
*/
|
|
35
|
+
private open;
|
|
36
|
+
private openOnce;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=CacheStorageModelFileCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CacheStorageModelFileCache.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/CacheStorageModelFileCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAG5E;;;;;;;;;;;;;;GAcG;AACH,qBAAa,0BAA2B,YAAW,cAAc;IAcnD,OAAO,CAAC,QAAQ,CAAC,aAAa;IAT1C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAwB;IAE1D,OAAO,CAAC,OAAO,CAAsC;IACrD,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;;OAGG;gBAC0B,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAE9D,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;IAYjD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAazD,OAAO,CAAC,QAAQ;IAMhB;;;;OAIG;IACH,OAAO,CAAC,IAAI;YAKE,QAAQ;CAUvB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ModelFileCacheUnavailableError } from '../transcription/ModelFileCacheUnavailableError';
|
|
2
|
+
/**
|
|
3
|
+
* Keeps model files in the browser's Cache Storage.
|
|
4
|
+
*
|
|
5
|
+
* Browsers refuse this write far more often than one would expect —
|
|
6
|
+
* an origin over its quota, a private window, a page outside a secure
|
|
7
|
+
* context — and every refusal costs the next run a full re-download of
|
|
8
|
+
* hundreds of megabytes with nothing on screen to explain it. The
|
|
9
|
+
* refusal is therefore handed to `onKeepFailure` instead of being
|
|
10
|
+
* swallowed, while the run in flight carries on regardless: the files
|
|
11
|
+
* are already in memory and the transcription does not need them kept.
|
|
12
|
+
*
|
|
13
|
+
* Only the first refusal of an instance's lifetime is announced. A
|
|
14
|
+
* model is several files and the condition behind a refusal applies to
|
|
15
|
+
* all of them, so the rest would say the same thing again.
|
|
16
|
+
*/
|
|
17
|
+
export class CacheStorageModelFileCache {
|
|
18
|
+
onKeepFailure;
|
|
19
|
+
// The name transformers.js opens by default. Matching it keeps the
|
|
20
|
+
// files downloaded by earlier versions, which used the library's own
|
|
21
|
+
// caching, readable by this one.
|
|
22
|
+
static CACHE_NAME = 'transformers-cache';
|
|
23
|
+
opening = null;
|
|
24
|
+
failureAnnounced = false;
|
|
25
|
+
/**
|
|
26
|
+
* @param onKeepFailure Called at most once per instance, with the
|
|
27
|
+
* refusal that stopped a file from being kept.
|
|
28
|
+
*/
|
|
29
|
+
constructor(onKeepFailure) {
|
|
30
|
+
this.onKeepFailure = onKeepFailure;
|
|
31
|
+
}
|
|
32
|
+
async match(key) {
|
|
33
|
+
const cache = await this.open();
|
|
34
|
+
if (!cache)
|
|
35
|
+
return undefined;
|
|
36
|
+
try {
|
|
37
|
+
return await cache.match(key);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// A cache that cannot be read is indistinguishable from one that
|
|
41
|
+
// never held the file: both mean it has to be downloaded.
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async put(key, response) {
|
|
46
|
+
const cache = await this.open();
|
|
47
|
+
if (!cache) {
|
|
48
|
+
this.announce(new ModelFileCacheUnavailableError('Cache Storage is not exposed in this context'));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
await cache.put(key, response);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
this.announce(error);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
announce(error) {
|
|
59
|
+
if (this.failureAnnounced)
|
|
60
|
+
return;
|
|
61
|
+
this.failureAnnounced = true;
|
|
62
|
+
this.onKeepFailure(error);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Resolves to `null` when this runtime has no Cache Storage at all,
|
|
66
|
+
* which is a standing condition rather than a transient one — hence
|
|
67
|
+
* the single attempt, reused by every later call.
|
|
68
|
+
*/
|
|
69
|
+
open() {
|
|
70
|
+
this.opening ??= this.openOnce();
|
|
71
|
+
return this.opening;
|
|
72
|
+
}
|
|
73
|
+
async openOnce() {
|
|
74
|
+
if (typeof caches === 'undefined')
|
|
75
|
+
return null;
|
|
76
|
+
try {
|
|
77
|
+
return await caches.open(CacheStorageModelFileCache.CACHE_NAME);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// Opening is refused outright in some privacy modes. There is
|
|
81
|
+
// nothing to fall back to, and `put` reports the consequence.
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=CacheStorageModelFileCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CacheStorageModelFileCache.js","sourceRoot":"","sources":["../../../src/modules/transcription/CacheStorageModelFileCache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAC;AAEvG;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,0BAA0B;IAcR;IAZ7B,mEAAmE;IACnE,qEAAqE;IACrE,iCAAiC;IACzB,MAAM,CAAU,UAAU,GAAG,oBAAoB,CAAC;IAElD,OAAO,GAAiC,IAAI,CAAC;IAC7C,gBAAgB,GAAG,KAAK,CAAC;IAEjC;;;OAGG;IACH,YAA6B,aAAuC;QAAvC,kBAAa,GAAb,aAAa,CAA0B;IAAG,CAAC;IAExE,KAAK,CAAC,KAAK,CAAC,GAAW;QACrB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAChC,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAC7B,IAAI,CAAC;YACH,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,iEAAiE;YACjE,0DAA0D;YAC1D,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,QAAkB;QACvC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAChC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,QAAQ,CAAC,IAAI,8BAA8B,CAAC,8CAA8C,CAAC,CAAC,CAAC;YAClG,OAAO;QACT,CAAC;QACD,IAAI,CAAC;YACH,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAEO,QAAQ,CAAC,KAAc;QAC7B,IAAI,IAAI,CAAC,gBAAgB;YAAE,OAAO;QAClC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACK,IAAI;QACV,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEO,KAAK,CAAC,QAAQ;QACpB,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO,IAAI,CAAC;QAC/C,IAAI,CAAC;YACH,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC;QAClE,CAAC;QAAC,MAAM,CAAC;YACP,8DAA8D;YAC9D,8DAA8D;YAC9D,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { CueParseResult } from '../transcription/CueParseResult';
|
|
2
|
+
import type { CueTimecodeReader } from '../transcription/CueTimecodeReader';
|
|
3
|
+
import type { CueWordReader } from '../transcription/CueWordReader';
|
|
4
|
+
/**
|
|
5
|
+
* Builds a Document from the cue blocks of a caption file: blank lines
|
|
6
|
+
* separate cues, a `-->` line states the range, and everything below it
|
|
7
|
+
* is the text. Each cue becomes one Segment holding one Line.
|
|
8
|
+
*
|
|
9
|
+
* A counter or identifier above the range line is ignored, since
|
|
10
|
+
* neither says anything the Document keeps. A cue whose text is empty
|
|
11
|
+
* is dropped. How the text becomes timed words is the reader's business
|
|
12
|
+
* and the only thing that differs between formats.
|
|
13
|
+
*
|
|
14
|
+
* A block carrying no range line is skipped and handed back in the
|
|
15
|
+
* result rather than ending the read. This is what the WebVTT parser
|
|
16
|
+
* algorithm prescribes, and it is the only behaviour that serves
|
|
17
|
+
* someone holding a file they did not write: one stray blank line
|
|
18
|
+
* inside a cue, or one paragraph of prose at the end, would otherwise
|
|
19
|
+
* cost them every cue in the file. Deciding whether the remainder is
|
|
20
|
+
* worth using belongs to the caller, which is why the count of what
|
|
21
|
+
* was lost travels with it.
|
|
22
|
+
*
|
|
23
|
+
* A file where every block was skipped is refused outright: what is
|
|
24
|
+
* left is not a thin transcript, it is no transcript, and returning
|
|
25
|
+
* one would say the file was silent rather than unreadable. A file
|
|
26
|
+
* with no blocks at all is not refused — there is nothing in it to
|
|
27
|
+
* misread.
|
|
28
|
+
*
|
|
29
|
+
* A malformed *timecode* still throws. That block announced its
|
|
30
|
+
* intent to state a time and got it wrong, so placing its text
|
|
31
|
+
* anywhere would be a guess.
|
|
32
|
+
*/
|
|
33
|
+
export declare class CueDocumentBuilder {
|
|
34
|
+
private readonly timecodeReader;
|
|
35
|
+
constructor(timecodeReader: CueTimecodeReader);
|
|
36
|
+
build(source: string, wordReader: CueWordReader): CueParseResult;
|
|
37
|
+
private splitIntoBlocks;
|
|
38
|
+
private buildSegment;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=CueDocumentBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CueDocumentBuilder.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/CueDocumentBuilder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAK1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,iBAAiB;IAE9D,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,GAAG,cAAc;IAgBhE,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,YAAY;CAkBrB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Document } from '../document/Document';
|
|
2
|
+
import { Line } from '../document/Line';
|
|
3
|
+
import { Section } from '../document/Section';
|
|
4
|
+
import { Segment } from '../document/Segment';
|
|
5
|
+
import { SubtitleFileUnreadableError } from '../transcription/SubtitleFileUnreadableError';
|
|
6
|
+
const BOM_RE = /^\uFEFF/;
|
|
7
|
+
/**
|
|
8
|
+
* Builds a Document from the cue blocks of a caption file: blank lines
|
|
9
|
+
* separate cues, a `-->` line states the range, and everything below it
|
|
10
|
+
* is the text. Each cue becomes one Segment holding one Line.
|
|
11
|
+
*
|
|
12
|
+
* A counter or identifier above the range line is ignored, since
|
|
13
|
+
* neither says anything the Document keeps. A cue whose text is empty
|
|
14
|
+
* is dropped. How the text becomes timed words is the reader's business
|
|
15
|
+
* and the only thing that differs between formats.
|
|
16
|
+
*
|
|
17
|
+
* A block carrying no range line is skipped and handed back in the
|
|
18
|
+
* result rather than ending the read. This is what the WebVTT parser
|
|
19
|
+
* algorithm prescribes, and it is the only behaviour that serves
|
|
20
|
+
* someone holding a file they did not write: one stray blank line
|
|
21
|
+
* inside a cue, or one paragraph of prose at the end, would otherwise
|
|
22
|
+
* cost them every cue in the file. Deciding whether the remainder is
|
|
23
|
+
* worth using belongs to the caller, which is why the count of what
|
|
24
|
+
* was lost travels with it.
|
|
25
|
+
*
|
|
26
|
+
* A file where every block was skipped is refused outright: what is
|
|
27
|
+
* left is not a thin transcript, it is no transcript, and returning
|
|
28
|
+
* one would say the file was silent rather than unreadable. A file
|
|
29
|
+
* with no blocks at all is not refused — there is nothing in it to
|
|
30
|
+
* misread.
|
|
31
|
+
*
|
|
32
|
+
* A malformed *timecode* still throws. That block announced its
|
|
33
|
+
* intent to state a time and got it wrong, so placing its text
|
|
34
|
+
* anywhere would be a guess.
|
|
35
|
+
*/
|
|
36
|
+
export class CueDocumentBuilder {
|
|
37
|
+
timecodeReader;
|
|
38
|
+
constructor(timecodeReader) {
|
|
39
|
+
this.timecodeReader = timecodeReader;
|
|
40
|
+
}
|
|
41
|
+
build(source, wordReader) {
|
|
42
|
+
const skippedBlocks = [];
|
|
43
|
+
const segments = this.splitIntoBlocks(source)
|
|
44
|
+
.map((block) => this.buildSegment(block, wordReader, skippedBlocks))
|
|
45
|
+
.filter((segment) => segment !== null);
|
|
46
|
+
if (segments.length === 0 && skippedBlocks.length > 0) {
|
|
47
|
+
throw new SubtitleFileUnreadableError(`None of the ${skippedBlocks.length} block(s) in the file carried a timecode line`);
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
document: new Document({ sections: [new Section({ segments, kind: '' })] }),
|
|
51
|
+
skippedBlocks,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
splitIntoBlocks(source) {
|
|
55
|
+
const normalized = source.replace(BOM_RE, '').replace(/\r\n?/g, '\n').trim();
|
|
56
|
+
if (normalized.length === 0)
|
|
57
|
+
return [];
|
|
58
|
+
return normalized.split(/\n{2,}/);
|
|
59
|
+
}
|
|
60
|
+
buildSegment(block, wordReader, skippedBlocks) {
|
|
61
|
+
const lines = block.split('\n').map((line) => line.trim()).filter((line) => line.length > 0);
|
|
62
|
+
if (lines.length === 0)
|
|
63
|
+
return null;
|
|
64
|
+
const rangeAt = lines.findIndex((line) => this.timecodeReader.isRangeLine(line));
|
|
65
|
+
if (rangeAt === -1) {
|
|
66
|
+
skippedBlocks.push(block);
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const range = this.timecodeReader.readRange(lines[rangeAt]);
|
|
70
|
+
const text = lines.slice(rangeAt + 1).join(' ');
|
|
71
|
+
const words = wordReader.read(text, range.startSeconds, range.endSeconds);
|
|
72
|
+
if (words.length === 0)
|
|
73
|
+
return null;
|
|
74
|
+
return new Segment({ lines: [new Line({ words })] });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=CueDocumentBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CueDocumentBuilder.js","sourceRoot":"","sources":["../../../src/modules/transcription/CueDocumentBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAIpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,oDAAoD,CAAC;AAEjG,MAAM,MAAM,GAAG,SAAS,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,OAAO,kBAAkB;IACA;IAA7B,YAA6B,cAAiC;QAAjC,mBAAc,GAAd,cAAc,CAAmB;IAAG,CAAC;IAElE,KAAK,CAAC,MAAc,EAAE,UAAyB;QAC7C,MAAM,aAAa,GAAa,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;aAC1C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;aACnE,MAAM,CAAC,CAAC,OAAO,EAAsB,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;QAC7D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtD,MAAM,IAAI,2BAA2B,CACnC,eAAe,aAAa,CAAC,MAAM,+CAA+C,CACnF,CAAC;QACJ,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,IAAI,QAAQ,CAAC,EAAE,QAAQ,EAAE,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AG,CAAC,CAAC;QAChD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAC1E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACpC,OAAO,IAAI,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Document } from '../document/Document';
|
|
2
|
+
/**
|
|
3
|
+
* What reading a caption file produced: the cues that could be read,
|
|
4
|
+
* and the blocks that could not.
|
|
5
|
+
*
|
|
6
|
+
* The two travel together because a caption file is rarely all right
|
|
7
|
+
* or all wrong. A reader that returned only the document would leave
|
|
8
|
+
* its caller unable to tell a file that was fully understood from one
|
|
9
|
+
* that was mostly understood.
|
|
10
|
+
*/
|
|
11
|
+
export interface CueParseResult {
|
|
12
|
+
readonly document: Document;
|
|
13
|
+
/** Verbatim text of every block that carried no timecode. */
|
|
14
|
+
readonly skippedBlocks: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=CueParseResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CueParseResult.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/CueParseResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAE5B,6DAA6D;IAC7D,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CueParseResult.js","sourceRoot":"","sources":["../../../src/modules/transcription/CueParseResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reduces the text of one cue to the words it says.
|
|
3
|
+
*
|
|
4
|
+
* Markup is dropped, runs of whitespace collapse, and a cue that turns
|
|
5
|
+
* out to hold nothing but markup yields no words at all.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CueTextTokenizer {
|
|
8
|
+
tokenize(text: string): ReadonlyArray<string>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=CueTextTokenizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CueTextTokenizer.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/CueTextTokenizer.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,qBAAa,gBAAgB;IAE3B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;CAM9C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markup a caption file may wrap its text in: WebVTT's angle-bracket
|
|
3
|
+
* tags and the brace-delimited overrides SubRip files sometimes carry
|
|
4
|
+
* from SubStation. None of it survives into a word.
|
|
5
|
+
*/
|
|
6
|
+
const MARKUP = /<[^>]+>|\{[^}]+\}/g;
|
|
7
|
+
/**
|
|
8
|
+
* Reduces the text of one cue to the words it says.
|
|
9
|
+
*
|
|
10
|
+
* Markup is dropped, runs of whitespace collapse, and a cue that turns
|
|
11
|
+
* out to hold nothing but markup yields no words at all.
|
|
12
|
+
*/
|
|
13
|
+
export class CueTextTokenizer {
|
|
14
|
+
tokenize(text) {
|
|
15
|
+
return text
|
|
16
|
+
.replace(MARKUP, '')
|
|
17
|
+
.split(/\s+/)
|
|
18
|
+
.filter((token) => token.length > 0);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=CueTextTokenizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CueTextTokenizer.js","sourceRoot":"","sources":["../../../src/modules/transcription/CueTextTokenizer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,GAAG,oBAAoB,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,OAAO,gBAAgB;IAE3B,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI;aACR,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;aACnB,KAAK,CAAC,KAAK,CAAC;aACZ,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Half-open range a cue occupies, in seconds. */
|
|
2
|
+
export interface CueTimeRange {
|
|
3
|
+
readonly startSeconds: number;
|
|
4
|
+
readonly endSeconds: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Reads the timecodes a caption file states its timings with.
|
|
8
|
+
*
|
|
9
|
+
* Positions are returned in seconds. A malformed timecode throws rather
|
|
10
|
+
* than resolving to zero, so a file that cannot be trusted is refused
|
|
11
|
+
* instead of silently landing every caption at the start.
|
|
12
|
+
*/
|
|
13
|
+
export declare class CueTimecodeReader {
|
|
14
|
+
isRangeLine(line: string): boolean;
|
|
15
|
+
readRange(line: string): CueTimeRange;
|
|
16
|
+
readPosition(timecode: string): number;
|
|
17
|
+
private toSeconds;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=CueTimecodeReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CueTimecodeReader.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/CueTimecodeReader.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAYD;;;;;;GAMG;AACH,qBAAa,iBAAiB;IAE5B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIlC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;IAWrC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAMtC,OAAO,CAAC,SAAS;CAalB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A position written `HH:MM:SS,mmm` or `HH:MM:SS.mmm`. SubRip settled
|
|
3
|
+
* on the comma and WebVTT on the dot, and both are accepted either way
|
|
4
|
+
* because files in the wild mix them. WebVTT also allows the hour to be
|
|
5
|
+
* left out, so it is optional.
|
|
6
|
+
*/
|
|
7
|
+
const POSITION = String.raw `(?:(\d{1,3}):)?(\d{2}):(\d{2})[,.](\d{1,3})`;
|
|
8
|
+
const RANGE_LINE = new RegExp(`^${POSITION}\\s*-->\\s*${POSITION}`);
|
|
9
|
+
const POSITION_ONLY = new RegExp(`^${POSITION}$`);
|
|
10
|
+
/**
|
|
11
|
+
* Reads the timecodes a caption file states its timings with.
|
|
12
|
+
*
|
|
13
|
+
* Positions are returned in seconds. A malformed timecode throws rather
|
|
14
|
+
* than resolving to zero, so a file that cannot be trusted is refused
|
|
15
|
+
* instead of silently landing every caption at the start.
|
|
16
|
+
*/
|
|
17
|
+
export class CueTimecodeReader {
|
|
18
|
+
isRangeLine(line) {
|
|
19
|
+
return RANGE_LINE.test(line);
|
|
20
|
+
}
|
|
21
|
+
readRange(line) {
|
|
22
|
+
const match = RANGE_LINE.exec(line);
|
|
23
|
+
if (match === null)
|
|
24
|
+
throw new Error(`Malformed cue timecode: ${JSON.stringify(line)}`);
|
|
25
|
+
const startSeconds = this.toSeconds(match[1], match[2], match[3], match[4]);
|
|
26
|
+
const endSeconds = this.toSeconds(match[5], match[6], match[7], match[8]);
|
|
27
|
+
if (endSeconds < startSeconds) {
|
|
28
|
+
throw new Error(`Cue timecode ends before it starts: ${JSON.stringify(line)}`);
|
|
29
|
+
}
|
|
30
|
+
return { startSeconds, endSeconds };
|
|
31
|
+
}
|
|
32
|
+
readPosition(timecode) {
|
|
33
|
+
const match = POSITION_ONLY.exec(timecode);
|
|
34
|
+
if (match === null)
|
|
35
|
+
throw new Error(`Malformed timecode: ${JSON.stringify(timecode)}`);
|
|
36
|
+
return this.toSeconds(match[1], match[2], match[3], match[4]);
|
|
37
|
+
}
|
|
38
|
+
toSeconds(hours, minutes, seconds, milliseconds) {
|
|
39
|
+
return (Number(hours ?? 0) * 3600 +
|
|
40
|
+
Number(minutes) * 60 +
|
|
41
|
+
Number(seconds) +
|
|
42
|
+
Number(milliseconds.padEnd(3, '0')) / 1000);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=CueTimecodeReader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CueTimecodeReader.js","sourceRoot":"","sources":["../../../src/modules/transcription/CueTimecodeReader.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAA,6CAA6C,CAAC;AACzE,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,IAAI,QAAQ,cAAc,QAAQ,EAAE,CAAC,CAAC;AACpE,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,OAAO,iBAAiB;IAE5B,WAAW,CAAC,IAAY;QACtB,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,SAAS,CAAC,IAAY;QACpB,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,KAAK,KAAK,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvF,MAA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C;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Word } from '../document/Word';
|
|
2
|
+
/**
|
|
3
|
+
* Turns the text of one cue into the words it holds, timed.
|
|
4
|
+
*
|
|
5
|
+
* Implementations differ in how much the file told them: some formats
|
|
6
|
+
* time nothing below the cue and leave the words to be guessed at,
|
|
7
|
+
* others mark when each word is spoken and can be taken at their word.
|
|
8
|
+
*/
|
|
9
|
+
export interface CueWordReader {
|
|
10
|
+
read(text: string, startSeconds: number, endSeconds: number): ReadonlyArray<Word>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=CueWordReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CueWordReader.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/CueWordReader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;CACnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CueWordReader.js","sourceRoot":"","sources":["../../../src/modules/transcription/CueWordReader.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Word } from '../document/Word';
|
|
2
|
+
import type { CueTextTokenizer } from '../transcription/CueTextTokenizer';
|
|
3
|
+
import type { CueWordReader } from '../transcription/CueWordReader';
|
|
4
|
+
import type { WordTimingEstimator } from '../transcription/WordTimingEstimator';
|
|
5
|
+
/**
|
|
6
|
+
* Reads a cue from a format that times nothing below the cue itself.
|
|
7
|
+
* The words are known, when each is spoken is not, so the cue's own
|
|
8
|
+
* window is shared out among them.
|
|
9
|
+
*/
|
|
10
|
+
export declare class EstimatedCueWordReader implements CueWordReader {
|
|
11
|
+
private readonly tokenizer;
|
|
12
|
+
private readonly estimator;
|
|
13
|
+
constructor(tokenizer: CueTextTokenizer, estimator: WordTimingEstimator);
|
|
14
|
+
read(text: string, startSeconds: number, endSeconds: number): ReadonlyArray<Word>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=EstimatedCueWordReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EstimatedCueWordReader.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/EstimatedCueWordReader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEtF;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,aAAa;IAExD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS;gBADT,SAAS,EAAE,gBAAgB,EAC3B,SAAS,EAAE,mBAAmB;IAGjD,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC;CAGlF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads a cue from a format that times nothing below the cue itself.
|
|
3
|
+
* The words are known, when each is spoken is not, so the cue's own
|
|
4
|
+
* window is shared out among them.
|
|
5
|
+
*/
|
|
6
|
+
export class EstimatedCueWordReader {
|
|
7
|
+
tokenizer;
|
|
8
|
+
estimator;
|
|
9
|
+
constructor(tokenizer, estimator) {
|
|
10
|
+
this.tokenizer = tokenizer;
|
|
11
|
+
this.estimator = estimator;
|
|
12
|
+
}
|
|
13
|
+
read(text, startSeconds, endSeconds) {
|
|
14
|
+
return this.estimator.spread(this.tokenizer.tokenize(text), startSeconds, endSeconds);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=EstimatedCueWordReader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EstimatedCueWordReader.js","sourceRoot":"","sources":["../../../src/modules/transcription/EstimatedCueWordReader.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,MAAM,OAAO,sBAAsB;IAEd;IACA;IAFnB,YACmB,SAA2B,EAC3B,SAA8B;QAD9B,cAAS,GAAT,SAAS,CAAkB;QAC3B,cAAS,GAAT,SAAS,CAAqB;IAC9C,CAAC;IAEJ,IAAI,CAAC,IAAY,EAAE,YAAoB,EAAE,UAAkB;QACzD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;IACxF,CAAC;CACF"}
|