27 November 2009

Increase granularity of Squeezebox Server volume control

By default, Squeezebox Server only lets you change the volume of a device in increments of 10 (from 0 to 100). After the change below, you can change the volume in increments of 1, using the Softer and Louder buttons. (If you hover your cursor over the volume bar, it will tell you the exact volume level currently being used.)

1. Stop or pause the playback of your device.
2. Open Base.js for editing. For OS X, it's in "/Library/PreferencePanes/Squeezebox.prefPane/Contents/server/HTML/EN/html/SqueezeJS/". For Windows, it's in "\Program Files\Squeezebox\server\HTML\EN\html\SqueezeJS\".
3. Look for the SetVolume function on line 430. (The line number might change with newer Squeezebox Server versions.) Make it look like this:
setVolume : function(amount, d){
if (d)
amount = d + amount;
amount *= 10;
this.playerControl(['mixer', 'volume', amount]);
4. Save the file and refresh the Squeezebox Server page. Test the buttons to ensure the volume indicator changes correctly before you actually play any sound (the wrong code can easily cause the volume to jump to its maximum.)

If an increment of 1 is too small, you can increase it by changing the second line of the function. For example, to increment by 2, change the line to "amount = d + (amount * 2);".

Thanks to Sean Echevarria.

No comments:

Post a Comment