Stephcraft / Project-16x16

2D Platformer game made with processing
GNU General Public License v3.0
97 stars 77 forks source link

Fix minim audio library errors printed to console #138

Open Stephcraft opened 4 years ago

Stephcraft commented 4 years ago

The audio in the project is handled by the Minim library. This library is yelling errors at runtime. The sources of the errors are unknown and a solution must be established to fix the errors.

Here are the errors:

=== JavaSound Minim Error ====
==== Don't know the ID3 code TSS

==== JavaSound Minim Error ====
==== Error parsing ID3v2: String index out of range: -131

==== JavaSound Minim Error ====
==== Don't know the ID3 code TSS

==== JavaSound Minim Error ====
==== Error parsing ID3v2: String index out of range: -131

==== JavaSound Minim Error ====
==== Don't know the ID3 code TSS

==== JavaSound Minim Error ====
==== Error parsing ID3v2: String index out of range: -131

==== JavaSound Minim Error ====
==== Don't know the ID3 code TSS

==== JavaSound Minim Error ====
==== Error parsing ID3v2: String index out of range: -131
micycle1 commented 4 years ago

These errors are simply saying the mp3 files have no tags.

mapuya19 commented 4 years ago

Do we want to add tags to the MP3 files then?

Stephcraft commented 4 years ago

@mapuya19 If it's possible to fix the errors or hide this specific type of error, it would be the best. It seems like the tags metadata does not exist or maybe its value is invalid: String index out of range: -131. But simply adding tags is fine if nothing else works.

fstuff commented 3 years ago

This is really an issue with the Minim library. It has unsophisticated error logging that can't be configured or turned off. In reality the "errors" being logged are really just warnings. The code in the Minim library just prints all such messages to the System.out stream, and there's no way to configure it. Barring a major revision in Minim to the way ID3 parse errors are handled, there is nothing that can be done here other than to clean up the project mp3 files.

As for the logged errors in the original post above, they are explained as follows: __==== Don't know the ID3 code TSS Based on my review of the Minim source code, the Minim library doesn't have support for that ID3 tag. The MP3s in Project-16x16 are tagged with version ID3v2.2. According to the ID3v2.2 spec the TSS flag is:

The 'Software/hardware and settings used for encoding' frame includes the used audio encoder and its settings when the file was encoded. Hardware refers to hardware encoders, not the computer on which a program was run. It does not seem so important to maintain that tag in the MP3s, so if the extraneous error log is annoying enough, the tag can be removed.

__==== Error parsing ID3v2: String index out of range: -131 I'm not sure exactly why this is happening--the only other tags on the mp3 files in the project are comments. The "error" does not affect the operation of the Minim library.

So, if the ID3 tags are stripped out of the mp3 project files, it should eliminate the noisy warnings ("errors").