This might seems stupid and probably it is but i cannot find a way to play a beep for the whole duration inside a loop:
Note that i don't know the beep duration as it is random
Tried that but is not ok (play two times)
Thanks
B4X:
Sub test
Dim rnd_time as int
For i = 1 To 50
freq = Rnd(300,1000)
rnd_time = rnd(100,400)
beep1.Initialize(rnd_time,freq)
beep1.Beep
Next
End sub
Note that i don't know the beep duration as it is random
Tried that but is not ok (play two times)
B4X:
Sub test
Dim rnd_time as int
For i = 1 To 50
freq = Rnd(300,1000)
rnd_time = rnd(100,400)
beep1.Initialize(rnd_time,freq)
beep1.Beep
Dim seconds As Int
seconds = 1
Dim Ti As Long
Ti = DateTime.Now + (seconds * rnd_time)
Do While DateTime.Now < Ti
DoEvents
Loop
Next
End sub
Thanks
Last edited: