Skip to content

feat: add Audio Gain block with live property updates#464

Merged
srperens merged 3 commits intomainfrom
feat/audiogain-block
Mar 27, 2026
Merged

feat: add Audio Gain block with live property updates#464
srperens merged 3 commits intomainfrom
feat/audiogain-block

Conversation

@srperens
Copy link
Copy Markdown
Collaborator

Summary

  • Add new builtin.audiogain block with volume (dB), mute, and polarity inversion — all controllable at runtime via a volumeaudioamplify GStreamer chain
  • Introduce a generic live flag on ExposedProperty that marks properties as real-time updatable without flow restart, shown with a LIVE badge in the UI
  • Add frontend debounce system (80ms) for live property API calls with pending-flush to ensure the final slider value is always delivered
  • Add custom dB slider widget (-60 to +20 dB) with dB-to-linear conversion for the GStreamer volume element

Test plan

  • Create a flow with an audio source → Audio Gain → audio output
  • Verify gain slider updates audio level in real-time while playing
  • Verify mute toggle works without restarting the flow
  • Verify polarity invert works without restarting the flow
  • Verify LIVE badge appears next to gain, mute, and invert properties
  • Verify changes persist after saving the flow and restarting

🤖 Generated with Claude Code

Per Enstedt and others added 3 commits March 27, 2026 16:40
Add a simple serial audio processing block for inline gain, mute, and
polarity inversion. Uses GStreamer volume element for gain/mute and
audioamplify for polarity inversion (amplification=-1.0).

All properties are stored in user-friendly units (dB for gain, bool for
invert) and converted to GStreamer's internal format (linear, amplification)
both at build time and during runtime property updates.

This is the first block with live-updating properties in the right-side
properties panel. Properties show a green LIVE badge with hover tooltip
explaining the real-time behavior. The reset button also triggers live
updates to ensure the pipeline stays in sync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a `live: bool` field to ExposedProperty in strom-types so any block
can mark individual properties as real-time updatable. The frontend now
checks `exposed_prop.live` instead of hardcoding block IDs to determine
which properties show LIVE badges and send direct pipeline updates.

Also replaces audioinvert with audioamplify (amplification=-1.0) for
polarity inversion, and fixes the reset button to trigger live updates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… type mismatch

Fix inconsistent indentation of `live: false` across block definitions,
change audiogain amplification type from f32 to f64 for consistency with
PropertyValue::Float, add 80ms debounce on live property API calls to
prevent flooding during slider drags, and fix misplaced doc comments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@srperens srperens force-pushed the feat/audiogain-block branch from c9081e4 to 3992018 Compare March 27, 2026 15:48
@srperens srperens merged commit add15e5 into main Mar 27, 2026
13 of 14 checks passed
@srperens srperens deleted the feat/audiogain-block branch March 27, 2026 19:34
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