Re: how to tell bgt a music track has looped

Alternatively, try this:
double oldPos = -1, newPos;
while(true) {
newPos = s.position;
if(newPos < oldPos) {
// sound has looped, code goes here

}
oldPos = newPos;
}
The advantage of this code is that the sound will keep looping no matter what. So if for some reason there's a 40 ms delay in your program, the user won't notice because the sound will keep on going.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ty via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : roelvdwal via Audiogames-reflector

Reply via email to