@allyhub/sdk 0.1.0-alpha.8 → 0.2.0-next.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/NOTICE +85 -0
- package/client.d.ts +45 -1
- package/dist/anim.js +2 -75
- package/dist/define.d.ts +10 -4
- package/dist/define.js +2 -95
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +2 -457
- package/dist/fit.js +2 -60
- package/dist/free.d.ts +18 -0
- package/dist/free.js +2 -0
- package/dist/index.d.ts +28 -13
- package/dist/index.js +2 -11
- package/dist/input.d.ts +306 -0
- package/dist/input.js +2 -0
- package/dist/media.d.ts +3 -6
- package/dist/media.js +2 -27
- package/dist/messages.d.ts +3 -2
- package/dist/messages.js +2 -2
- package/dist/module.d.ts +24 -0
- package/dist/module.js +2 -0
- package/dist/noise.js +2 -233
- package/dist/parts.d.ts +97 -21
- package/dist/parts.js +2 -414
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +2 -720
- package/dist/phone.d.ts +26 -0
- package/dist/phone.js +2 -0
- package/dist/piece.d.ts +106 -35
- package/dist/piece.js +2 -38
- package/dist/props.d.ts +1 -1
- package/dist/props.js +2 -35
- package/dist/scenery.d.ts +2 -0
- package/dist/scenery.js +2 -0
- package/dist/text.js +2 -38
- package/dist/written.d.ts +12 -0
- package/dist/written.js +2 -0
- package/docs/README.md +18 -0
- package/docs/batches.md +148 -0
- package/docs/contract.md +51 -0
- package/docs/defaults.md +703 -0
- package/docs/docs.md +148 -0
- package/docs/footage.md +249 -0
- package/docs/layers.md +317 -0
- package/docs/modeling.md +143 -0
- package/docs/project.md +265 -0
- package/docs/scenery.md +308 -0
- package/docs/sheets.md +119 -0
- package/docs/slides.md +111 -0
- package/docs/sound.md +170 -0
- package/docs/speech.md +289 -0
- package/docs/video.md +265 -0
- package/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +52 -0
- package/node_modules/@allyhub-next/audio/dist/at-cut.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/decode.d.ts +33 -0
- package/node_modules/@allyhub-next/audio/dist/decode.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/envelope.d.ts +37 -0
- package/node_modules/@allyhub-next/audio/dist/envelope.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/index.d.ts +17 -0
- package/node_modules/@allyhub-next/audio/dist/index.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/levels.d.ts +97 -0
- package/node_modules/@allyhub-next/audio/dist/levels.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/master.d.ts +29 -0
- package/node_modules/@allyhub-next/audio/dist/master.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/music.d.ts +11 -0
- package/node_modules/@allyhub-next/audio/dist/music.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +39 -0
- package/node_modules/@allyhub-next/audio/dist/node/decode.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +25 -0
- package/node_modules/@allyhub-next/audio/dist/node/ebur128.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +31 -0
- package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/index.d.ts +8 -0
- package/node_modules/@allyhub-next/audio/dist/node/index.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +18 -0
- package/node_modules/@allyhub-next/audio/dist/node/loudness.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/master.d.ts +42 -0
- package/node_modules/@allyhub-next/audio/dist/node/master.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +60 -0
- package/node_modules/@allyhub-next/audio/dist/node/measure.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +31 -0
- package/node_modules/@allyhub-next/audio/dist/node/mix.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/plan.d.ts +143 -0
- package/node_modules/@allyhub-next/audio/dist/plan.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recorded.d.ts +26 -0
- package/node_modules/@allyhub-next/audio/dist/recorded.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +47 -0
- package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +89 -0
- package/node_modules/@allyhub-next/audio/dist/recording/chain.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +64 -0
- package/node_modules/@allyhub-next/audio/dist/recording/dynamics.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +26 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fft.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +42 -0
- package/node_modules/@allyhub-next/audio/dist/recording/filters.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +56 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fit.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +10 -0
- package/node_modules/@allyhub-next/audio/dist/recording/index.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +12 -0
- package/node_modules/@allyhub-next/audio/dist/recording/loudness.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +67 -0
- package/node_modules/@allyhub-next/audio/dist/recording/measure.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +32 -0
- package/node_modules/@allyhub-next/audio/dist/recording/mic.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +27 -0
- package/node_modules/@allyhub-next/audio/dist/recording/noise.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +64 -0
- package/node_modules/@allyhub-next/audio/dist/recording/presets.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +78 -0
- package/node_modules/@allyhub-next/audio/dist/recording/room.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +111 -0
- package/node_modules/@allyhub-next/audio/dist/recording/setup.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +3 -0
- package/node_modules/@allyhub-next/audio/dist/recording/vec.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/render.d.ts +26 -0
- package/node_modules/@allyhub-next/audio/dist/render.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/sfx.d.ts +10 -0
- package/node_modules/@allyhub-next/audio/dist/sfx.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/shape.d.ts +118 -0
- package/node_modules/@allyhub-next/audio/dist/shape.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/voice.d.ts +45 -0
- package/node_modules/@allyhub-next/audio/dist/voice.js +2 -0
- package/node_modules/@allyhub-next/audio/package.json +17 -0
- package/node_modules/@allyhub-next/formats/dist/data/comments.d.ts +94 -0
- package/node_modules/@allyhub-next/formats/dist/data/comments.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/config.d.ts +10 -0
- package/node_modules/@allyhub-next/formats/dist/data/config.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/edits.d.ts +28 -0
- package/node_modules/@allyhub-next/formats/dist/data/edits.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/elements.d.ts +6 -0
- package/node_modules/@allyhub-next/formats/dist/data/elements.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/faces.d.ts +38 -0
- package/node_modules/@allyhub-next/formats/dist/data/faces.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/file.d.ts +11 -0
- package/node_modules/@allyhub-next/formats/dist/data/file.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/gen.d.ts +31 -0
- package/node_modules/@allyhub-next/formats/dist/data/gen.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/messages.d.ts +34 -0
- package/node_modules/@allyhub-next/formats/dist/data/messages.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/reference.d.ts +676 -0
- package/node_modules/@allyhub-next/formats/dist/data/reference.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/script.d.ts +37 -0
- package/node_modules/@allyhub-next/formats/dist/data/script.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +214 -0
- package/node_modules/@allyhub-next/formats/dist/data/sheet.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/words.d.ts +25 -0
- package/node_modules/@allyhub-next/formats/dist/data/words.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/index.d.ts +16 -0
- package/node_modules/@allyhub-next/formats/dist/index.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/items.d.ts +94 -0
- package/node_modules/@allyhub-next/formats/dist/items.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/layout.d.ts +50 -0
- package/node_modules/@allyhub-next/formats/dist/layout.js +5 -0
- package/node_modules/@allyhub-next/formats/dist/schemas.d.ts +301 -0
- package/node_modules/@allyhub-next/formats/dist/schemas.js +2 -0
- package/node_modules/@allyhub-next/formats/package.json +14 -0
- package/node_modules/@allyhub-next/formats/schemas/comments.schema.json +152 -0
- package/node_modules/@allyhub-next/formats/schemas/config.schema.json +43 -0
- package/node_modules/@allyhub-next/formats/schemas/edits.schema.json +112 -0
- package/node_modules/@allyhub-next/formats/schemas/elements.schema.json +33 -0
- package/node_modules/@allyhub-next/formats/schemas/gen.schema.json +97 -0
- package/node_modules/@allyhub-next/formats/schemas/interpretation.schema.json +125 -0
- package/node_modules/@allyhub-next/formats/schemas/items.json +75 -0
- package/node_modules/@allyhub-next/formats/schemas/messages.schema.json +11 -0
- package/node_modules/@allyhub-next/formats/schemas/script.schema.json +162 -0
- package/node_modules/@allyhub-next/formats/schemas/sheet.schema.json +395 -0
- package/node_modules/@allyhub-next/formats/schemas/words.schema.json +63 -0
- package/node_modules/@allyhub-next/protocol/dist/app.d.ts +98 -0
- package/node_modules/@allyhub-next/protocol/dist/app.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/auth.d.ts +116 -0
- package/node_modules/@allyhub-next/protocol/dist/auth.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/cli.d.ts +59 -0
- package/node_modules/@allyhub-next/protocol/dist/cli.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +272 -0
- package/node_modules/@allyhub-next/protocol/dist/cloud.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/editor.d.ts +405 -0
- package/node_modules/@allyhub-next/protocol/dist/editor.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/files.d.ts +101 -0
- package/node_modules/@allyhub-next/protocol/dist/files.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/index.d.ts +12 -0
- package/node_modules/@allyhub-next/protocol/dist/index.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/jsonrpc.d.ts +83 -0
- package/node_modules/@allyhub-next/protocol/dist/jsonrpc.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/registry.d.ts +53 -0
- package/node_modules/@allyhub-next/protocol/dist/registry.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/runtimes.d.ts +93 -0
- package/node_modules/@allyhub-next/protocol/dist/runtimes.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/teams.d.ts +67 -0
- package/node_modules/@allyhub-next/protocol/dist/teams.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/tools.d.ts +345 -0
- package/node_modules/@allyhub-next/protocol/dist/tools.js +2 -0
- package/node_modules/@allyhub-next/protocol/package.json +13 -0
- package/node_modules/@allyhub-next/runtimes/dist/bundled.d.ts +10 -0
- package/node_modules/@allyhub-next/runtimes/dist/bundled.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/download.d.ts +15 -0
- package/node_modules/@allyhub-next/runtimes/dist/download.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/errors.d.ts +16 -0
- package/node_modules/@allyhub-next/runtimes/dist/errors.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/home.d.ts +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/home.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/index.d.ts +9 -0
- package/node_modules/@allyhub-next/runtimes/dist/index.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/lock.d.ts +6 -0
- package/node_modules/@allyhub-next/runtimes/dist/lock.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/manifest.d.ts +3 -0
- package/node_modules/@allyhub-next/runtimes/dist/manifest.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/runtimes.d.ts +63 -0
- package/node_modules/@allyhub-next/runtimes/dist/runtimes.js +3 -0
- package/node_modules/@allyhub-next/runtimes/dist/unpack.d.ts +7 -0
- package/node_modules/@allyhub-next/runtimes/dist/unpack.js +2 -0
- package/node_modules/@allyhub-next/runtimes/manifest.json +395 -0
- package/node_modules/@allyhub-next/runtimes/package.json +14 -0
- package/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +153 -0
- package/node_modules/@allyhub-next/scenery/NOTICE +42 -0
- package/node_modules/@allyhub-next/scenery/dist/aim.d.ts +55 -0
- package/node_modules/@allyhub-next/scenery/dist/aim.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/bake.d.ts +203 -0
- package/node_modules/@allyhub-next/scenery/dist/bake.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/camera.d.ts +150 -0
- package/node_modules/@allyhub-next/scenery/dist/camera.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/curve.d.ts +40 -0
- package/node_modules/@allyhub-next/scenery/dist/curve.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/define.d.ts +164 -0
- package/node_modules/@allyhub-next/scenery/dist/define.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/fit.d.ts +64 -0
- package/node_modules/@allyhub-next/scenery/dist/fit.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/glass.d.ts +34 -0
- package/node_modules/@allyhub-next/scenery/dist/glass.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/handheld.d.ts +184 -0
- package/node_modules/@allyhub-next/scenery/dist/handheld.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/hull.d.ts +23 -0
- package/node_modules/@allyhub-next/scenery/dist/hull.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/index.d.ts +22 -0
- package/node_modules/@allyhub-next/scenery/dist/index.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/lens.d.ts +48 -0
- package/node_modules/@allyhub-next/scenery/dist/lens.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/moire.d.ts +136 -0
- package/node_modules/@allyhub-next/scenery/dist/moire.js +93 -0
- package/node_modules/@allyhub-next/scenery/dist/motion.d.ts +48 -0
- package/node_modules/@allyhub-next/scenery/dist/motion.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/move.d.ts +260 -0
- package/node_modules/@allyhub-next/scenery/dist/move.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/noise.d.ts +41 -0
- package/node_modules/@allyhub-next/scenery/dist/noise.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/phone.d.ts +34 -0
- package/node_modules/@allyhub-next/scenery/dist/phone.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/report.d.ts +677 -0
- package/node_modules/@allyhub-next/scenery/dist/report.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/screen-focus.d.ts +55 -0
- package/node_modules/@allyhub-next/scenery/dist/screen-focus.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/screen.d.ts +71 -0
- package/node_modules/@allyhub-next/scenery/dist/screen.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/solve.d.ts +82 -0
- package/node_modules/@allyhub-next/scenery/dist/solve.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/timing.d.ts +26 -0
- package/node_modules/@allyhub-next/scenery/dist/timing.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/vec.d.ts +19 -0
- package/node_modules/@allyhub-next/scenery/dist/vec.js +2 -0
- package/node_modules/@allyhub-next/scenery/package.json +13 -0
- package/node_modules/@allyhub-next/video-core/dist/anchors.d.ts +164 -0
- package/node_modules/@allyhub-next/video-core/dist/anchors.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/audio-types.d.ts +148 -0
- package/node_modules/@allyhub-next/video-core/dist/audio-types.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/backdrop.d.ts +87 -0
- package/node_modules/@allyhub-next/video-core/dist/backdrop.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/captions.d.ts +122 -0
- package/node_modules/@allyhub-next/video-core/dist/captions.js +11 -0
- package/node_modules/@allyhub-next/video-core/dist/console.d.ts +91 -0
- package/node_modules/@allyhub-next/video-core/dist/console.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/contrast.d.ts +98 -0
- package/node_modules/@allyhub-next/video-core/dist/contrast.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/cut-report.d.ts +77 -0
- package/node_modules/@allyhub-next/video-core/dist/cut-report.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/edit.d.ts +77 -0
- package/node_modules/@allyhub-next/video-core/dist/edit.js +13 -0
- package/node_modules/@allyhub-next/video-core/dist/edits.d.ts +163 -0
- package/node_modules/@allyhub-next/video-core/dist/edits.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/export.d.ts +96 -0
- package/node_modules/@allyhub-next/video-core/dist/export.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/fact.d.ts +965 -0
- package/node_modules/@allyhub-next/video-core/dist/fact.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/footage-motion.d.ts +168 -0
- package/node_modules/@allyhub-next/video-core/dist/footage-motion.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/formats.d.ts +240 -0
- package/node_modules/@allyhub-next/video-core/dist/formats.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/gen.d.ts +37 -0
- package/node_modules/@allyhub-next/video-core/dist/gen.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/index.d.ts +40 -0
- package/node_modules/@allyhub-next/video-core/dist/index.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/look.d.ts +66 -0
- package/node_modules/@allyhub-next/video-core/dist/look.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/marks.d.ts +34 -0
- package/node_modules/@allyhub-next/video-core/dist/marks.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/matrix.d.ts +289 -0
- package/node_modules/@allyhub-next/video-core/dist/matrix.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/measure.d.ts +465 -0
- package/node_modules/@allyhub-next/video-core/dist/measure.js +5 -0
- package/node_modules/@allyhub-next/video-core/dist/media.d.ts +226 -0
- package/node_modules/@allyhub-next/video-core/dist/media.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/messages.d.ts +88 -0
- package/node_modules/@allyhub-next/video-core/dist/messages.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/motion.d.ts +56 -0
- package/node_modules/@allyhub-next/video-core/dist/motion.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/music.d.ts +110 -0
- package/node_modules/@allyhub-next/video-core/dist/music.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/piece.d.ts +1146 -0
- package/node_modules/@allyhub-next/video-core/dist/piece.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/placement.d.ts +37 -0
- package/node_modules/@allyhub-next/video-core/dist/placement.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/problem.d.ts +262 -0
- package/node_modules/@allyhub-next/video-core/dist/problem.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/render-types.d.ts +49 -0
- package/node_modules/@allyhub-next/video-core/dist/render-types.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/schema.d.ts +352 -0
- package/node_modules/@allyhub-next/video-core/dist/schema.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/script-edit.d.ts +176 -0
- package/node_modules/@allyhub-next/video-core/dist/script-edit.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/script.d.ts +67 -0
- package/node_modules/@allyhub-next/video-core/dist/script.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/seams.d.ts +214 -0
- package/node_modules/@allyhub-next/video-core/dist/seams.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/slides.d.ts +37 -0
- package/node_modules/@allyhub-next/video-core/dist/slides.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/sound-under.d.ts +72 -0
- package/node_modules/@allyhub-next/video-core/dist/sound-under.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/speech.d.ts +83 -0
- package/node_modules/@allyhub-next/video-core/dist/speech.js +5 -0
- package/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +616 -0
- package/node_modules/@allyhub-next/video-core/dist/timeline.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/timing.d.ts +88 -0
- package/node_modules/@allyhub-next/video-core/dist/timing.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/transcript.d.ts +288 -0
- package/node_modules/@allyhub-next/video-core/dist/transcript.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/transition.d.ts +289 -0
- package/node_modules/@allyhub-next/video-core/dist/transition.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/voice.d.ts +175 -0
- package/node_modules/@allyhub-next/video-core/dist/voice.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/words.d.ts +128 -0
- package/node_modules/@allyhub-next/video-core/dist/words.js +2 -0
- package/node_modules/@allyhub-next/video-core/package.json +14 -0
- package/package.json +52 -41
- package/README.md +0 -17
- package/dist/anim.d.ts.map +0 -1
- package/dist/anim.js.map +0 -1
- package/dist/define.d.ts.map +0 -1
- package/dist/define.js.map +0 -1
- package/dist/dom.d.ts.map +0 -1
- package/dist/dom.js.map +0 -1
- package/dist/fit.d.ts.map +0 -1
- package/dist/fit.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/media.d.ts.map +0 -1
- package/dist/media.js.map +0 -1
- package/dist/messages.d.ts.map +0 -1
- package/dist/messages.js.map +0 -1
- package/dist/noise.d.ts.map +0 -1
- package/dist/noise.js.map +0 -1
- package/dist/parts.d.ts.map +0 -1
- package/dist/parts.js.map +0 -1
- package/dist/paths.d.ts.map +0 -1
- package/dist/paths.js.map +0 -1
- package/dist/piece.d.ts.map +0 -1
- package/dist/piece.js.map +0 -1
- package/dist/props.d.ts.map +0 -1
- package/dist/props.js.map +0 -1
- package/dist/text.d.ts.map +0 -1
- package/dist/text.js.map +0 -1
- /package/{LICENSE → LICENSE.md} +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** The measurement's thresholds. */
|
|
2
|
+
export interface RecordingMeasureOptions {
|
|
3
|
+
/**
|
|
4
|
+
* A frame is speech when it is this share of the way from the quiet end
|
|
5
|
+
* (the 10th percentile of frame levels, at most `range` dB under the
|
|
6
|
+
* loud end) to the loud end (the 95th percentile).
|
|
7
|
+
*/
|
|
8
|
+
split: number;
|
|
9
|
+
range: number;
|
|
10
|
+
/** Speech joined over gaps shorter than this, s. */
|
|
11
|
+
join: number;
|
|
12
|
+
/** A pause is at least this long, s. */
|
|
13
|
+
gap: number;
|
|
14
|
+
/** A fall is read from this many dB under where speech stopped… */
|
|
15
|
+
skip: number;
|
|
16
|
+
/** …down to this many dB over the pause's floor. */
|
|
17
|
+
floor: number;
|
|
18
|
+
/** Fewer ends than this measure no decay. */
|
|
19
|
+
least: number;
|
|
20
|
+
/** An end whose fall from `skip` to `floor` spans fewer dB than this is not read. */
|
|
21
|
+
fall: number;
|
|
22
|
+
}
|
|
23
|
+
export declare const RECORDING_MEASURE_DEFAULTS: RecordingMeasureOptions;
|
|
24
|
+
/** Third-octave band centres, Hz (ISO 266, 63 Hz to 16 kHz). */
|
|
25
|
+
export declare const THIRD_OCTAVES: number[];
|
|
26
|
+
/** What a voice's recording measures. */
|
|
27
|
+
export interface RecordingMeasurement {
|
|
28
|
+
/** Its integrated loudness, LUFS. */
|
|
29
|
+
loudness: number | null;
|
|
30
|
+
/** Seconds of speech and of pauses. */
|
|
31
|
+
speech: number;
|
|
32
|
+
pauses: number;
|
|
33
|
+
/** dB by third-octave band against the 1 kHz band, over its speech. */
|
|
34
|
+
spectrum: {
|
|
35
|
+
hz: number;
|
|
36
|
+
db: number;
|
|
37
|
+
}[];
|
|
38
|
+
/** The room's decay where speech stops: its median time, the spread of the middle half, how many ends. */
|
|
39
|
+
decay: {
|
|
40
|
+
t60: number;
|
|
41
|
+
low: number;
|
|
42
|
+
high: number;
|
|
43
|
+
ends: number;
|
|
44
|
+
} | {
|
|
45
|
+
missing: string;
|
|
46
|
+
};
|
|
47
|
+
/** The pauses' loudness under the speech's, LU, and the tone's tilt, dB per octave. */
|
|
48
|
+
tone: {
|
|
49
|
+
below: number;
|
|
50
|
+
tilt: number;
|
|
51
|
+
} | {
|
|
52
|
+
missing: string;
|
|
53
|
+
};
|
|
54
|
+
/** Short-term loudness spread over the speech, LU (10th to 90th percentile), and peak over RMS, dB. */
|
|
55
|
+
dynamics: {
|
|
56
|
+
spread: number;
|
|
57
|
+
crest: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** Speech and pauses as frame runs. */
|
|
61
|
+
export declare function speechRuns(levels: readonly number[], frame: number, o?: RecordingMeasureOptions): {
|
|
62
|
+
speech: [number, number][];
|
|
63
|
+
pauses: [number, number][];
|
|
64
|
+
};
|
|
65
|
+
/** A voice's recording measured (channels at `rate`). */
|
|
66
|
+
export declare function measureRecording(channels: readonly Float32Array[], rate: number, o?: RecordingMeasureOptions): RecordingMeasurement;
|
|
67
|
+
//# sourceMappingURL=measure.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{fft as J}from"./fft.js";import{integratedLoudness as H,steadyLoudness as K}from"./loudness.js";import{biquad as W,runBiquads as X}from"./filters.js";export const RECORDING_MEASURE_DEFAULTS={split:.35,range:60,join:.15,gap:.3,skip:5,floor:6,least:4,fall:10},THIRD_OCTAVES=[63,80,100,125,160,200,250,315,400,500,630,800,1e3,1250,1600,2e3,2500,3150,4e3,5e3,6300,8e3,1e4,12500,16e3];const F=(i,e)=>i[Math.min(i.length-1,Math.max(0,Math.floor(e*i.length)))]??0;function Y(i){const e=i[0]?.length??0,f=new Float32Array(e);for(const h of i)for(let s=0;s<e;s++)f[s]=(f[s]??0)+(h[s]??0)/i.length;return f}function N(i,e){const f=[];for(let h=0;h+e<=i.length;h+=e){let s=0;for(let M=h;M<h+e;M++)s+=(i[M]??0)**2;f.push(10*Math.log10(s/e+1e-20))}return f}export function speechRuns(i,e,f=RECORDING_MEASURE_DEFAULTS){const h=[...i].sort((t,n)=>t-n),s=F(h,.95),M=Math.max(F(h,.1),s-f.range),w=M+f.split*(s-M),b=i.map(t=>t>w),A=[];let a=-1;b.forEach((t,n)=>{t&&a<0&&(a=n),!t&&a>=0&&(A.push([a,n]),a=-1)}),a>=0&&A.push([a,b.length]);const p=[];for(const t of A){const n=p[p.length-1];n&&(t[0]-n[1])*e<f.join?n[1]=t[1]:p.push([t[0],t[1]])}const S=[];for(let t=1;t<p.length;t++){const n=p[t-1]?.[1]??0,y=p[t]?.[0]??0;(y-n)*e>=f.gap&&S.push([n,y])}return{speech:p,pauses:S}}function Z(i,e,f){const s=new Float64Array(4097);let M=0;const w=new Float64Array(8192),b=new Float64Array(8192),A=Float64Array.from({length:8192},(t,n)=>.5-.5*Math.cos(2*Math.PI*n/8191));for(let t=0;t+8192<=i.length;t+=8192/4)if(f(t+8192/2)){for(let n=0;n<8192;n++)w[n]=(i[t+n]??0)*(A[n]??0),b[n]=0;J(w,b);for(let n=0;n<=8192/2;n++)s[n]=(s[n]??0)+(w[n]??0)**2+(b[n]??0)**2;M++}const a=e/8192,p=THIRD_OCTAVES.filter(t=>t*2**(1/6)<e/2).map(t=>{const n=t/1.122462048309373,y=t*2**(1/6);let O=0;for(let x=Math.floor(n/a);x<=Math.ceil(y/a);x++){const T=Math.max(n,(x-.5)*a),v=Math.min(y,(x+.5)*a);v>T&&(O+=(s[x]??0)*(v-T)/a)}return{hz:t,db:10*Math.log10(O/Math.max(M,1)+1e-20)}}),S=p.find(t=>t.hz===1e3)?.db??0;return p.map(t=>({hz:t.hz,db:Math.round((t.db-S)*10)/10}))}export function measureRecording(i,e,f=RECORDING_MEASURE_DEFAULTS){const h=Y(i),s=Math.round(.02*e),M=N(h,s),{speech:w,pauses:b}=speechRuns(M,s/e,f),A=new Uint8Array(M.length);for(const[o,r]of w)for(let c=o;c<r;c++)A[c]=1;const a=o=>Math.round(o*10)/10,p=o=>Math.round(o*1e3)/1e3,S=Z(h,e,o=>A[Math.floor(o/s)]===1),t=Math.round(.005*e),n=N(h,t),y=[];for(const[o,r]of b){const c=Math.round(o*s/t),k=Math.round(r*s/t),_=F(n.slice(c,k).sort((l,d)=>l-d),.2),D=n.slice(Math.max(0,c-100),c).sort((l,d)=>l-d),C=F(D,.9);let E=c;for(let l=c;l>Math.max(0,c-100);l--)if((n[l]??-200)>=C-6){E=l;break}const g=(n[E]??-200)-f.skip,m=Math.max(_+f.floor,g-40);if(g-m<f.fall)continue;const u=[],R=Math.min(k,n.length,E+Math.round(.5*e/t));for(let l=E;l<R;l++){const d=n[l]??-200;if(d<=m)break;d<=g&&u.push([l*t/e,d])}if(u.length<4)continue;const L=u.reduce((l,d)=>l+d[0],0)/u.length,Q=u.reduce((l,d)=>l+d[1],0)/u.length,V=u.reduce((l,d)=>l+(d[0]-L)*(d[1]-Q),0),B=u.reduce((l,d)=>l+(d[0]-L)**2,0),G=B>0?V/B:0;G<0&&y.push(G)}const O=y.length<f.least?{missing:`${String(y.length)} ends of speech before a pause fell far enough to read (${String(f.least)} needed)`}:(()=>{const o=y.map(r=>-60/r).sort((r,c)=>r-c);return{t60:p(F(o,.5)),low:p(F(o,.25)),high:p(F(o,.75)),ends:o.length}})(),x=H(i,e),T=o=>{const r=Math.round(.08/(s/e));return[o[0]+r,o[1]-r]},v=b.map(T).filter(([o,r])=>r-o>5);let P={missing:"no pause long enough to hear the room in"};if(v.length>0&&x!==void 0){const o=v.reduce((j,[g,m])=>j+(m-g)*s,0),r=Math.max(o,Math.round(.5*e)),c=j=>{const g=new Float32Array(r);let m=0;for(const[u,R]of v)g.set(j.subarray(u*s,R*s),m),m+=(R-u)*s;for(let u=m;u<r;u++)g[u]=g[(u-m)%Math.max(m,1)]??0;return g},k=i.map(c),_=K(k,e),D=j=>{let g=0,m=0;for(const u of k){const R=Float32Array.from(u);X(R,[W({type:"bandpass",hz:j,q:Math.SQRT2},e)]);for(const L of R)g+=L*L;m+=R.length}return 10*Math.log10(g/Math.max(m,1)+1e-20)},C=D(250),E=D(4e3);P=_===void 0?{missing:"the pauses are silent"}:{below:a(x-_),tilt:a((E-C)/4)}}const q=[],I=Math.round(.4*e);for(let o=0;o+I<=h.length;o+=Math.round(.1*e)){if(A[Math.floor((o+I/2)/s)]!==1)continue;const r=H([h.subarray(o,o+I)],e);r!==void 0&&q.push(r)}q.sort((o,r)=>o-r);let U=0,$=0,z=0;for(const[o,r]of w)for(let c=o*s;c<r*s&&c<h.length;c++){const k=Math.abs(h[c]??0);U=Math.max(U,k),$+=k*k,z++}return{loudness:x===void 0?null:a(x),speech:a(w.reduce((o,[r,c])=>o+(c-r),0)*(s/e)),pauses:a(b.reduce((o,[r,c])=>o+(c-r),0)*(s/e)),spectrum:S,decay:O,tone:P,dynamics:{spread:q.length>0?a(F(q,.9)-F(q,.1)):0,crest:z>0?a(20*Math.log10(U/Math.sqrt($/z+1e-20))):0}}}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Vec3 } from "./vec.js";
|
|
2
|
+
/** The speed of sound, m/s, at 20 °C. */
|
|
3
|
+
export declare const SOUND_SPEED = 343;
|
|
4
|
+
/** A first-order pattern, as pyroomacoustics names them, and its pressure share p. */
|
|
5
|
+
export declare const PATTERNS: {
|
|
6
|
+
readonly omni: 1;
|
|
7
|
+
readonly subcardioid: 0.75;
|
|
8
|
+
readonly cardioid: 0.5;
|
|
9
|
+
readonly supercardioid: 0.37;
|
|
10
|
+
readonly hypercardioid: 0.25;
|
|
11
|
+
readonly figure8: 0;
|
|
12
|
+
};
|
|
13
|
+
export type Pattern = keyof typeof PATTERNS;
|
|
14
|
+
/** A pattern's gain toward a direction at angle θ off its axis (cos θ given). */
|
|
15
|
+
export declare function patternGain(pattern: Pattern, cos: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* The proximity effect on axis at `hz`: the near field's gain over the far
|
|
18
|
+
* field's, |1 + (1 - p)/(jkr)|, of a source `distance` m away.
|
|
19
|
+
*/
|
|
20
|
+
export declare function proximity(pattern: Pattern, distance: number, hz: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* The talker's loss toward an angle θ off where they face, at 180° (dB, ≤ 0),
|
|
23
|
+
* by octave band centre: little in the lows, much in the highs.
|
|
24
|
+
*/
|
|
25
|
+
export declare const TALKER_BEHIND: readonly (readonly [number, number])[];
|
|
26
|
+
/** A table of [Hz, dB] read at `hz`, linear in log frequency, held past its ends. */
|
|
27
|
+
export declare function curveDb(table: readonly (readonly [number, number])[], hz: number): number;
|
|
28
|
+
/** The talker's loss (dB) at `hz` toward a direction θ off their facing (cos θ given). */
|
|
29
|
+
export declare function talkerDb(hz: number, cos: number): number;
|
|
30
|
+
/** cos of the angle between two vectors (1 when either is zero). */
|
|
31
|
+
export declare function cosBetween(a: Vec3, b: Vec3): number;
|
|
32
|
+
//# sourceMappingURL=mic.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
export const SOUND_SPEED=343,PATTERNS={omni:1,subcardioid:.75,cardioid:.5,supercardioid:.37,hypercardioid:.25,figure8:0};export function patternGain(t,r){const n=PATTERNS[t];return n+(1-n)*r}export function proximity(t,r,n){const o=PATTERNS[t],e=2*Math.PI*Math.max(n,1)*Math.max(r,.005)/343;return Math.hypot(1,(1-o)/e)}export const TALKER_BEHIND=[[63,0],[125,-1],[250,-2],[500,-4],[1e3,-6],[2e3,-9],[4e3,-13],[8e3,-18],[16e3,-25]];export function curveDb(t,r){const n=t[0],o=t[t.length-1];if(!n||!o)return 0;if(r<=n[0])return n[1];if(r>=o[0])return o[1];for(let e=1;e<t.length;e++){const i=t[e-1],c=t[e];if(!i||!c||r>c[0])continue;const u=Math.log(r/i[0])/Math.log(c[0]/i[0]);return i[1]+(c[1]-i[1])*u}return o[1]}export function talkerDb(t,r){return curveDb(TALKER_BEHIND,t)*((1-r)/2)}export function cosBetween(t,r){const n=Math.hypot(t[0],t[1],t[2]),o=Math.hypot(r[0],r[1],r[2]);return n===0||o===0?1:(t[0]*r[0]+t[1]*r[1]+t[2]*r[2])/(n*o)}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** mulberry32: the same numbers for the same seed, everywhere. */
|
|
2
|
+
export declare function random(seed: number): () => number;
|
|
3
|
+
/** Normal noise (Box–Muller) from a seed. */
|
|
4
|
+
export declare function gaussian(seed: number): () => number;
|
|
5
|
+
/** What a room tone sounds like. */
|
|
6
|
+
export interface NoiseShape {
|
|
7
|
+
/** dB per octave over 1 kHz (pink noise is -3). */
|
|
8
|
+
tilt: number;
|
|
9
|
+
/** dB more below 120 Hz: ventilation, traffic, the building. */
|
|
10
|
+
rumble: number;
|
|
11
|
+
/** The mains' hum: its fundamental (50 or 60 Hz) and its level against the noise, dB; absent: none. */
|
|
12
|
+
hum?: {
|
|
13
|
+
hz: number;
|
|
14
|
+
db: number;
|
|
15
|
+
};
|
|
16
|
+
/** The highest frequency it has, Hz: a device's band. */
|
|
17
|
+
top: number;
|
|
18
|
+
}
|
|
19
|
+
/** The noise's gain at a frequency (linear), relative to 1 kHz. */
|
|
20
|
+
export declare function noiseGain(shape: NoiseShape, hz: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* `n` samples of room tone of unit RMS before its level is set: Gaussian
|
|
23
|
+
* noise through the shape's minimum-phase filter, the hum added as sines
|
|
24
|
+
* (its harmonics falling 6 dB each), all from the seed.
|
|
25
|
+
*/
|
|
26
|
+
export declare function roomTone(n: number, rate: number, shape: NoiseShape, seed: number): Float32Array;
|
|
27
|
+
//# sourceMappingURL=noise.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{convolve as p,minimumPhase as P}from"./fft.js";export function random(n){let r=n>>>0;return()=>{r=r+1831565813>>>0;let t=r;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}export function gaussian(n){const r=random(n);let t;return()=>{if(t!==void 0){const h=t;return t=void 0,h}const a=Math.max(r(),1e-12),c=r(),e=Math.sqrt(-2*Math.log(a));return t=e*Math.sin(2*Math.PI*c),e*Math.cos(2*Math.PI*c)}}export function noiseGain(n,r){const t=Math.max(r,10);let a=n.tilt*Math.log2(t/1e3);return a+=n.rumble/(1+(t/120)**2),t>n.top&&(a-=48*Math.log2(t/n.top)),10**(a/20)}export function roomTone(n,r,t,a){const c=gaussian(a),e=new Float32Array(n+4096);for(let o=0;o<e.length;o++)e[o]=c();const h=P(o=>noiseGain(t,o),r,2048),l=p(e,h).subarray(4096);let m=0;for(const o of l)m+=o*o;const M=Math.sqrt(m/Math.max(1,l.length)),i=new Float32Array(n);for(let o=0;o<n;o++)i[o]=(l[o]??0)/(M||1);if(t.hum){const o=10**(t.hum.db/20)*Math.SQRT2,x=random(a^2654435769);for(let u=1;u<=6;u++){const f=t.hum.hz*u;if(f>t.top)break;const d=o/2**(u-1),b=x()*2*Math.PI,g=2*Math.PI*f/r;for(let s=0;s<n;s++)i[s]=(i[s]??0)+d*Math.sin(g*s+b)}}return i}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { CompressorOptions, DeesserOptions } from "./dynamics.js";
|
|
2
|
+
import type { FilterSpec } from "./filters.js";
|
|
3
|
+
import type { Pattern } from "./mic.js";
|
|
4
|
+
import type { NoiseShape } from "./noise.js";
|
|
5
|
+
import type { PostName, RoomName, RoomOptions, VoiceSetup } from "./setup.js";
|
|
6
|
+
import type { Vec3 } from "./vec.js";
|
|
7
|
+
/** A room as a preset gives it: every value. */
|
|
8
|
+
export interface RoomPreset {
|
|
9
|
+
size: Vec3;
|
|
10
|
+
walls: string;
|
|
11
|
+
floor: string;
|
|
12
|
+
ceiling: string;
|
|
13
|
+
rt60: number;
|
|
14
|
+
talker: Vec3;
|
|
15
|
+
/** Only the ground is there (outdoors). */
|
|
16
|
+
open?: true;
|
|
17
|
+
/** Reflection order of the image sources. */
|
|
18
|
+
order: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const ROOM_PRESETS: Record<RoomName, RoomPreset>;
|
|
21
|
+
/** A finishing chain as a preset gives it. */
|
|
22
|
+
export interface PostPreset {
|
|
23
|
+
highpass: number | false;
|
|
24
|
+
eq: FilterSpec[];
|
|
25
|
+
/** Threshold: dB over the voice's loudness. */
|
|
26
|
+
deess: DeesserOptions | false;
|
|
27
|
+
/** Threshold: dB over the voice's loudness. */
|
|
28
|
+
compress: CompressorOptions | false;
|
|
29
|
+
}
|
|
30
|
+
export declare const POST_PRESETS: Record<PostName, PostPreset>;
|
|
31
|
+
/** A setup as its preset gives it. */
|
|
32
|
+
export interface SetupPreset {
|
|
33
|
+
pattern: Pattern;
|
|
34
|
+
distance: number;
|
|
35
|
+
angle: number;
|
|
36
|
+
below: number;
|
|
37
|
+
response: (readonly [number, number])[];
|
|
38
|
+
band: readonly [number, number];
|
|
39
|
+
stereo: number | false;
|
|
40
|
+
room: RoomName | RoomOptions | false;
|
|
41
|
+
/** Its loudness under the voice's (LU), and its shape. */
|
|
42
|
+
noise: (NoiseShape & {
|
|
43
|
+
below: number;
|
|
44
|
+
}) | false;
|
|
45
|
+
/** Target: dB over the voice's loudness. */
|
|
46
|
+
agc: {
|
|
47
|
+
target: number;
|
|
48
|
+
most: number;
|
|
49
|
+
attack: number;
|
|
50
|
+
release: number;
|
|
51
|
+
/** The speech's level it follows is over this many seconds. */
|
|
52
|
+
window: number;
|
|
53
|
+
/** Under this (dB under the voice's loudness) the gain holds: a pause is not lifted. */
|
|
54
|
+
gate?: number;
|
|
55
|
+
} | false;
|
|
56
|
+
post: PostName | false;
|
|
57
|
+
}
|
|
58
|
+
export declare const SETUP_PRESETS: Record<VoiceSetup, SetupPreset>;
|
|
59
|
+
/** The dry voice's own microphone: a studio's cardioid 0.2 m away. */
|
|
60
|
+
export declare const SOURCE_DEFAULTS: {
|
|
61
|
+
pattern: Pattern;
|
|
62
|
+
distance: number;
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
export const ROOM_PRESETS={bedroom:{size:[3.4,2.6,4],walls:"plasterboard",floor:"carpet",ceiling:"plasterboard-ceiling",rt60:.4,talker:[1.5,1.2,1.5],order:3},"living-room":{size:[5,2.7,6],walls:"plasterboard",floor:"wood",ceiling:"plasterboard-ceiling",rt60:.55,talker:[2.2,1.2,2.5],order:3},office:{size:[4,2.8,5],walls:"plasterboard",floor:"carpet-thin",ceiling:"ceiling-tiles",rt60:.45,talker:[1.8,1.2,2],order:3},kitchen:{size:[3,2.6,4],walls:"tiles",floor:"tiles",ceiling:"plasterboard-ceiling",rt60:.75,talker:[1.4,1.6,1.6],order:3},treated:{size:[3,2.6,3.5],walls:"foam",floor:"carpet",ceiling:"foam",rt60:.2,talker:[1.4,1.2,1.4],order:3},car:{size:[1.4,1.15,1.9],walls:"glass",floor:"upholstery",ceiling:"upholstery",rt60:.08,talker:[.45,.85,.9],order:6},outdoor:{size:[60,30,60],walls:"hard",floor:"hard",ceiling:"hard",rt60:.4,talker:[30,1.6,30],open:!0,order:1}};const e={hz:5500,threshold:-12,ratio:3,attack:.002,release:.06};export const POST_PRESETS={finish:{highpass:70,eq:[],deess:e,compress:{threshold:-3,ratio:4,knee:6,attack:.005,release:.3,window:.01}},"phone-app":{highpass:90,eq:[{type:"peak",hz:300,db:-2,q:1},{type:"peak",hz:4e3,db:3,q:.8},{type:"highshelf",hz:1e4,db:1}],deess:e,compress:{threshold:0,ratio:3,knee:6,attack:.005,release:.12,window:.01}}};const r={tilt:-4,rumble:8,top:16e3};export const SETUP_PRESETS={studio:{pattern:"cardioid",distance:.2,angle:0,below:0,response:[[125,-3.5],[250,-3],[500,-.5],[1e3,0],[2e3,-2],[4e3,-1.5],[8e3,-4],[12500,-4]],band:[20,2e4],stereo:!1,room:!1,noise:!1,agc:!1,post:"finish"},phone:{pattern:"omni",distance:.35,angle:0,below:25,response:[[125,-8.5],[250,-3.5],[500,-.5],[1e3,0],[2e3,0],[4e3,0],[8e3,-3.5],[12500,-2.5]],band:[100,16e3],stereo:.1,room:{preset:"bedroom",rt60:.2},noise:{...r,below:42},agc:{target:0,most:10,attack:.3,release:1.5,window:2,gate:-25},post:!1},lav:{pattern:"omni",distance:.22,angle:0,below:70,response:[[125,-2],[250,-3],[500,.5],[1e3,0],[2e3,-1],[4e3,-1],[8e3,-3.5],[12500,-4]],band:[70,18e3],stereo:!1,room:{preset:"bedroom",rt60:.13},noise:{tilt:-4,rumble:4,top:18e3,below:50},agc:!1,post:"finish"}},SOURCE_DEFAULTS={pattern:"cardioid",distance:.2};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type Pattern } from "./mic.js";
|
|
2
|
+
import type { Vec3 } from "./vec.js";
|
|
3
|
+
/** Octave band centres, Hz, from 125. */
|
|
4
|
+
export declare function bandCentres(rate: number): number[];
|
|
5
|
+
/**
|
|
6
|
+
* Absorption coefficients (energy) at 125 Hz to 8 kHz, from
|
|
7
|
+
* pyroomacoustics' data/materials.json; values past what a source gives
|
|
8
|
+
* hold its last.
|
|
9
|
+
*/
|
|
10
|
+
export declare const MATERIALS: Record<string, readonly number[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Air absorption (energy, per metre) at 125 Hz to 8 kHz, 20 °C and 30–50 %
|
|
13
|
+
* humidity: Vorländer's Auralization, as pyroomacoustics has it.
|
|
14
|
+
*/
|
|
15
|
+
export declare const AIR: number[];
|
|
16
|
+
/** A table at 125 Hz to 8 kHz read at the given band centres (log-linear, extrapolated past 8 kHz, kept in [0, 1]). */
|
|
17
|
+
export declare function atBands(table: readonly number[], centres: readonly number[]): number[];
|
|
18
|
+
/** A box room, its surfaces' absorption by band, the talker and the microphone. */
|
|
19
|
+
export interface RoomModel {
|
|
20
|
+
/** Width (x), height (y), depth (z), m. */
|
|
21
|
+
size: Vec3;
|
|
22
|
+
/** Absorption by band (at 125 Hz up) of the walls at x = 0 and x = W, y = 0 (the floor) and y = H, z = 0 and z = D. */
|
|
23
|
+
surfaces: readonly [
|
|
24
|
+
readonly number[],
|
|
25
|
+
readonly number[],
|
|
26
|
+
readonly number[],
|
|
27
|
+
readonly number[],
|
|
28
|
+
readonly number[],
|
|
29
|
+
readonly number[]
|
|
30
|
+
];
|
|
31
|
+
/** Surfaces that are not there (outdoors: only the ground). */
|
|
32
|
+
open?: readonly boolean[];
|
|
33
|
+
talker: Vec3;
|
|
34
|
+
/** Where the talker faces. */
|
|
35
|
+
facing: Vec3;
|
|
36
|
+
mic: Vec3;
|
|
37
|
+
/** Where the microphone points. */
|
|
38
|
+
axis: Vec3;
|
|
39
|
+
pattern: Pattern;
|
|
40
|
+
/** The dry voice's own microphone: proximity is this setup's over it. */
|
|
41
|
+
source: {
|
|
42
|
+
pattern: Pattern;
|
|
43
|
+
distance: number;
|
|
44
|
+
};
|
|
45
|
+
/** Reflection order of the image sources; past it the statistical tail. */
|
|
46
|
+
order: number;
|
|
47
|
+
}
|
|
48
|
+
/** The reverberation time of each band, s (Eyring, with the air). */
|
|
49
|
+
export declare function reverberation(room: RoomModel, rate: number): number[];
|
|
50
|
+
/**
|
|
51
|
+
* Surfaces scaled by one factor so the room's reverberation time at
|
|
52
|
+
* 500 Hz–1 kHz is `rt60` (bisection on the factor; each coefficient kept
|
|
53
|
+
* under 0.99).
|
|
54
|
+
*/
|
|
55
|
+
export declare function withReverberation(room: RoomModel, rt60: number, rate: number): RoomModel;
|
|
56
|
+
/** The impulse response's parts: the direct sound's delay and gain, and the rest. */
|
|
57
|
+
export interface RoomResponse {
|
|
58
|
+
/** Every reflection and the tail, the direct sound left out, at `lead` samples before the direct sound's arrival. */
|
|
59
|
+
reflections: Float64Array;
|
|
60
|
+
/** The direct sound: its amplitude (1/d, the pattern), and the talker's angle toward the microphone (cos). */
|
|
61
|
+
direct: {
|
|
62
|
+
gain: number;
|
|
63
|
+
cos: number;
|
|
64
|
+
distance: number;
|
|
65
|
+
};
|
|
66
|
+
/** Samples the response is ahead of the direct sound's arrival: the sinc's half. */
|
|
67
|
+
lead: number;
|
|
68
|
+
/** Each band's reverberation time, s. */
|
|
69
|
+
rt60: number[];
|
|
70
|
+
/** When the tail takes over, s after the direct sound. */
|
|
71
|
+
mixing: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The room's impulse response at `rate`, its time 0 the direct sound's
|
|
75
|
+
* arrival less `lead` samples, seeded for the tail.
|
|
76
|
+
*/
|
|
77
|
+
export declare function roomResponse(room: RoomModel, rate: number, seed: number): RoomResponse;
|
|
78
|
+
//# sourceMappingURL=room.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{fft as nt,nextPow2 as ht}from"./fft.js";import{cosBetween as Q,patternGain as ot,proximity as st,talkerDb as lt}from"./mic.js";import{random as Mt}from"./noise.js";export function bandCentres(t){const n=Math.floor(Math.log2(t/125));return Array.from({length:n},(r,s)=>125*2**s)}export const MATERIALS={hard:[.02,.02,.03,.03,.04,.05,.05],plasterboard:[.15,.1,.06,.04,.04,.05,.05],"plasterboard-ceiling":[.2,.15,.1,.08,.04,.02,.02],tiles:[.01,.01,.01,.02,.02,.02,.02],concrete:[.01,.03,.05,.02,.02,.02,.02],wood:[.18,.12,.1,.09,.08,.07,.07],carpet:[.08,.08,.3,.6,.75,.8,.8],"carpet-thin":[.02,.04,.08,.2,.35,.4,.4],glass:[.1,.05,.04,.03,.03,.03,.03],curtains:[.05,.12,.35,.45,.38,.36,.36],"ceiling-tiles":[.49,.53,.53,.75,.92,.99,.99],foam:[.12,.33,.83,.97,.98,.95,.95],upholstery:[.44,.6,.77,.89,.82,.7,.7],grass:[.11,.26,.6,.69,.92,.99,.99]},AIR=[1e-4,3e-4,6e-4,.001,.0019,.0058,.0203];export function atBands(t,n){return n.map(r=>{const s=Math.log2(r/125),p=Math.min(Math.max(Math.floor(s),0),t.length-2),i=t[p]??0,M=t[p+1]??i;return Math.min(1,Math.max(0,i+(M-i)*(s-p)))})}const _=343;function ft(t){const[n,r,s]=t;return[r*s,r*s,n*s,n*s,n*r,n*r]}export function reverberation(t,n){const r=bandCentres(n),[s,p,i]=t.size,M=s*p*i,h=ft(t.size),a=h.reduce((m,g)=>m+g,0),e=atBands(AIR,r);return r.map((m,g)=>{let F=0;t.surfaces.forEach((I,R)=>{const k=t.open?.[R]===!0;F+=(h[R]??0)*(k?1:atBands(I,r)[g]??0)});const y=Math.min(F/a,.999);return 24*Math.LN10*M/(_*(-a*Math.log(1-y)+4*(e[g]??0)*M))})}export function withReverberation(t,n,r){const s=h=>({...t,surfaces:t.surfaces.map(a=>a.map(e=>Math.min(.99,e*h)))}),p=h=>{const a=reverberation(h,r);return((a[2]??0)+(a[3]??0))/2};let i=.001,M=1e3;for(let h=0;h<60;h++){const a=Math.sqrt(i*M);p(s(a))>n?i=a:M=a}return s(Math.sqrt(i*M))}function pt(t,n,r){const s=n/2+1,p=t.map(()=>new Float64Array(s)),i=t.map((a,e)=>e===0?0:Math.round(a/Math.SQRT2/r*n)),M=t.map(a=>Math.round(a/r*n)),h=t.map((a,e)=>e===t.length-1?s:Math.round(a*Math.SQRT2/r*n));t.forEach((a,e)=>{const m=p[e];if(m)for(let g=i[e]??0;g<Math.min(h[e]??s,s);g++)m[g]=1});for(let a=1;a<t.length;a++){const e=Math.max(1,Math.round(.5*((h[a]??0)-(M[a]??0)))),m=p[a-1],g=p[a];if(!(!m||!g))for(let F=-e;F<=e;F++){const y=(i[a]??0)+F;if(y<0||y>=s)continue;const I=(F/e+1)/2;m[y]=Math.cos(Math.PI*I/2),g[y]=Math.sin(Math.PI*I/2)}}return p}function ut(t,n,r){const s=Math.floor(n),p=n-s;for(let i=0;i<81;i++){const M=s-40+i;if(M<0||M>=t.length)continue;const h=i-40-p,a=Math.abs(h)<1e-9?1:Math.sin(Math.PI*h)/(Math.PI*h),e=.5-.5*Math.cos(2*Math.PI*i/80);t[M]=(t[M]??0)+r*e*a}}export function roomResponse(t,n,r){const s=bandCentres(n),p=s.length,[i,M,h]=t.size,a=[i,M,h],e=t.talker,m=t.mic,g=t.surfaces.map((f,u)=>t.open?.[u]===!0?s.map(()=>0):atBands(f,s).map(o=>Math.sqrt(1-o))),F=atBands(AIR,s),y=reverberation(t,n),I=[m[0]-e[0],m[1]-e[1],m[2]-e[2]],R=Math.hypot(...I),k=40,E=t.order,K=[];let q=1/0;for(let f=-(E+1);f<=E+1;f++)for(let u=-(E+1);u<=E+1;u++)for(let o=-(E+1);o<=E+1;o++){const b=Math.abs(f)+Math.abs(u)+Math.abs(o);if(b===0||b>E+1)continue;const d=[f,u,o],c=(S,v)=>{const x=a[v]??1,w=e[v];return S*x+(Math.abs(S)%2===1?x-w:w)},l=[c(f,0)-m[0],c(u,1)-m[1],c(o,2)-m[2]],P=Math.hypot(...l),N=(P-R)/_;if(b===E+1){d.every((v,x)=>v===0||!(t.open?.[x*2]===!0&&t.open[x*2+1]===!0))&&(q=Math.min(q,N));continue}let C=!1;const H=s.map((S,v)=>{let x=1;return d.forEach((w,X)=>{const Y=w>0?Math.floor(w/2):Math.ceil(-w/2),Z=w>0?Math.ceil(w/2):Math.floor(-w/2),$=g[X*2]?.[v]??0,tt=g[X*2+1]?.[v]??0;(Y>0&&$===0||Z>0&&tt===0)&&(C=!0),x*=$**Y*tt**Z}),x});if(C)continue;const V=[Math.abs(f)%2===1?l[0]:-l[0],Math.abs(u)%2===1?l[1]:-l[1],Math.abs(o)%2===1?l[2]:-l[2]],W=ot(t.pattern,Q(l,t.axis)),J=Q(V,t.facing);K.push({t:N,amp:H.map((S,v)=>{const x=s[v]??1e3,w=st(t.pattern,P,x)/st(t.source.pattern,t.source.distance,x);return S*W/P*Math.exp(-.5*(F[v]??0)*P)*10**(lt(x,J)/20)*w})})}Number.isFinite(q)||(q=.08);const at=Math.max(...y),z=Math.ceil((Math.min(Math.max(at,q+.05),3)+.01)*n)+2*k,A=ht(2*z),ct=pt(s,A,n),D=new Float64Array(A),j=new Float64Array(A),B=new Float64Array(A),T=new Float64Array(A),O=Math.round(q*n),[et,rt,it]=t.size,U=et*rt*it,G=t.open?.some(Boolean)===!0,L=new Float64Array(z);if(!G){const f=Mt(r);let u=q;for(;u*n<z-k;){const c=Math.floor(u*n)+k;L[c]=(L[c]??0)+(f()<.5?-1:1);const l=Math.min(4*Math.PI*_**3*(u+R/_)**2/U,1e4);u+=Math.log(1/Math.max(f(),1e-12))/l}const o=Math.max(1,Math.round(.004*n)),b=new Float64Array(z);let d=0;for(let c=0;c<z;c++)d+=(L[c]??0)**2,c>=o&&(d-=(L[c-o]??0)**2),b[c]=d/o;for(let c=0;c<z;c++){const l=b[Math.min(z-1,c+Math.floor(o/2))]??0;l>0&&(L[c]=(L[c]??0)/Math.sqrt(l))}}for(let f=0;f<p;f++){B.fill(0),T.fill(0);for(const o of K)!G&&o.t>q+.002||ut(B,o.t*n+k,o.amp[f]??0);if(!G){const o=y[f]??.4,b=Math.round(.01*n);for(let d=O+k-Math.round(.002*n);d<z;d++){const c=(d-k)/n,l=Math.sqrt(4*Math.PI*_/U/n*Math.exp(-6*Math.LN10*(c+R/_)/o)),P=d-(O+k-Math.round(.002*n)),N=P<b?.5-.5*Math.cos(Math.PI*P/b):1;T[d]=(L[d]??0)*l*N}}nt(B,T);const u=ct[f];if(u)for(let o=0;o<A;o++){const b=o<=A/2?o:A-o,d=(u[b]??0)**2,c=(A-o)%A,l=B[o]??0,P=T[o]??0,N=B[c]??0,C=T[c]??0,H=(l+N)/2,V=(P-C)/2,W=(P+C)/2,J=(N-l)/2;D[o]=(D[o]??0)+d*(H+W),j[o]=(j[o]??0)+d*(V+J)}}return nt(D,j,!0),{reflections:D.slice(0,z),direct:{gain:ot(t.pattern,Q([-I[0],-I[1],-I[2]],t.axis))/R,cos:Q(I,t.facing),distance:R},lead:k,rt60:y,mixing:q}}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { CompressorOptions, DeesserOptions } from "./dynamics.js";
|
|
2
|
+
import type { FilterSpec } from "./filters.js";
|
|
3
|
+
import type { Pattern } from "./mic.js";
|
|
4
|
+
import type { NoiseShape } from "./noise.js";
|
|
5
|
+
import type { Vec3 } from "./vec.js";
|
|
6
|
+
/** The setups a voice can be recorded with, by name. */
|
|
7
|
+
export declare const VOICE_SETUPS: readonly ["studio", "phone", "lav"];
|
|
8
|
+
export type VoiceSetup = (typeof VOICE_SETUPS)[number];
|
|
9
|
+
/** The rooms, by name. */
|
|
10
|
+
export declare const ROOMS: readonly ["bedroom", "living-room", "office", "kitchen", "treated", "car", "outdoor"];
|
|
11
|
+
export type RoomName = (typeof ROOMS)[number];
|
|
12
|
+
/** The finishing chains, by name. */
|
|
13
|
+
export declare const POSTS: readonly ["finish", "phone-app"];
|
|
14
|
+
export type PostName = (typeof POSTS)[number];
|
|
15
|
+
/** A surface's absorption by octave band (125 Hz to 8 kHz), or a material's name. */
|
|
16
|
+
export type Surface = string | readonly number[];
|
|
17
|
+
/** A room: a box, its surfaces, and where the talker stands in it. */
|
|
18
|
+
export interface RoomOptions {
|
|
19
|
+
/** A named room whose values fill what is not given. */
|
|
20
|
+
preset?: RoomName;
|
|
21
|
+
/** Width, height and depth, m. */
|
|
22
|
+
size?: Vec3;
|
|
23
|
+
/** The walls', the floor's and the ceiling's absorption. */
|
|
24
|
+
walls?: Surface;
|
|
25
|
+
floor?: Surface;
|
|
26
|
+
ceiling?: Surface;
|
|
27
|
+
/**
|
|
28
|
+
* The reverberation time at 500 Hz–1 kHz, s: the surfaces' absorption
|
|
29
|
+
* is scaled until the room has it (Eyring), keeping their shape over
|
|
30
|
+
* the bands.
|
|
31
|
+
*/
|
|
32
|
+
rt60?: number;
|
|
33
|
+
/** The talker's mouth in the room, m from its corner (x across, y up, z along); they face +z. */
|
|
34
|
+
talker?: Vec3;
|
|
35
|
+
}
|
|
36
|
+
/** The room's own sound under the voice. */
|
|
37
|
+
export interface NoiseOptions extends Partial<NoiseShape> {
|
|
38
|
+
/** Its loudness under the voice's, LU. */
|
|
39
|
+
below?: number;
|
|
40
|
+
}
|
|
41
|
+
/** The finishing after the recording. */
|
|
42
|
+
export interface PostOptions {
|
|
43
|
+
/** A named chain whose values fill what is not given. */
|
|
44
|
+
preset?: PostName;
|
|
45
|
+
/** A high-pass, Hz; false: none. */
|
|
46
|
+
highpass?: number | false;
|
|
47
|
+
/** Equalizer bands, after the high-pass. */
|
|
48
|
+
eq?: readonly FilterSpec[];
|
|
49
|
+
/** A de-esser; its threshold is dB over the voice's loudness. */
|
|
50
|
+
deess?: Partial<DeesserOptions> | false;
|
|
51
|
+
/** A compressor; its threshold is dB over the voice's loudness. */
|
|
52
|
+
compress?: Partial<CompressorOptions> | false;
|
|
53
|
+
}
|
|
54
|
+
/** A phone's automatic gain: its target is dB over the voice's loudness. */
|
|
55
|
+
export interface AgcSettings {
|
|
56
|
+
target?: number;
|
|
57
|
+
most?: number;
|
|
58
|
+
attack?: number;
|
|
59
|
+
release?: number;
|
|
60
|
+
/** The speech's level it follows is over this many seconds. */
|
|
61
|
+
window?: number;
|
|
62
|
+
/** Under this (dB under the voice's loudness) the gain holds: a pause is not lifted. */
|
|
63
|
+
gate?: number;
|
|
64
|
+
}
|
|
65
|
+
/** `voice`: a setup's name, or one with changes; false: the voice as it is. */
|
|
66
|
+
export interface VoiceOptions {
|
|
67
|
+
/** The setup whose values fill what is not given; default studio. */
|
|
68
|
+
setup?: VoiceSetup;
|
|
69
|
+
/**
|
|
70
|
+
* What recorded the dry voice already: its microphone's pattern and its
|
|
71
|
+
* distance (a TTS voice: a studio's cardioid 0.2 m away). Proximity is
|
|
72
|
+
* what this setup adds over that one's.
|
|
73
|
+
*/
|
|
74
|
+
source?: {
|
|
75
|
+
pattern?: Pattern;
|
|
76
|
+
distance?: number;
|
|
77
|
+
};
|
|
78
|
+
/** The microphone's pattern. */
|
|
79
|
+
pattern?: Pattern;
|
|
80
|
+
/** Mouth to microphone, m. */
|
|
81
|
+
distance?: number;
|
|
82
|
+
/** How far the microphone is round from where the talker faces, degrees. */
|
|
83
|
+
angle?: number;
|
|
84
|
+
/** How far below the mouth it is, degrees. */
|
|
85
|
+
below?: number;
|
|
86
|
+
/** The microphone's own response: [Hz, dB] points, linear in log frequency. */
|
|
87
|
+
response?: readonly (readonly [number, number])[];
|
|
88
|
+
/** The band it records, Hz: under the first and over the second it falls away. */
|
|
89
|
+
band?: readonly [number, number];
|
|
90
|
+
/** Two microphones this far apart, m (a phone's), each its own room; false: one. */
|
|
91
|
+
stereo?: number | false;
|
|
92
|
+
/** The room; false: none (as a studio's dry voice). */
|
|
93
|
+
room?: RoomName | RoomOptions | false;
|
|
94
|
+
/** The room's own sound; false: none. */
|
|
95
|
+
noise?: NoiseOptions | false;
|
|
96
|
+
/** The device's automatic gain; false: none. */
|
|
97
|
+
agc?: AgcSettings | false;
|
|
98
|
+
/** The finishing; false: none. */
|
|
99
|
+
post?: PostName | PostOptions | false;
|
|
100
|
+
/**
|
|
101
|
+
* More microphones that heard the same voice, mixed in at `gain` dB (a
|
|
102
|
+
* phone left recording beside a desk microphone). The finishing is the
|
|
103
|
+
* first's, on the sum.
|
|
104
|
+
*/
|
|
105
|
+
also?: readonly (Omit<VoiceOptions, "also" | "post"> & {
|
|
106
|
+
gain?: number;
|
|
107
|
+
})[];
|
|
108
|
+
}
|
|
109
|
+
/** What a piece or a part says: a setup, its changes, or false. */
|
|
110
|
+
export type VoiceSetting = VoiceSetup | VoiceOptions | false;
|
|
111
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type SoundOf } from "./decode.js";
|
|
2
|
+
import type { MixPlan, SfxPlay, Stereo } from "./plan.js";
|
|
3
|
+
/**
|
|
4
|
+
* A sound effect's samples as it plays: its file's (or the built-in
|
|
5
|
+
* sound's), shaped and levelled. A shaped file sits at the mix's sfx
|
|
6
|
+
* level by its loudness as shaped; a shaped built-in sound keeps the
|
|
7
|
+
* level it had.
|
|
8
|
+
*/
|
|
9
|
+
export declare function playSfx(x: SfxPlay, src: Stereo, rate: number): {
|
|
10
|
+
src: Stereo;
|
|
11
|
+
gainDb: number;
|
|
12
|
+
};
|
|
13
|
+
export interface RenderOptions {
|
|
14
|
+
/** The speech alone, as recorded, for measuring it. */
|
|
15
|
+
only?: "voice";
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Renders a plan to a stereo mix at `rate`, before mastering: each
|
|
19
|
+
* recording group's speech summed and recorded through its setting, then
|
|
20
|
+
* turned by the parts' speech gains; speech played as it is and footage
|
|
21
|
+
* sound, each a stretch of its file at its place with 10 ms fades at each
|
|
22
|
+
* cut; the music as the film plays it; the sound effects. A file `sound`
|
|
23
|
+
* does not have is left out.
|
|
24
|
+
*/
|
|
25
|
+
export declare function renderMix(plan: MixPlan, sound: SoundOf, rate: number, o?: RenderOptions): Stereo;
|
|
26
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{clipSource as x}from"./decode.js";import{equalPower as z,gainAt as A}from"./envelope.js";import{playMusic as B}from"./music.js";import{shapes as C,shapeSound as H,soundLevel as q}from"./shape.js";import{synthSfx as J}from"./sfx.js";import{playVoice as K,voiceGroups as N}from"./voice.js";function Q(o,r,n){if(r.length===0)return;const s=o[0].length;for(let i=0;i<s;i++){const t=10**(A(r,i/n)/20);t!==1&&(o[0][i]=(o[0][i]??0)*t,o[1][i]=(o[1][i]??0)*t)}}function E(o,r,n,s,i,t){const m=Math.round(n.dur*s),y=Math.round(n.at*s),v=10**(n.gainDb/20),p=Math.min(Math.round(.01*s),Math.floor(m/4)),e=l=>l===void 0||l<=0?0:Math.min(Math.round(l*s),Math.floor(m/2)),f=e(n.fadeIn),a=e(n.fadeOut),c=(l,g)=>g>0?z(l/g):p>0&&l<p?l/p:1,u=[...n.envelope??[]],b=o[0].length,h=r[0].length,d=i===void 0?n.speed??1:1,S=i===void 0?n.from*s:n.from/i*s;for(let l=0;l<m;l++){const g=y+l;if(g<0||g>=b)continue;const F=d===1?Math.round(S)+l:S+l*d,M=Math.floor(F);if(M<0||M>=h)continue;const I=F-M,O=Math.min(M+1,h-1),w=g/s,V=u.length>0||t.length>0?10**((A(u,w)+A(t,w))/20):1,j=v*V*c(l,f)*c(m-1-l,a);for(let D=0;D<2;D++){const G=r[D]??r[0],L=G[M]??0,k=G[O]??0,P=o[D]??o[0];P[g]=(P[g]??0)+(L+(k-L)*I)*j}}}export function playSfx(o,r,n){if(!o.shape||!(C(o.shape)||o.shape.filter!==void 0))return{src:r,gainDb:o.gainDb};const s=q(r,n)?.lufs,i=[Float32Array.from(r[0]),Float32Array.from(r[1])];H(i,o.shape,n,0);const t=q(i,n)?.lufs;return t===void 0?{src:i,gainDb:o.gainDb}:o.level?{src:i,gainDb:o.level.target-t+o.level.gainDb}:{src:i,gainDb:o.gainDb+(s===void 0?0:s-t)}}function R(o,r,n){const s=J(o,r,n);return[s,s]}export function renderMix(o,r,n,s={}){const i=Math.round(o.duration*n),t=[new Float32Array(i),new Float32Array(i)],m=o.speechGain??[],y=x(r),{groups:v,dry:p}=N(o);for(const e of v){const[f,a]=K(e,o.duration,n,y);Q([f,a],m,n);for(let c=0;c<i;c++)t[0][c]=(t[0][c]??0)+(f[c]??0),t[1][c]=(t[1][c]??0)+(a[c]??0)}for(const e of p){const f=y(e);f&&E(t,f.src,e,n,f.stretched,m)}if(s.only==="voice")return t;for(const e of o.footage){const f=r(e.file,{});f&&E(t,f.src,e,n,void 0,[])}if(o.music){const e=o.music,f=r(e.file,e.shape?.filter?{filter:e.shape.filter}:{});if(f){const[a,c]=B(e,f.src,o.duration,n);for(let u=0;u<i;u++)t[0][u]=(t[0][u]??0)+(a[u]??0),t[1][u]=(t[1][u]??0)+(c[u]??0)}}for(const e of o.sfx){let f;if(e.file!==void 0?f=r(e.file,e.shape?.filter?{filter:e.shape.filter}:{})?.src:f=R(e.sound,n,e.seed),!f)continue;const a=playSfx(e,f,n),c=10**(a.gainDb/20),u=Math.round(e.at*n),b=a.src[0].length;for(let h=0;h<b;h++){const d=u+h;d<0||d>=i||(t[0][d]=(t[0][d]??0)+(a.src[0][h]??0)*c,t[1][d]=(t[1][d]??0)+(a.src[1][h]??0)*c)}}return t}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Where the transient of each built-in sound is, so it lands on the cue. */
|
|
2
|
+
export declare const SFX_HIT: Record<string, number>;
|
|
3
|
+
/** FNV-1a: a stable 32-bit seed from text. */
|
|
4
|
+
export declare function hashSeed(text: string): number;
|
|
5
|
+
/**
|
|
6
|
+
* A built-in sound as mono samples at `rate`, peak about −14 dBFS (so the
|
|
7
|
+
* sum stays under the voice). Deterministic for a seed.
|
|
8
|
+
*/
|
|
9
|
+
export declare function synthSfx(sound: string, rate: number, seed: number): Float32Array<ArrayBuffer>;
|
|
10
|
+
//# sourceMappingURL=sfx.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
export const SFX_HIT={whoosh:.18,tick:.004,pop:.01};export function hashSeed(o){let n=2166136261;for(let t=0;t<o.length;t++)n^=o.charCodeAt(t),n=Math.imul(n,16777619)>>>0;return n}function v(o){let n=o>>>0;return()=>{n=n+1831565813>>>0;let t=n;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}export function synthSfx(o,n,t){const r=v(t),p=()=>r()*2-1,u=.2;if(o==="tick"){const e=Math.round(n*.06),h=new Float32Array(e);for(let s=0;s<e;s++){const c=s/n,a=Math.exp(-c*90);h[s]=(Math.sin(2*Math.PI*3200*c)*.8+p()*.2)*a}return f(h,u*.7)}if(o==="pop"){const e=Math.round(n*.12),h=new Float32Array(e);let s=0;for(let c=0;c<e;c++){const a=c/n,M=300+600*Math.exp(-a*40);s+=2*Math.PI*M/n;const g=Math.min(1,a/.002)*Math.exp(-a*35);h[c]=Math.sin(s)*g}return f(h,u)}const d=.55,x=Math.round(n*d),m=new Float32Array(x),i=SFX_HIT.whoosh??.18;let w=0,l=0;for(let e=0;e<x;e++){const h=e/n,s=400+2600*Math.exp(-(((h-i)/.12)**2)),c=2*Math.sin(Math.PI*s/n),a=p()-w-.7*l;l+=c*a,w+=c*l;const M=h<i?(h/i)**2:Math.exp(-((h-i)/(d-i))*4);m[e]=l*M}return f(m,u)}function f(o,n){let t=0;for(const r of o)t=Math.max(t,Math.abs(r));if(t>0)for(let r=0;r<o.length;r++)o[r]=(o[r]??0)/t*n;return o}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { type FilterSpec } from "./recording/filters.js";
|
|
2
|
+
/** The kinds of band an equalizer has, as the cookbook names them. */
|
|
3
|
+
export declare const BAND_TYPES: readonly ["highpass", "lowpass", "bandpass", "peak", "lowshelf", "highshelf"];
|
|
4
|
+
export type BandType = (typeof BAND_TYPES)[number];
|
|
5
|
+
/**
|
|
6
|
+
* A band's values from a moment of the film on: `at` is the moment (the
|
|
7
|
+
* music's own reference: film seconds, an anchor, a part or a word in a
|
|
8
|
+
* part), and what it leaves out is the band's own value.
|
|
9
|
+
*/
|
|
10
|
+
export interface BandKey<T = SoundMoment> {
|
|
11
|
+
at: T;
|
|
12
|
+
hz?: number;
|
|
13
|
+
db?: number;
|
|
14
|
+
q?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* One band of an equalizer: a pass (`highpass`, `lowpass`, `bandpass`,
|
|
18
|
+
* with its `q`, default a Butterworth's 0.707), a `peak` (`db` at `hz`,
|
|
19
|
+
* `q` default 1) or a shelf (`lowshelf`, `highshelf`: `db` under or over
|
|
20
|
+
* `hz`, `q` the shelf's slope, default 1). `keys` move its values over
|
|
21
|
+
* the film's clock (music only).
|
|
22
|
+
*/
|
|
23
|
+
export interface EqBand<T = SoundMoment> {
|
|
24
|
+
type: BandType;
|
|
25
|
+
hz: number;
|
|
26
|
+
db?: number;
|
|
27
|
+
q?: number;
|
|
28
|
+
keys?: BandKey<T>[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A compressor: from `threshold` dB over the stem's loudness (its
|
|
32
|
+
* integrated loudness as shaped so far: 0 is at it, -6 six dB under), the
|
|
33
|
+
* level over it is divided by `ratio`.
|
|
34
|
+
*/
|
|
35
|
+
export interface SoundCompressor {
|
|
36
|
+
threshold: number;
|
|
37
|
+
/** Input dB over the threshold per output dB; default 2. */
|
|
38
|
+
ratio?: number;
|
|
39
|
+
/** The knee's width, dB; default 6. */
|
|
40
|
+
knee?: number;
|
|
41
|
+
/** Seconds to go down, and to come back up; defaults 0.01 and 0.15. */
|
|
42
|
+
attack?: number;
|
|
43
|
+
release?: number;
|
|
44
|
+
/** The detector's window, seconds (0: the peak); default 0.01. */
|
|
45
|
+
window?: number;
|
|
46
|
+
}
|
|
47
|
+
/** A compressor's defaults: a gentle glue on a whole stem. */
|
|
48
|
+
export declare const COMPRESS_DEFAULTS: {
|
|
49
|
+
readonly ratio: 2;
|
|
50
|
+
readonly knee: 6;
|
|
51
|
+
readonly attack: 0.01;
|
|
52
|
+
readonly release: 0.15;
|
|
53
|
+
readonly window: 0.01;
|
|
54
|
+
};
|
|
55
|
+
/** How a stem is shaped (`music: { filter, eq, compress }`, a sound's own). */
|
|
56
|
+
export interface SoundShape<T = SoundMoment> {
|
|
57
|
+
/**
|
|
58
|
+
* An ffmpeg audio filter chain run on the file as it is decoded, on the
|
|
59
|
+
* file's own clock ("acompressor=ratio=3,deesser"): one chain, nothing
|
|
60
|
+
* that reads files, makes sound of its own or changes the timing.
|
|
61
|
+
*/
|
|
62
|
+
filter?: string;
|
|
63
|
+
/** Equalizer bands, in order. */
|
|
64
|
+
eq?: EqBand<T>[];
|
|
65
|
+
/** A compressor after the bands. */
|
|
66
|
+
compress?: SoundCompressor;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A moment of the film a video-level option names: film seconds, an
|
|
70
|
+
* anchor of any part ("@drop", "@drop+0.2", "@/drop") or a part's key
|
|
71
|
+
* (its start), or a word reference in a part (`{ part, at }`: `at` as a
|
|
72
|
+
* layer's at, from that part's start).
|
|
73
|
+
*/
|
|
74
|
+
export type SoundMoment = number | string | {
|
|
75
|
+
part: string;
|
|
76
|
+
at: number | string;
|
|
77
|
+
};
|
|
78
|
+
/** A shape whose bands do not move (a sound effect's). */
|
|
79
|
+
export type FixedShape = Omit<SoundShape, "eq"> & {
|
|
80
|
+
eq?: Omit<EqBand, "keys">[];
|
|
81
|
+
};
|
|
82
|
+
/** A shape resolved for the mix: its keys at film seconds. */
|
|
83
|
+
export type ResolvedShape = SoundShape<number>;
|
|
84
|
+
/**
|
|
85
|
+
* Why a sound's filter chain cannot be used, or undefined when it can: one
|
|
86
|
+
* linear chain of audio filters, none that reads or names files, listens,
|
|
87
|
+
* loads plugins, makes sound of its own (a random source would differ from
|
|
88
|
+
* render to render) or changes the timing (the music's beat and the
|
|
89
|
+
* film's clock would part).
|
|
90
|
+
*/
|
|
91
|
+
export declare function soundFilterProblem(chain: string): string | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* What is wrong with a shape, or nothing. `keyed`: its bands may move
|
|
94
|
+
* over time (the music's; a sound effect's are fixed).
|
|
95
|
+
*/
|
|
96
|
+
export declare function shapeProblem(shape: unknown, keyed?: boolean): string | undefined;
|
|
97
|
+
/** A band's values at film time t: its own, moved by its keys (frequency on a log scale). */
|
|
98
|
+
export declare function bandAt(band: EqBand<number>, t: number): FilterSpec;
|
|
99
|
+
/**
|
|
100
|
+
* Shapes a sound's channels in place with its bands and compressor (its
|
|
101
|
+
* `filter` was run when it was decoded). `start` is the film second of
|
|
102
|
+
* the first sample, for bands that move. Deterministic: the same samples
|
|
103
|
+
* every time, here and in the player.
|
|
104
|
+
*/
|
|
105
|
+
export declare function shapeSound(channels: readonly Float32Array[], shape: ResolvedShape | undefined, rate: number, start?: number): void;
|
|
106
|
+
/**
|
|
107
|
+
* How loud a sound is, LUFS, and how it was measured: its integrated
|
|
108
|
+
* loudness (BS.1770, gated), or, where that cannot be measured (shorter
|
|
109
|
+
* than one 0.4 s block, or all under the gate), its K-weighted level over
|
|
110
|
+
* its whole length ("level"). Undefined for digital silence.
|
|
111
|
+
*/
|
|
112
|
+
export declare function soundLevel(channels: readonly Float32Array[], rate: number): {
|
|
113
|
+
lufs: number;
|
|
114
|
+
by: "integrated" | "level";
|
|
115
|
+
} | undefined;
|
|
116
|
+
/** Whether a shape does anything in JavaScript (bands or a compressor). */
|
|
117
|
+
export declare const shapes: (s: SoundShape<unknown> | undefined) => boolean;
|
|
118
|
+
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{compress as z}from"./recording/dynamics.js";import{biquad as k,runBiquads as $}from"./recording/filters.js";import{integratedLoudness as v,steadyLoudness as S}from"./recording/loudness.js";export const BAND_TYPES=["highpass","lowpass","bandpass","peak","lowshelf","highshelf"],COMPRESS_DEFAULTS={ratio:2,knee:6,attack:.01,release:.15,window:.01};const j={movie:"reads files",amovie:"reads files",sendcmd:"reads files",asendcmd:"reads files",zmq:"listens on the network",azmq:"listens on the network",ladspa:"loads plugins",lv2:"loads plugins",lrc:"reads files",arnndn:"reads files (its model)",sofalizer:"reads files",afir:"takes a second input",amix:"takes several inputs",amerge:"takes several inputs",join:"takes several inputs",asplit:"makes several outputs",anoisesrc:"makes sound of its own",aevalsrc:"makes sound of its own",sine:"makes sound of its own",atempo:"changes the timing (a take's speed is take().speed())",asetrate:"changes the timing",asetpts:"changes the timing",atrim:"changes the timing (play stretches with music.play)",areverse:"changes the timing",aloop:"changes the timing (loop with music.loop)",apad:"changes the timing",adelay:"changes the timing",apulsator:"changes the timing",silenceremove:"changes the timing",loudnorm:"rides the level over time with a window of its own (level the stem with mix, compress with compress)"};export function soundFilterProblem(e){if(typeof e!="string"||e.trim()==="")return'A filter is an ffmpeg audio filter chain, such as "highpass=f=80,acompressor=ratio=3"';const i=e.replace(/'[^']*'/g,"''").replace(/\\./g,"");if(/[;[\]]/.test(i))return"A sound's filter is one chain of filters separated by commas: no ; and no [labels]";for(const t of i.split(",")){const o=/^\s*([A-Za-z0-9_]+)/.exec(t)?.[1];if(!o)return`"${t.trim()}" is not a filter`;const n=j[o.toLowerCase()];if(n)return`The filter ${o} cannot be used on a sound: it ${n}`}if(/(?:^|[:=@])\s*\w*file(?:name)?\s*=/i.test(i))return"A sound's filter cannot name files (…file= options)"}const A=e=>typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()!==""||typeof e=="object"&&e!==null&&typeof e.part=="string"&&(typeof e.at=="number"||typeof e.at=="string"),p=(e,i,t)=>typeof e=="number"&&Number.isFinite(e)&&e>=i&&e<=t;function x(e,i){if(typeof e!="object"||e===null)return"a band is { type, hz, db?, q? }";const t=e,o=Object.keys(t).filter(r=>!["type","hz","db","q","keys"].includes(r));if(o.length>0)return`a band has no ${o.join(", ")}`;if(!BAND_TYPES.includes(t.type))return`a band's type is one of ${BAND_TYPES.join(", ")}, not ${JSON.stringify(t.type)}`;const n=(r,l)=>{if(r.hz!==void 0&&!p(r.hz,10,24e3))return`${l}hz is a frequency from 10 to 24000 Hz, not ${JSON.stringify(r.hz)}`;if(r.db!==void 0&&!p(r.db,-60,24))return`${l}db is dB from -60 to 24, not ${JSON.stringify(r.db)}`;if(r.q!==void 0&&!p(r.q,.05,40))return`${l}q is from 0.05 to 40, not ${JSON.stringify(r.q)}`};if(t.hz===void 0)return"a band has a frequency, hz";const a=n(t,"");if(a)return a;const s=t.type;if((s==="peak"||s==="lowshelf"||s==="highshelf")&&t.db===void 0)return`a ${s} band has its gain, db`;const f=t.keys;if(f!==void 0){if(!i)return"only the music's bands move over time (keys)";if(!Array.isArray(f)||f.length===0)return"keys is a list of { at, hz?, db?, q? }";for(const[r,l]of f.entries()){if(typeof l!="object"||l===null)return`keys[${String(r)}] is { at, hz?, db?, q? }`;const c=l,h=Object.keys(c).filter(u=>!["at","hz","db","q"].includes(u));if(h.length>0)return`keys[${String(r)}] has no ${h.join(", ")}`;if(!A(c.at))return`keys[${String(r)}].at is a moment: film seconds, an anchor ("@drop"), a part's key, or { part, at }`;const d=n(c,`keys[${String(r)}].`);if(d)return d}}}export function shapeProblem(e,i=!1){if(typeof e!="object"||e===null||Array.isArray(e))return"a shape is { filter?, eq?, compress? }";const t=e;if(t.filter!==void 0){const n=soundFilterProblem(t.filter);if(n)return n}if(t.eq!==void 0){if(!Array.isArray(t.eq))return"eq is a list of bands, { type, hz, db?, q? }";for(const[n,a]of t.eq.entries()){const s=x(a,i);if(s)return`eq[${String(n)}]: ${s}`}}const o=t.compress;if(o!==void 0){if(typeof o!="object"||o===null)return"compress is { threshold, ratio?, knee?, attack?, release?, window? }";const n=o,a=Object.keys(n).filter(s=>!["threshold","ratio","knee","attack","release","window"].includes(s));if(a.length>0)return`compress has no ${a.join(", ")}`;if(!p(n.threshold,-60,24))return"compress.threshold is dB over the stem's loudness, from -60 to 24";if(n.ratio!==void 0&&!p(n.ratio,1,100))return"compress.ratio is from 1 to 100";if(n.knee!==void 0&&!p(n.knee,0,40))return"compress.knee is dB from 0 to 40";for(const s of["attack","release","window"])if(n[s]!==void 0&&!p(n[s],0,10))return`compress.${s} is seconds from 0 to 10`}}export function bandAt(e,i){const t=e.keys??[];let o=e.hz,n=e.db??0,a=e.q;if(t.length>0){const s=[...t].sort((d,u)=>d.at-u.at),f=(d,u)=>d[u]??(u==="hz"?e.hz:u==="db"?e.db??0:e.q),r=s[0],l=s.at(-1);let c=r,h=r;if(r&&i<=r.at)c=r,h=r;else if(l&&i>=l.at)c=l,h=l;else for(let d=1;d<s.length;d++){const u=s[d];if(u&&i<u.at){c=s[d-1],h=u;break}}if(c&&h){const d=h.at===c.at?1:(i-c.at)/(h.at-c.at),u=f(c,"hz")??e.hz,y=f(h,"hz")??e.hz;o=u===y||d<=0?u:d>=1?y:Math.exp(Math.log(u)+(Math.log(y)-Math.log(u))*d);const b=f(c,"db")??0,q=f(h,"db")??0;n=b+(q-b)*d;const m=f(c,"q"),g=f(h,"q");a=m===void 0||g===void 0?m??g:m+(g-m)*d}}switch(e.type){case"peak":return{type:"peak",hz:o,db:n,...a===void 0?{}:{q:a}};case"lowshelf":case"highshelf":return{type:e.type,hz:o,db:n,...a===void 0?{}:{slope:a}};default:return{type:e.type,hz:o,...a===void 0?{}:{q:a}}}}const w=32;function O(e,i,t,o){if(!i.keys||i.keys.length===0){$(e,[k(bandAt(i,0),t)]);return}let n=0,a=0,s=k(bandAt(i,o),t);for(let f=0;f<e.length;f++){f%w===0&&(s=k(bandAt(i,o+(f+w/2)/t),t));const r=e[f]??0,l=s.b0*r+n;n=s.b1*r-s.a1*l+a,a=s.b2*r-s.a2*l,e[f]=l}}export function shapeSound(e,i,t,o=0){if(!i)return;for(const a of i.eq??[])for(const s of e)O(s,a,t,o);const n=i.compress;if(n){const a=soundLevel(e,t)?.lufs;if(a===void 0)return;const s={threshold:a+n.threshold,ratio:n.ratio??COMPRESS_DEFAULTS.ratio,knee:n.knee??COMPRESS_DEFAULTS.knee,attack:n.attack??COMPRESS_DEFAULTS.attack,release:n.release??COMPRESS_DEFAULTS.release,window:n.window??COMPRESS_DEFAULTS.window};z(e,s,t)}}export function soundLevel(e,i){const t=v(e,i);if(t!==void 0&&t>-70)return{lufs:t,by:"integrated"};const o=S(e,i);return o===void 0?void 0:{lufs:o,by:"level"}}export const shapes=e=>(e?.eq?.length??0)>0||e?.compress!==void 0;
|