ITemplate wrote:
> Hi,
>
> I have some Squeezebox Radios for the kids. They tend to up the volume
> to 100% all the time. I'd like define - server side or whatever - how
> loud 100% is on their players. So that they don't mess up their players
> and their ears when they play at 100% volume. And yes, I tried to tell
> them only to go 90%, but that only works for about 5 minutes :)
>
> This has to be "per player" as I dont want to put restrictions on other
> players...any ideas?
>
> --
> Werner
Ideas , here is one.
If one logs on to the radio itself via SSH (enable remote acess in the
settings ) you can find this file Playback.lua .
/usr/share/jive/jive/audio/Playback.lua
This file contains volume maps , I'm not a programmer so I can't tell
which one of these 2 that are used .
But here is where I would start to experiment .
If you edit manually with vi or make a new file and copy over with stp
.
I would rename the old file so it's still there .
And restart the radio otherwise it wont take the change .
This would be a project for a third party app ?
A code snippet with the volume maps .
Code:
--------------------
-- volumeMap has the correct gain settings for volume settings 1-100. Based
on Boom volume curve
--todo when this becomes SP device specific move to service method and make
it per-device
local _defaultVolumeToGain = {
16, 18, 22, 26, 31, 36, 43, 51, 61, 72, 85, 101, 120, 142, 168, 200, 237,
281, 333, 395, 468, 555, 658, 781, 926, 980, 1037, 1098, 1162, 1230, 1302,
1378, 1458, 1543, 1634, 1729, 1830, 1937, 2050, 2048, 2304, 2304, 2560, 2816,
2816, 3072, 3328, 3328, 3584, 3840, 4096, 4352, 4608, 4864, 5120, 5376, 5632,
6144, 6400, 6656, 7168, 7680, 7936, 8448, 8960, 9472, 9984, 10752, 11264,
12032, 12544, 13312, 14080, 14848, 15872, 16640, 17664, 18688, 19968, 20992,
22272, 23552, 24832, 26368, 27904, 29696, 31232, 33024, 35072, 37120, 39424,
41728, 44032, 46592, 49408, 52224, 55296, 58624, 61952, 65536,
}
local _serverVolumeToGain = _defaultVolumeToGain -- same since Squeezeplay.pm
uses Boom curve
--sb2 curve
--local _serverVolumeToGain = {
--232, 246, 260, 276, 292, 309, 327, 346, 366, 388, 411, 435, 460, 487, 516,
546, 578, 612, 648, 686, 726, 769, 814, 862, 912, 966, 1022, 1082, 1146, 1213,
1284, 1359, 1439, 1523, 1613, 1707, 1807, 1913, 2026, 2048, 2304, 2304, 2560,
2816, 2816, 3072, 3072, 3328, 3584, 3840, 4096, 4352, 4608, 4864, 5120, 5376,
5632, 5888, 6400, 6656, 7168, 7424, 7936, 8448, 8960, 9472, 9984, 10496, 11264,
11776, 12544, 13312, 14080, 14848, 15872, 16640, 17664, 18688, 19712, 20992,
22272, 23552, 24832, 26368, 27904, 29440, 31232, 33024, 35072, 37120, 39168,
41472, 44032, 46592, 49408, 52224, 55296, 58368, 61952, 65536,
--}
--provide hook for applets to modify the gain curve
function overrideDefaultVolumeToGain(self, value)
_defaultVolumeToGain = value
end
function setVolume(self, volume, stateOnly)
log:debug("setVolume: ", volume)
self.volume = volume
if (not stateOnly) then
self:_setGain(self:_getGainFromVolume(volume))
end
end
function getVolume(self)
return self.volume
end
function _getGainFromVolume(self, volume)
return _defaultVolumeToGain[volume]
end
function _setGain(self, gain)
log:debug("_setGain: ", gain)
local data = { gainL = gain, gainR = gain}
self:_audg(data, true)
end
--------------------
------------------------------------------------------------------------
Mnyb's Profile: http://forums.slimdevices.com/member.php?userid=4143
View this thread: http://forums.slimdevices.com/showthread.php?t=95391
_______________________________________________
discuss mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/discuss