Skip to content

Conversation

obszczymucha
Copy link

Summary

This PR adds real-time audio monitoring capabilities to the plugin, allowing shaders to react to live audio from OBS sources.

New Shader Parameters

  • audio_peak - instantaneous maximum audio levels (0.0-1.0), responsive to sudden sounds like drums/percussion.
  • audio_magnitude - RMS/averaged audio levels (0.0-1.0), smoother and more stable for sustained audio.

UI Enhancement

  • Audio source dropdown in filter properties to select which OBS audio source to monitor.

Example Shaders

  • audio.shader - Split-screen comparison demonstrating the difference between both parameters.

@obszczymucha
Copy link
Author

Live demo: https://www.twitch.tv/videos/2526338440

@exeldro
Copy link
Owner

exeldro commented Jul 30, 2025

Thank you for the pull request. I am on vacation at the moment so full review will come later, but at a first glance I have a few notes.

It looks like the audio source property is always visible, if the source has audio itself is the property needed? Can the property only be shown when the source has no audio and audio_magnitude or audio_peak is in the shader?

Setting everything to zero in the create is not needed as bzalloc does that.

Why is the reference to the audio source kept? this can cause issues closing OBS or switching scene collections.

obs_volmeter is recreated every update, which is not needed and can cause issues when the filter is updated every video tick via a move value filter for example

Documentation in README.md needs to reflect the changes

@obszczymucha
Copy link
Author

Thanks for the review. I've addressed all issues you mentioned, except showing the UI dropdown conditionally. Also MacOS should hopefully build now as well.
I'm having difficulties easily implementing the "audio_magnitude or audio_peak is in the shader" part. I'll do some more digging and testing.
But then again, when I think of it, perhaps hiding it from the user and only showing it when the shader has the params might not be the best UX, because it then looks as if the feature is not there at all? What do you think?

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.

2 participants