Skip to content

ArrayIndexOutOfBoundsException: 20823 #11

Closed

Description

@rockyhawk64

The code was working perfectly normal before the new API thing, and now it keeps giving this same error highlighted here:

menus = new SoundFile(this, "menu.mp3");

That's just the first sound file there so that's probably why it chooses that one but is there a way to use the old version that was working perfectly for me? (the new version that broke it was 2.0.1)

ERROR:

ArrayIndexOutOfBoundsException: 20823

Sep 11, 2018 11:12:31 PM com.jsyn.devices.javasound.JavaSoundAudioDevice <init> INFO: JSyn: default output latency set to 80 msec for Windows 10 Sep 11, 2018 11:12:31 PM com.jsyn.engine.SynthesisEngine start INFO: Pure Java JSyn from www.softsynth.com, rate = 44100, RT, V16.8.0 (build 463, 2017-10-16)

Activity

  1. kevinstadler commented on Sep 12, 2018

    @kevinstadler
    Collaborator

    Can you please post the full stack trace of the exception, and possibly also upload the mp3 file somewhere so I can test it?

    It's possible that this is fixed by applying GlaDOSik/JavaMP3@73bd62e01a7170ded3435ffdec0241898472f978 to the Sound libraries JavaMP3 dependency, but I'm not 100% certain.

  2. added
    bug
    on Sep 12, 2018
  3. CodingCellist commented on Sep 28, 2018

    @CodingCellist

    I have also run into this problem. I tried with both

    explosion = new SoundFile(this, "explosion.mp3");

    and

    explosion = new SoundFile(this, "../data/explosion.mp3");

    I get the following stack trace:

    Sep 28, 2018 10:20:56 AM com.jsyn.engine.SynthesisEngine start
    INFO: Pure Java JSyn from www.softsynth.com, rate = 44100, RT, V16.8.0 (build 463, 2017-10-16)
    java.lang.ArrayIndexOutOfBoundsException: 16
    	at fr.delthas.javamp3.Decoder.samples_I(Decoder.java:1506)
    	at fr.delthas.javamp3.Decoder.decodeFrame(Decoder.java:517)
    	at fr.delthas.javamp3.Sound.decodeFullyInto(Sound.java:228)
    	at processing.sound.SoundFile.<init>(Unknown Source)
    

    EDIT: The issue persists with version 2.0.0

  4. kevinstadler commented on Sep 29, 2018

    @kevinstadler
    Collaborator

    Thanks for the information, this is definitely to do with the patch I linked to above. I will try to get a fixed version out within a day or two!

  5. kevinstadler commented on Sep 30, 2018

    @kevinstadler
    Collaborator

    @Teh6 I've uploaded a new release that should fix the problem: https://github.com/processing/processing-sound/releases/tag/v2.0.2 Could you do me a favour, download the zip, replace your current installation of the Sound library (under libraries/sound in your Processing folder) with the content of the zip, restart Processing and let us know if you can successfully decode the mp3 with the new version? Many thanks!

  6. CodingCellist commented on Oct 3, 2018

    @CodingCellist

    @kevinstadler Apologies for the late reply. I have tried the new version you have linked, and it works with my .mp3 files. Thank you so much!

    P.S. I get the following info to stderr, I assume this is intended:

    Oct 03, 2018 9:49:05 AM com.jsyn.engine.SynthesisEngine start
    INFO: Pure Java JSyn from www.softsynth.com, rate = 44100, RT, V16.8.0 (build 463, 2017-10-16)
    Oct 03, 2018 9:49:43 AM com.jsyn.engine.SynthesisEngine$EngineThread run
    INFO: JSyn synthesis thread in finally code.
    
  7. kevinstadler commented on Oct 8, 2018

    @kevinstadler
    Collaborator

    @Teh6 fantastic, thanks for testing, I'll roll the fixed version out as soon as possible! And yes, that stderr redtext is semi-intended (see #12)

  8. boloramg commented on Oct 23, 2018

    @boloramg

    @Teh6 fantastic, thanks for testing, I'll roll the fixed version out as soon as possible! And yes, that stderr redtext is semi-intended (see #12)

    Hello, kevinstadler, I'm working with an mp3 sound file on windows 10 using the latest version of Processing. I get the below error message when run the code:

    **ArrayIndexOutOfBoundsException: 16

    Oct 23, 2018 2:13:39 AM com.jsyn.devices.javasound.JavaSoundAudioDevice
    INFO: JSyn: default output latency set to 80 msec for Windows 10
    Oct 23, 2018 2:13:39 AM com.jsyn.engine.SynthesisEngine start
    INFO: Pure Java JSyn from www.softsynth.com, rate = 44100, RT, V16.8.0 (build 463, 2017-10-16)**

    Would you by any chance be able to help me as well?

  9. haschdl commented on Oct 25, 2018

    @haschdl

    Experiencing the same error ArrayIndexOutOfBoundsException in Windows 10.

  10. multimentha commented on Oct 25, 2018

    @multimentha

    I also experience the same problem with certain mp3 files under Windows 7 and using version 2.0.2 of the sound library.

    A temporary work around is to convert your mp3 files to wav. I used Audacity to convert to 16 bit signed integer wav and those files play back fine.

  11. haschdl commented on Oct 25, 2018

    @haschdl

    I tried the conversion to AIF and WAV using VLC player but it didn’t work. I ended up switching to Minim library, which is much older... but so far so good.

  12. rottenoats commented on Oct 26, 2018

    @rottenoats

    EDIT: Just noticed #228 , worked with wav. I think the Processing3 docs need to be updated to indicate that wav needs to be used instead of mp3.

    Hello, I'm getting an IndexOutOfBoundsException with the version 2.0.2

    background = new SoundFile(this, "background.mp3");

    Stack Trace:

    Oct 27, 2018 12:28:48 AM com.jsyn.engine.SynthesisEngine start
    INFO: Pure Java JSyn from www.softsynth.com, rate = 44100, RT, V16.8.0 (build 463, 2017-10-16)
    java.lang.IndexOutOfBoundsException
    	at java.io.BufferedInputStream.read(BufferedInputStream.java:338)
    	at fr.delthas.javamp3.Decoder.readInto(Decoder.java:1784)
    	at fr.delthas.javamp3.Decoder.samples_III(Decoder.java:628)
    	at fr.delthas.javamp3.Decoder.decodeFrame(Decoder.java:546)
    	at fr.delthas.javamp3.Sound.decodeFullyInto(Sound.java:228)
    	at processing.sound.SoundFile.<init>(Unknown Source)
    	at sketch_181026a.setup(sketch_181026a.java:42)
    	at processing.core.PApplet.handleDraw(PApplet.java:2404)
    	at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1557)
    	at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
    

    Sound file is in my data folder and is named "background.mp3"

    Link to the sample music downloaded here (the 64 kpbs version)
    http://mp3normalizer.com/download?id=bTdtSVo1djV2SFU=

  13. TenaciousBirdofPrey commented on Dec 4, 2018

    @TenaciousBirdofPrey

    I tried converting from mp3 to wav and got the following:

    Dec 04, 2018 4:59:37 PM com.jsyn.devices.javasound.JavaSoundAudioDevice
    INFO: JSyn: default output latency set to 80 msec for Windows 10
    Dec 04, 2018 4:59:37 PM com.jsyn.engine.SynthesisEngine start
    INFO: Pure Java JSyn from www.softsynth.com, rate = 44100, RT, V16.8.0 (build 463, 2017-10-16)
    Dec 04, 2018 4:59:42 PM com.jsyn.engine.SynthesisEngine$EngineThread run
    INFO: JSyn synthesis thread in finally code.

  14. kevinstadler commented on Dec 5, 2018

    @kevinstadler
    Collaborator

    @deep-howlround the output you posted is just status information, not an error message. Your sketch should be working as expected (for the 5 seconds that it was running).

  15. abrotons commented on Oct 25, 2020

    @abrotons

    With Sound 2.2.3 I was getting the same IndexOutOfBoundsException only with a couple of MP3 files out of a handful. When I opened the files with Audacity I realised they were the only mono files. So converting them to stereo fixed the problem.

    I'm not sure if there is a quicker way to do this, but I imported them to Audacity, created an empty stereo track, copied and pasted the original sound to the new track, removed the old mono track and exported again.

  16. Rezahans commented on Dec 27, 2022

    @Rezahans

    i have tried ,you can use with any other file except .mp3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions