Created a class with a SoundFile() in it,got IndexOutOfBoundsException

processing.app.SketchException: java.lang.IndexOutOfBoundsException

add_library('sound')
class a:
    def __init__(self,aa):
        self.mus = SoundFile(this,aa)
def setup():
    size(500,500)
    b = a("AbsolutePath\\Macintosh.mp3")
    b.mus.play()
    
def draw():
    pass
1 Like

This seems to be some issue with the MP3 decoder. I tried the exact same code using an AIFF file; it worked fine.

For now, could you use a different audio format (WAV, AIF)? Or maybe integrate some other Python library.

You can log the bug here.

2 Likes