Skip to content

tests: regression for scene-wrapped source audio (#1493)#1724

Open
summeroff wants to merge 1 commit into
stagingfrom
fix/scene-audio-null-canvas-test
Open

tests: regression for scene-wrapped source audio (#1493)#1724
summeroff wants to merge 1 commit into
stagingfrom
fix/scene-audio-null-canvas-test

Conversation

@summeroff
Copy link
Copy Markdown
Contributor

What

Adds an integration test reproducing #1493: an ffmpeg_source wrapped in a scene (with sceneItem.video deliberately left unset, so the scene item's canvas stays NULL) and set as the output source must still record non-silent audio.

Before the libobs fix this case recorded silence; with it, the source's audio is mixed through the scene as expected.

Why it caught the bug

The existing dual-output tests pass only because they assign sceneItem.video (which calls obs_sceneitem_set_canvas). The plain scene.add() path — and the reporter's repro — never set it, leaving the item canvas NULL. This test exercises exactly that path.

How it asserts

New tests/osn-tests/util/media_probe.ts reads mean_volume via ffmpeg's volumedetect filter (ffmpeg resolved from FFMPEG_PATH or PATH). Digital silence reports ~ -91 dB, real audio sits well above -40 dB, so the test asserts mean_volume > -80 dB. Helper logic validated locally against generated silent (-91 dB → fails) vs tone (-21 dB → passes) clips.

Dependency

Requires the libobs fix — streamlabs/obs-studio#738 — to be present in the consumed libobs build. This PR will not go green until that fix is rolled into the osn libobs version.

Notes

  • Type-checks clean (tsc --noEmit, project options).
  • Adds a new test-time dependency on an ffmpeg binary; OBS bundles one, or set FFMPEG_PATH.

🤖 Generated with Claude Code

Mirrors #1493: an ffmpeg_source wrapped in a
scene (with sceneItem.video deliberately left unset, so the scene item's
canvas stays NULL) and set as the output source must still record
non-silent audio. Before the libobs fix this recorded silence.

Adds util/media_probe.ts, which reads mean_volume via ffmpeg's
volumedetect filter (resolved from FFMPEG_PATH or PATH); digital silence
is ~ -91 dB, so the test asserts mean_volume > -80 dB.

Requires the libobs fix in streamlabs/obs-studio (branch
fix/scene-audio-null-canvas-guard) to pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant