how i can loop a soundfile?

wilhelmeros

New Member
Licensed User
Hi,
i am a new user and want that a soundfile repeats, till i click another button.
How i must this write in code
Thank you
 

Cableguy

Expert
Licensed User
Longtime User
You will need the Hekkus dll to controls when the sound file ends...
See the dll listings..in my signature
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
If you know the length of the sound file, then you can use a timer to start the sound each time.
Something like:
B4X:
Sub Globals

End Sub

Sub App_Start
    Form1.Show
    timer1.Interval = SOUND_LENGTH_IN_MILLISECONDS
End Sub
Sub btnStart_Click
    timer1.Enabled = True
End Sub
Sub btnStop_Click
    timer1.Enabled = False
End Sub
Sub Timer1_Tick
    Sound("sound.wav")
End Sub
 
Top