Re: Slim::Music::Info::setDelayedCallback incorrect delay calc for 48000 sample rate
philippe_44 <philippe_44.a9vrjz-NUepA2SMhDQqspMVqqL2D+4xXEVPTSb/[email protected]>
| Newsgroups | gmane.music.equipment.slimdevices.devel |
|---|---|
| Organization | Logitech Squeezebox Forums |
| Message-ID | <[email protected]> |
Code:
--------------------
if ( $bitrate > 0 ) {
my $decodeBuffer = $client->bufferFullness() / ( int($bitrate / 8) );
my $outputBuffer = $client->outputBufferFullness() / (44100 * 8);
--------------------
bufferFullness and outputBufferFullness are the current level in bytes
of the stream buffer and the decoded (raw) samples buffer
So I agree that bufferfulness/(bitrate/8) gives a delay value, but
outputBufferFullness / (44100 * 8) will not always make sense as it
assumes outputbuffer has 8 bytes per frame, which is not always true.
But still, using the samplerate when known is better, still :)
BTW, there are a few other places where 44100 is hard coded.
LMS 8.2 on Odroid-C4 - *SqueezeAMP!*, 5xRadio, 5xBoom, 2xDuet, 1xTouch,
1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW,
2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha
WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3
------------------------------------------------------------------------
philippe_44's Profile: http://forums.slimdevices.com/member.php?userid=17261
View this thread: http://forums.slimdevices.com/showthread.php?t=115303