Skip to content
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

Fixed mp3 frame not found. #196

Merged
merged 3 commits into from
May 14, 2024
Merged

Conversation

Krispeckt
Copy link
Contributor

The error was caused by selecting the first track without checking the codec.

The error was caused by selecting the first track without checking the codec
@topi314
Copy link
Owner

topi314 commented May 14, 2024

ah that makes sense, lavaplayer can also play aac tracks fyi

@topi314 topi314 added the bugfix Something is hopefully working now label May 14, 2024
.filter(c -> c.get("codec").text().equals("mp3"))
.max(Comparator.comparingInt(b -> b.get("bitrateInKbps").as(Integer.class)))
.map(d -> d.get("downloadInfoUrl").text())
.orElse(null);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use orElseThrow here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do a comit when I get home, didn't know about orElseThrow. :>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use orElseThrow here

Do I fix it or don't I need to fix it?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally you do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Np

@Krispeckt
Copy link
Contributor Author

ah that makes sense, lavaplayer can also play aac tracks fyi

Yes, it makes sense when checking for codec type. But there is no codec type check in the code, Mp3Track is used right away.
See image

@topi314
Copy link
Owner

topi314 commented May 14, 2024

feel free to add support for this if you want, else this is ready to merge

@Krispeckt
Copy link
Contributor Author

feel free to add support for this if you want, else this is ready to merge

Doesn't make sense as yandex always gives mp3.

@topi314 topi314 merged commit bbad3ab into topi314:master May 14, 2024
@topi314
Copy link
Owner

topi314 commented May 14, 2024

thanks

@Krispeckt Krispeckt deleted the mp3-frame-not-found-fix branch May 24, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Something is hopefully working now
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants