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

Error with Metatag bpm - Floating Decimal Error #185

Open
MaWiLi opened this issue Jan 12, 2021 · 1 comment
Open

Error with Metatag bpm - Floating Decimal Error #185

MaWiLi opened this issue Jan 12, 2021 · 1 comment

Comments

@MaWiLi
Copy link

MaWiLi commented Jan 12, 2021

Problems to set the result ob getBpm() into an int variable.

Exception in thread "main" java.lang.NumberFormatException: For input string: "0 Bpm"
at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
at java.base/jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
at java.base/java.lang.Float.parseFloat(Float.java:455)
at com.mpatric.mp3agic.AbstractID3v2Tag.getBPM(AbstractID3v2Tag.java:600)

@MaWiLi MaWiLi changed the title Error with Metatag bpm - Floating Decima Error Error with Metatag bpm - Floating Decimal Error Jan 12, 2021
@jmizv
Copy link

jmizv commented Mar 21, 2021

Hi @MaWiLi

have you seen this test case?

  @Test
    public void shouldStoreAndRetrieveBPM() throws Exception {
        final ID3v22Tag id3tag = new ID3v22Tag();
        final int bpm = 8 * 44100;
        id3tag.setBPM(bpm);
        final byte[] bytes = id3tag.toBytes();
        final ID3v22Tag newId3tag = new ID3v22Tag(bytes);
        assertEquals(bpm, newId3tag.getBPM());
    }

It works fine. What is the code you use to produce the above exception?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants