Hello everybody,
I am new with raspberry pi , trying to use the “basic” sound library on my raspi 4. I don’t want to change to beads or minim (both working, also p5.js works), because the codes are all done and working on windows system with processing.
E.g. when I use the sketch below, there is no error, but also no sound only some choppy noise on the speakers (almost not noticeable). I Installed the library through processing 3.5.3, sound 2.2.3
import processing.sound.*;
SoundFile soundfile;
void setup() {
size(640, 360);
background(255);
soundfile = new SoundFile(this, “vibraphon.aiff”);
println(“SFSampleRate= " + soundfile.sampleRate() + " Hz”);
println(“SFSamples= " + soundfile.frames() + " samples”);
println(“SFDuration= " + soundfile.duration() + " seconds”);
soundfile.loop();
}
void draw() {
float playbackSpeed = map(mouseX, 0, width, 0.25, 4.0);
soundfile.rate(playbackSpeed);
float amplitude = map(mouseY, 0, width, 0.2, 1.0);
soundfile.amp(amplitude);
float panning = map(mouseY, 0, height, -1.0, 1.0);
soundfile.pan(panning);
}
I was looking around for two weeks in forums, but couldn’t find anything that helped me. Any suggestions? Does anybody know a reliable way to use soundfile?