Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Idea: Coverview improvements
#21
I can make that change.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#22
(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)
   
Reply
#23
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:

   
Reply
#24
(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>
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#25
(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 Smile (only tested with Tidal and still missing the HD badge)

   
Reply
#26
That could work.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#27
(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
Reply
#28
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'); 

   
Reply
#29
(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
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#30
(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

   
Reply


Forum Jump: