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

**URL:** https://discourse.processing.org/t/created-a-class-with-a-soundfile-in-it-got-indexoutofboundsexception/10099
**Category:** Processing.py
**Created:** [April 8, 2019, 4:20pm UTC](https://discourse.processing.org/t/created-a-class-with-a-soundfile-in-it-got-indexoutofboundsexception/10099 "2019-04-08T16:20:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sky](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sky/32/3013_2.png) [@Sky](https://discourse.processing.org/u/Sky)
#### Post date: [April 8, 2019, 4:20pm UTC](https://discourse.processing.org/t/created-a-class-with-a-soundfile-in-it-got-indexoutofboundsexception/10099/1 "2019-04-08T16:20:58Z")

</div>

processing.app.SketchException: java.lang.IndexOutOfBoundsException

```auto
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

```

---

<div class="post-metadata">

### Author: ![tabreturn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tabreturn/32/3697_2.png) [@tabreturn](https://discourse.processing.org/u/tabreturn)
#### Post date: [April 8, 2019, 7:59pm UTC](https://discourse.processing.org/t/created-a-class-with-a-soundfile-in-it-got-indexoutofboundsexception/10099/2 "2019-04-08T19:59:35Z")

</div>

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](https://github.com/processing/processing-sound/issues).
