(03-03-2025, 12:46 PM)Tim Curtis Wrote:(03-03-2025, 12:27 PM)romain Wrote: Hello,
just for testing I've replaced the
PHP Code:$encodedAt = 'Unknown';
at line 703 in music-library.php by the following block of code
PHP Code:$sock = getMpdSock();
$mpdStatus = getMpdStatus($sock);
$rate = empty($mpdStatus['audio_sample_rate']) ? '?' : $mpdStatus['audio_sample_rate'];
$encodedAt = 'UPnP stream ' . $mpdStatus['audio_sample_depth'] . '/' . $rate . ' kHz, ' . $mpdStatus['audio_channels'];
the result below:
Thats the decodedTo format not the encodedAt format
https://mpd.readthedocs.io/en/latest/pro...d-s-status
To see if the encodedAt format is available for an http file reference try mediainfo <URL>
OK, so used this block of code instead
PHP Code:
$result = sysCmd('mediainfo --Inform="Audio;file:///var/www/util/mediainfo.tpl" ' . '"' . $songData['file'] . '"');
$bitDepth = $result[0];
$sampleRate = $result[1];
$channels = $result[2];
$format = $result[3];
$encodedAt = $bitDepth == '?' ?
'UPnP ' . $format . ' stream ' . formatRate($sampleRate) . 'kHz' :
'UPnP ' . $format . ' stream ' . $bitDepth . '/' . formatRate($sampleRate) . ' kHz, ' . $channels . 'ch';
and the resut now
