Que ce soit en wav ou en ogg, ça ne fonctionne pas.
Une idée ?
code corrigé pour sons courts
Code : Tout sélectionner
InitSound()
LoadSound(0,"sample.wav") ; chargez votre son
sd = SoundLength(0, #PB_Sound_Millisecond) ; La durée en ms du morceau (fait +20000)
c=0
PlaySound(0)
Repeat
sp = GetSoundPosition(0,#PB_Sound_Millisecond)
Debug Str(sp) + " / " + Str (sd)
; ici j'ai mis Pause/resume mais avec Stop/play ça marche pas mieux.
If sp > 15000 ; si la position dépasse 15 sec
SetSoundPosition(0,5000,#PB_Sound_Millisecond) ; on se place à 5 sec
c+1
Debug "je reparts à 5 sec"
EndIf
Until c = 2
FreeSound(0)
End