Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select preset with sound threshold #187

Open
hobbypin opened this issue Mar 24, 2022 · 2 comments
Open

Select preset with sound threshold #187

hobbypin opened this issue Mar 24, 2022 · 2 comments
Labels
backburner keeping this on the backburner; we might consider it in future enhancement New feature or request

Comments

@hobbypin
Copy link

When sound(volume) reaches a set threshold change to preset x. Once sound falls under preset for some delayed period of time return to previous preset. Very much like a button but triggered on sound level.

My use case is using SRWLED in a jukebox. nothing playing I use a simple attract mode. When music starts I would like to use one of the Sound Reactive effects. When music stops return to attract mode.

Wiring a button is possible but sound level trigger would make it a lot easier

@hobbypin hobbypin added the enhancement New feature or request label Mar 24, 2022
@pnichols77
Copy link

pnichols77 commented Apr 3, 2022

When sound(volume) reaches a set threshold change to preset x. Once sound falls under preset for some delayed period of time return to previous preset. Very much like a button but triggered on sound level.

My use case is using SRWLED in a jukebox. nothing playing I use a simple attract mode. When music starts I would like to use one of the Sound Reactive effects. When music stops return to attract mode.

Wiring a button is possible but sound level trigger would make it a lot easier

Providing the media player youre using is visible in Home Assistant, you could use that to automate sound reactive effects when media is playing.

@softhack007
Copy link
Collaborator

softhack007 commented Aug 12, 2022

I think this is not possible currently. And it would not work with AGC enabled, which will become the new standard.

We take ~50 samples per second from the microphone, and AGC tries to balance input amplification so that samples use 90% of the availeable range which is 0...255 . Chances are very high that every possible value is used within a few seconds.

What could be done in future:

  1. once we have a working "noise gate" - raise a trigger when there is silence for some seconds

  2. AGC uses an internal gain factor. This factor is highly depending on sound input characteristics, like microphone sensitivity and dynamic range of I2S readings. Currently we don't make the AGC gain value visible to users. We could - in principle - check AGC gain against a user-defined threshold, and then raise some trigger when gain is below threshold for some user-defined time. "Below" as high gain indicates a very low input signal so low gain means there is stronger sound.

actually there are no plans right now to create something like this, but it could be possible from technical perspective.

@softhack007 softhack007 added the backburner keeping this on the backburner; we might consider it in future label Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backburner keeping this on the backburner; we might consider it in future enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants