ungive / discord-music-presence

The Discord music status that works with any media player
https://musicpresence.app
Other
236 stars 2 forks source link

Show bit rate and kHz audio stats #1

Closed aldumgames closed 6 months ago

aldumgames commented 8 months ago

Is there a way to show the audio stats on it, like it showing the bit and khz, i think an option for the stats would be cool, I've seen other rich presence music apps have something like that(like Foobar), also sorry for using issue, not sure where to put this kinda thing on git.

ungive commented 7 months ago

Thank you for reaching out and creating the first issue! I only saw your message now, hence my late reply.

Foobar's Discord Presence is programmed into Foobar itself and has access to the actual song file, thus it can easily show the exact bit rate and frequency range. With TIDAL this is not as trivial, as this application is running in a separate process, completely independent of the music player.

The TIDAL API gives information about each song, but the exact information you are looking for is not provided there unfortunately, so finding out the exact bitrate/khz is going to be difficult. The only information here is "audioQuality" and "mediaMetadata", but from my own testing it's not possible to derive exact values in every case:

16-BIT 44.1KHZ: LOSSLESS
24-BIT 44.1KHZ: LOSSLESS, HIRES_LOSSLESS
24-BIT 48KHZ:   LOSSLESS, HIRES_LOSSLESS, MQA
24-BIT 96KHZ:   LOSSLESS, HIRES_LOSSLESS, MQA
MQA:            LOSSLESS, MQA

The fact that with "MQA" titles you don't get any bitrate/khz information makes this only harder.

It might be possible to hook into the system's media playback system and get the exact khz/bitrate from that. I will look into that once I have finished the rewrite of this application. Currently I'm focusing on extending this application to work on all three major platforms (Windows, Mac, Linux) and with any media application (not just TIDAL).

ungive commented 6 months ago

Since Music Presence is designed to work with multiple media players and streaming services, not just TIDAL, adding support to show bitrate and frequency range of the song is far from trivial. A short summary of the reasons:

Unless media players communicate information like this through a respective system API, this won't be implemented as of now.

If I missed anything that makes this trivial to implement, feel free to reopen this issue!