Minim won't loadFile() AIFF, even though file is in data folder. [SOLVED]
in
Core Library Questions
•
7 months ago
As of March 16:
Turns out the AIFFs wouldn't load because minim wouldn't recognize them, so I converted all my AIFFs to MP3s and solved the problem.
Here's my sound setup code:
- import ddf.minim.*;
- AudioPlayer title_music;
- AudioPlayer jacob_fire;
- AudioPlayer enemy_fire;
- AudioPlayer level1_music;
- AudioPlayer explosion;
- AudioPlayer damage;
- Minim minim;
- void setupSound()
- {
- minim = new Minim(this);
- title_music = minim.loadFile("/sfx/explosion.wav");
- }
- void playTitleMusic()
- {
- if(GAME_STATE == MAIN_MENU)
- {
- title_music.play();
- title_music.loop();
- }
- else
- {
- title_music.pause();
- }
- }
- void stop()
- {
- title_music.close();
- //jacob_fire.close();
- //enemy_fire.close();
- //level1_music.close();
- //explosion.close();
- //damage.close();
- minim.stop();
- super.stop();
- }
Also here is the error:
- ==== JavaSound Minim Error ====
- ==== IOException: Resetting to invalid mark
- Exception in thread "Animation Thread" java.lang.NullPointerException
- at ddf.minim.javasound.JSMinim.getAudioRecordingStream(Unknown Source)
- at ddf.minim.Minim.loadFile(Unknown Source)
- at ddf.minim.Minim.loadFile(Unknown Source)
- at JTVG.setupSound(JTVG.java:270)
- at JTVG.setup(JTVG.java:35)
- 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:680)
1