This turned out to be a pretty long post, so if you don't feel like reading the whole thing, my basic question is: How can I control the volume of a sound file that is playing in NodeRED on my raspberry pi (the same machine running NodeRED).
******************
I'm brand new to all of this but using Node-RED I have managed to produce a working click track (metronome) system for my band when we play live gigs.
I have a UI with a button for each of our songs which, when pressed, plays a pre-recorded click track (mp3 file), and the drummer can trigger these from his iPad via dashboard. I have NodeRED set to launch at startup so all we have to do is plug in the RPi, wait 20 seconds and then log on to the dashboard from any device. It's really really great.
HOWEVER....
I want to go deeper. The catalogue of songs is ever changing and it is impractical to record a new audio file for each song, especially if we are on the road. Therefor I created a flow that generates a click track based on a tempo derived from the value of a dashboard slider. Once the value is obtained, it plays a sound file (which consists of one "click") over and over at a setInterval() until stopped.
With a little help from the people here, it actually works very well!
BUT...
It works SO well I have decided to institute options for quarter note, eighth not, and sixteenth notes. I would like to be able to assign a slider to each of those that turns the volume up or down. In other words, with one slider, I can turn quarter notes all the way up, while at the same time I can turn the eight notes to half volume. The only problem is, I can't find any way to do it or any reference to volume control other than using the GPIO to control an external device.
I know this is probably not what this powerful platform was intended for, and my skill/knowledge level is lack-luster, but there's got to be a way and I hope that someone here can point me in the right direction. Sorry for the life story!. Thanks in advance.