We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi Community,
I have got a problem that my sound file can't loop! I tried decreasing the bitrate, which does not work.
Help somebody could help me! Thank you very much!!!!
Here is my main tab! My classes are too long and maybe not related to the sound loop problem.So i did not include them.If the main tab does not have any question,i will go to check my classes.
import g4p_controls.*;
PImage back;
import processing.sound.*;
SoundFile BGM;
void setup() {
size(1800, 1000);
back= loadImage("background13.png");
textAlign(CENTER, CENTER);
imageMode(CENTER);
iniTial();
createGUI();
BGM = new SoundFile (this,"BGM.mp3");
BGM.loop();
}
void draw() {
background(255, 255, 255);
drawBackground();
keepersActivity();
ballActivity();
winSign();
chaser_gryffindoActivity();
chaser_slytherinActivity();
}
Answers
Please use the minim library instead and see if that works for you. You can start by checking the examples that comes with the library. Make a small sketch just testing its functionality before you add it to your main code.
Kf
Thank you very much,KF!I' ve tried the minim library, my BGM go to loop but it will break in the middle of the BGM, and loop from the start of the BGM. My BGM can't run to end, it always stopped in the middle and loop from the beginning.
I've no idea why.
why the rewind on line 13?
the one thing we can't test is your mp3 file because we don't have it. maybe it's corrupt. but remove the rewind first.
Thank you koogs . I remove the rewind() now, but it still stops in the middle and loop from the beginning. I am sure the mp3 file is fine, cause if I delete BGM.loop() and use BGM.play(). I can play my BGM.mp3 from start to the end. However, Which can't loop. It's so weird.
as you can see, I have the comment here, are two versions of the code.
the loop() one, but stopped in the middle.
The play() one,not loop ,but can be played in full.
Please tell me how to fix it ,thanks.
Try it with another file.