You can also use the Processing sound library. Go to Sketch> Import Library ...> Add Library ...>
Then find the โsoundโ and download the sound library from the โEducation Fundโ.
import processing.sound.*; SoundFile file; void setup() { size(640, 360); background(255); // Load a soundfile from the /data folder of the sketch and play it back file = new SoundFile(this, "sample.mp3"); file.play(); } void draw() { }
The link can be found here: https://processing.org/reference/libraries/sound/index.html
source share