error loading file into memory
in
Core Library Questions
•
11 months ago
Hi. I am working on a sketch that assigns different keys to different wav files. The wav files are all short (less than 30 seconds). So far, I can get one key to play a wav file but when I tried two different keys, only one file plays and the other does not.
(only the same file- order does not matter).
I have been working on this for an embarrassing amount of time and cannot figure it out...
The console reads: JavaSound Minim Error
Error loading file into memory: 15
Other than that, the console says nothing else. If it is simply a question of memory and two very short wav files are an issue, should I increase the memory in processing settings, and how much is reasonable?
Here is the code:
- import ddf.minim.*;
- Minim minim;
- AudioPlayer player;
- AudioSample chicken;
- AudioSample tyler;
- void setup()
- {
- size(512, 200, P3D);
- minim = new Minim(this);
- chicken = minim.loadSample("chicken.wav");
- if ( chicken == null ) println("Didn't get chicken!");
- tyler = minim.loadSample("tyler.wav");
- if ( tyler == null ) println("Didn't get tyler!");
- }
- void draw()
- {
- }
- void keyPressed()
- {
- if ( key == 'c' ) chicken.trigger();
- else if ( key == 't' ) tyler.trigger();
- }
- void stop()
- {
- chicken.close();
- tyler.close();
- player.close();
- minim.stop();
- super.stop();
- }
Thank you... as I can use some help...
1