Minim Volume Control problems
in
Core Library Questions
•
1 year ago
I've tried to follow the minim documentation to control the volume of the track playing, but I can't get it to work. What am I doing wrong? Here's my code:
- import ddf.minim.*;
- import ddf.minim.signals.*;
- import ddf.minim.analysis.*;
- import ddf.minim.effects.*;
- AudioPlayer gameMusic;
- Minim songLoader;
- AudioOutput out;
- float volLevel = 0;
- void setup()
- {
- songLoader = new Minim(this);
- startTrack("01.mp3");
- }
- void draw ()
- {
- volLevel = (volLevel + 0.1) % 1;
- updateTrackVol(volLevel);
- }
- void startTrack (String trackName)
- {
- gameMusic = songLoader.loadFile(trackName);
- gameMusic.loop();
- }
- void updateTrackVol (float amount)
- {
- out = songLoader.getLineOut();
- out.setVolume(amount);
- }
1