-
Notifications
You must be signed in to change notification settings - Fork 686
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
Local track bitrate missing #577
Comments
As far I as remember without looking at the code - there is a ID3v2 tag for bitrate - and I have seen this filled in on my FLACs. The models.py file has a property for bitrate on the track, so it should be possible to parse and store it. I was going to take a look at this next and implement the things for "status" that are currently missing, but haven't started yet. |
Yeh I see the field in models (and that's what mopidy-spotify sets to make it work), just can't find anywhere that populates it for the local backend. |
Yeah, well it doesn't - so you are right :-) |
The bitrate field of the status command response comes directly from the track bitrate ala https://github.com/mopidy/mopidy/blob/develop/mopidy/frontends/mpd/protocol/status.py#L218 |
Yeah, I think you are right then - should be pretty straightforward in that case. |
Indeed he has, which is great. However I think the mpd frontend should still print 0 (or omit the line entirely from the output) rather than "None" when the track's bitrate is missing. Yay or nay? Also: I don't see a test for the bitrate field in that PR. Presumably that should be added. |
What does MPD do? |
I forgot about that one-liner - but having thought about it today I don't think this is the right way to go. |
The MPD tag cache doesn't include the bitrate, the decoders calculate it on the fly as the track is played.
If no song is currently playing they don't print the bitrate, time, elapsed or audio lines at all.
|
We could probably do it that way for local tracks, but it won't work for i.e. Spotify since it provides us with raw audio data, so we no longer have any information about the bit rate when the audio is played. What's wrong with just keeping it as is? Matching the MPD tag cache isn't a goal in itself. |
What spotify does is fine and what local tracks (now) do is fine too. I've got no issue with wherever it comes from, I just want the case where it's not set to be handled better in MPD's |
@jodal Agree, but you asked and I answered ;) I don't think we should change what I have implemented, but conversely, I think getting it on the fly for local tracks is better (or should be used as a fall-back if the bitrate tag was not found). |
Leaving this issue open until we've tested what happens if bitrate is missing. We probably don't want |
Sorry, are you saying to test what mpd does when bitrate is missing, or
|
The MPD server, not Mopidy. |
But it depends on what the individual audio decoder being used wants to do.
|
I checked the MPD source. Bitrate is an uint16, printed as %u in the |
Where is the bitrate field meant to come from for local tracks? Should it be in the tag cache? It doesn't feature in my tag_cache file or in
_convert_mpd_data()
. I only notice this as thestatus
response contains "bitrate: None" for local tracks, which gives my client an exception when parsing the response as it expected an integer.The text was updated successfully, but these errors were encountered: