-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] BitDepth and SampleRate at the album level #233
Comments
I was thinking about adding this by passing on the info from the first track in the album. Assuming that all tracks in an album has the same depth/sample rate. I'd also like to be able to present this info when listing albums with mopidy-tidal. Otherwise it's impossible to know if it's an album in HiRes or not. Do you have an album where this is not the case? |
I remember one in qobuz but I did not take note of it. I would assume that these situations simply don't occur. |
This one! |
@GioF71 Good find. A list of qualities could be an option if more than one quality type exists. |
Ok, that would be even better. So in the case of these properties of an album, would you provide a list of tuples (or classes) each one representing a combination of bitdepth and sampling rate? I mean for that album, this would be returned: qualities -> [(24,192000), (16,44100)] I would not instead return a list for individual methods like bitdepth and samplingrate like: bit_depth -> [24, 16] because that would suggest combinations like [24,44100] and [16,192000] that don't exist in the album. The latter does not make a lot of sense anyway. What do you think? |
Hello, I am observing an issue: when my plugin tries to display an album with lots of tracks, like this one which has 75 tracks, I start to get errors collecting bit_depth and sampling rate information. Thank you for any feedback. |
@GioF71 Yes, requesting stream metadata including the bit_depth and sample rate will most likely result in you getting 429 errors if done too frequently so you'd need to throttle those kind of requests. It'll also be quite slow for many albums. For whole albums, I suggest using the first track to determine the album audio resolution as this should be good enough in most cases.. I have added this functionality on track, album level. You can decide whether to get audio quality for the first track or all tracks (list). For the latter, many requests are needed so it should be used with caution. |
Ok thank you very much for your feedback. For albums, yes, using the first track is what I am doing. I am also keeping a table of played tracks on a sqlite db, with these metadata stored, so when available I also use those rows as the source for stream information. So if an album has mixed resolutions, chances are that if it has been previously played, the information will be eventually correct. Assuming that a track never gets "updated" on the Tidal servers. The problem remain for playlists and mixes. In this case my only source is the played tracks table, otherwise the http 429 error is excepted to happen as soon as I try to show just a few tens of tracks. When nothing is available I simply don't set sample rate, but I am setting bitdepth to 24 if max audio quality is configured as HI_RES or HI_RES_LOSSLESS, because otherwise, I would get weird information on control point, saying the track is 16bit/192kHz which is wrong. Thank you again |
For playlist and mixes, I might try to set a configurable limit defining how many tracks can be inspected for stream information. Something like 5 might be a decent compromise to avoid slowdowns and errors. I will try this as soon as I can |
Added in #242 python-tidal/tidalapi/album.py Line 292 in 4a0462d
Currently, you can either get the audio resolution for the first track or all tracks in the album. We can perhaps use a range instead to make this a bit more flexible, in case it is necessary to check specific tracks in the album. |
Thank you very much, that is excellent. |
Hello, would it be possible to have the bitdepth and samplerate available for the album? Even as lists if albums have tracks in different formats (a think that sometimes happens although quite rarely).
Thank you
The text was updated successfully, but these errors were encountered: