Posts: 14,135
Threads: 323
Joined: Mar 2018
Reputation:
578
Posts: 189
Threads: 20
Joined: Mar 2020
Reputation:
3
03-02-2025, 07:37 PM
(This post was last modified: 03-02-2025, 10:53 PM by romain .
Edit Reason: attached screenshot
)
(03-02-2025, 07:30 PM) Tim Curtis Wrote: I can make that change.
Well, if this info looks pertinent, yes
Also I thought that if you could display bit depth, sample rate and channels, on "Audio information -> Playback" page, you could also have these displayed on cover view instead of "Unknown"
Attached Files
Thumbnail(s)
Posts: 189
Threads: 20
Joined: Mar 2020
Reputation:
3
Hello,
just for testing I've replaced the
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:
Posts: 14,135
Threads: 323
Joined: Mar 2018
Reputation:
578
(03-03-2025, 12:27 PM) romain Wrote: Hello,
just for testing I've replaced the
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>
Posts: 189
Threads: 20
Joined: Mar 2020
Reputation:
3
03-03-2025, 04:54 PM
(This post was last modified: 03-03-2025, 05:47 PM by romain .)
(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
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
(only tested with Tidal and still missing the HD badge)
Posts: 14,135
Threads: 323
Joined: Mar 2018
Reputation:
578
Posts: 189
Threads: 20
Joined: Mar 2020
Reputation:
3
(03-03-2025, 05:49 PM) Tim Curtis Wrote: That could work.
On the other hand I have no idea how the HD badge is displayed
Posts: 189
Threads: 20
Joined: Mar 2020
Reputation:
3
This could look like this until someone finds how to add the HD badge before the song title when necessary.
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 = 'UPnP ' . $format . ' ' . ( $bitDepth == '?' ? formatRate ( $sampleRate ) . 'kHz' : $bitDepth . '/' . formatRate ( $sampleRate ) . ' kHz, ' . $channels . 'ch' );
Posts: 14,135
Threads: 323
Joined: Mar 2018
Reputation:
578
(03-03-2025, 05:59 PM) romain Wrote: (03-03-2025, 05:49 PM) Tim Curtis Wrote: That could work.
On the other hand I have no idea how the HD badge is displayed
Have a look at the } else { block around line 685
Posts: 189
Threads: 20
Joined: Mar 2020
Reputation:
3
(03-03-2025, 10:14 PM) Tim Curtis Wrote: (03-03-2025, 05:59 PM) romain Wrote: (03-03-2025, 05:49 PM) Tim Curtis Wrote: That could work.
On the other hand I have no idea how the HD badge is displayed
Have a look at the } else { block around line 685
I can determine if the stream is HD by comparing bit depth and sample rate and tried this
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 ]; $hiDef = ( $bitDepth > ALBUM_BIT_DEPTH_THRESHOLD || $sampleRate > ALBUM_SAMPLE_RATE_THRESHOLD ) ? 'h' : 's' ; $encodedAt = 'UPnP ' . $format . ' ' . $bitDepth . '/' . formatRate ( $sampleRate ) . ' kHz' . ',' . $hiDef . ',' . $channels . 'ch' ; /* $encodedAt = 'UPnP ' . $format . ' ' . ($bitDepth == '?' ? formatRate($sampleRate) . 'kHz' : $bitDepth . '/' . formatRate($sampleRate) . ' kHz, ' . $channels . 'ch'); */
of course I miss something to get the HD badge displayed because as a result I get this