Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

fails to decode mp3 file #7

Closed
icguy opened this issue Jun 10, 2020 · 2 comments
Closed

fails to decode mp3 file #7

icguy opened this issue Jun 10, 2020 · 2 comments

Comments

@icguy
Copy link

icguy commented Jun 10, 2020

Decoder fails on attached audio file: amp.zip

Code:

    val fis = BufferedInputStream(FileInputStream("C:/temp/amp.mp3"))
    var fos = FileOutputStream("C:/temp/out.dat")
    val sound = Sound(fis)
    sound.decodeFullyInto(fos)
    fos.flush()
    fos.close()

Exception:

java.io.IOException: No MPEG data in the specified input stream!
at fr.delthas.javamp3.Sound.<init>(Sound.java:51)

The following exceptions are being caught in Decoder.init() (i printed them):

java.lang.ArrayIndexOutOfBoundsException: Index 1152 out of bounds for length 1152
java.lang.ArrayIndexOutOfBoundsException: arraycopy: source index -386 out of bounds for byte[1024]
java.lang.ArrayIndexOutOfBoundsException: Index 16 out of bounds for length 16
java.lang.ArrayIndexOutOfBoundsException: arraycopy: source index -450 out of bounds for byte[1024]

etc. (there is a lot of them)

Maybe my mp3 file is corrupted (I wrote it after all), but other mp3 players play it no problem. It is MPEG2.

@delthas
Copy link
Owner

delthas commented Jun 10, 2020

This is an MPEG 2 Layer III file. This project currently supports MPEG 1 Layer I/II/III files only, not MPEG 2 or MPEG 2.5 files. See #8

@delthas delthas closed this as completed Jun 10, 2020
@icguy
Copy link
Author

icguy commented Jun 10, 2020

my bad, sorry

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

No branches or pull requests

2 participants