Skip to content

Fix MP3 heuristic check #3383

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

Merged
merged 1 commit into from
Apr 3, 2025
Merged

Conversation

florianessl
Copy link
Member

Fixing two issues with the refactored MP3 heuristic check:

  • For some files (I mostly noticed this with ModTracker files) the IsMp3() heuristic would now yield wrong positives, because for some reason mpg123_read would immediately result in a status 'DONE without actually reading data.
  • Other small non-mp3 files might yield a single error before resulting in a DONE & still pass the allowed err_count of '3'.

Fixes #3380

- for short files that prematurely result in status 'MPG123_DONE', no erroneous reads should be allowed
- for some files, mpg123_read might immediately return status 'MPG123_DONE' without actually reading anything -> add a check for output param 'done'
@Ghabry Ghabry added this to the 0.8.1 milestone Mar 26, 2025
@Ghabry Ghabry added Audio Heuristics All detection related: encoding, version, etc. labels Mar 26, 2025
@Ghabry
Copy link
Member

Ghabry commented Mar 30, 2025

I tested this a bit more: The game AE (the last days according to Ezra) has many MOD files. These are still detected as MP3 when libxmp is missing.

What works for me to get them detected as not mp3: Reduce the error_count to < 2 OR increase the for loop condition to i < 20.

Download: https://rmn.rmarchiv.de/ (Search for Ezra)

@carstene1ns
Copy link
Member

Unfortunately mod and mp3 have both not a common signature.

Maybe we can look at how others do it e.g. a media player like mpv or libmagic.

@florianessl
Copy link
Member Author

I tested this a bit more: The game AE (the last days according to Ezra) has many MOD files. These are still detected as MP3 when libxmp is missing.

What works for me to get them detected as not mp3: Reduce the error_count to < 2 OR increase the for loop condition to i < 20.

Download: https://rmn.rmarchiv.de/ (Search for Ezra)

Oh nice, I haven't added the RMN archive to my test set yet.
I did also do a test-run by deactivating libxmp and running through all non-standard audio files found in the rmarchiv games. Worked perfectly with the two added checks above, but there always seem to be some outliers for these checks that are hard to catch..

@Ghabry Ghabry merged commit a1ce710 into EasyRPG:master Apr 3, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Audio Heuristics All detection related: encoding, version, etc.
Development

Successfully merging this pull request may close these issues.

Trying to execute a Ineluki script with KeyPatch explicitly disabled, crashes the Player.
4 participants