I just bought a wattmeter and realized that my speakers are using 15 Watts on idle.
Is there a way to detect that no sound is being currently played in order to turn off my speakers ?
The system sounds are currently being played by my monitor through HDMI, and the audio output of my Macbook Pro is connected to my speakers through a jack cable. Applications that are likely to play sound are: VLC, iTunes, Chrome.
I didn't want to formulate this question as a XY problem, so I'll just enumerate a few ideas that came to my mind to solve this. I'm open to any kind of solution, high or low level.
Turning off the speakers will most likely be done with a relay controlled with an Arduino.
I don't see any obvious way to detect if sound is being played programmatically, but I would be interested to know if this is possible. Maybe there is a system call that I could use to estimate the current audio level ?
The launching of the screen saver is more or less a good indication that it's time to turn off the speakers. It's probably possible to create a Quartz Composer composition that would be used as a screen saver, and also turn off the speakers when it's starting, but Quartz Composer seems to be dying slowly. Who knows if it will still exist in the next OS X release ?
Also, a totally external hardware solution would be great, maybe some kind of circuit that would detect if sound is currently being played, and activate or deactivate a relay accordingly.
The speakers are these ones:
http://www.amazon.fr/CREATIVE-I-Trigue-L3450-Enceintes-2-1/dp/B0000CD7I8
Here are the specs (in French):
Puissance (Totale) Nominale de Sortie: 48 Watts
Puissance Max de Sortie du Système Audio: 100 Watts
Détails du système haut-parleur: 1 x Caisson de basses 30 Watts, 2 x Haut-parleurs satellite 9 Watts
My cheap Chinese wattmeter reads 11.8 W when idle; the same Chinese wattmeter gives me plausible measures with everything that I have measured so far (from a charging 12W iPad charger to a running 2300W boiler).