Thank you for your reply !
I load titres.txt on each function because when I declare the array globally, I get this error :
- The file "titres.txt" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.
- Exception in thread "Animation Thread" java.lang.NullPointerException
- at voix_led_memoire_bouton.setup(voix_led_memoire_bouton.java:98)
- at processing.core.PApplet.handleDraw(PApplet.java:2117)
- at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:193)
- at processing.core.PApplet.run(PApplet.java:2020)
- at java.lang.Thread.run(Thread.java:662)
This error appears on the line "son = new AudioSample[titres.length];"... and I don't know why !
I tried to put size(500,500) at the begining of setup(), but it didn't change anything...
Also, the size of my MP3 is about 6 Mo.
EDIT : I have not the error about the array anymore, (it was my fault) but I still have the outofmemory one...