Hi,
I just wrote a program that plays audio files from a selected range. Once the play button is clicked, the audio at the beginning of the range start playing, when that audio is done playing, the next audio up is played, this continues until the whole audio in the range are played.
My problem is that once the audio files starts playing, I loose control of the whole app and phone.
As per the app control I cant do anything in the app, as per the phone (increase or decrease audio, exit app, go to home etc) all of these dont work too. I noticed that the pushing of phone control would finally crash the app.
Pls any ideas. I think the problem is a "Do While" loop in effect while audio files are playing. I am looping because I want each playing audio to finish before moving to the next. I have noticed this issue before in VB.
Below is the code
Sub Spinner3_ItemClick (Position As Int, Value As Object)
store1 = Spinner3.SelectedItem
End Sub
Sub Spinner4_ItemClick (Position As Int, Value As Object)
store2 = Spinner4.SelectedItem
End Sub
Sub Button1_Click
i = 0
MP.Load(File.DirAssets, Spinner1.SelectedItem & "/" & store1 & ".mp3")
MP.play
Playing
End Sub
Sub Playing
Do While MP.IsPlaying
i = i + 1
Loop
If store2 = store1 Then
store1 = Spinner3.SelectedItem
store2 = Spinner4.SelectedItem
Return
End If
store1 = store1 + 1
Button1_Click
End Sub
Sub Button2_Click
MP.Stop
End Sub
:sign0085:
I just wrote a program that plays audio files from a selected range. Once the play button is clicked, the audio at the beginning of the range start playing, when that audio is done playing, the next audio up is played, this continues until the whole audio in the range are played.
My problem is that once the audio files starts playing, I loose control of the whole app and phone.
As per the app control I cant do anything in the app, as per the phone (increase or decrease audio, exit app, go to home etc) all of these dont work too. I noticed that the pushing of phone control would finally crash the app.
Pls any ideas. I think the problem is a "Do While" loop in effect while audio files are playing. I am looping because I want each playing audio to finish before moving to the next. I have noticed this issue before in VB.
Below is the code
Sub Spinner3_ItemClick (Position As Int, Value As Object)
store1 = Spinner3.SelectedItem
End Sub
Sub Spinner4_ItemClick (Position As Int, Value As Object)
store2 = Spinner4.SelectedItem
End Sub
Sub Button1_Click
i = 0
MP.Load(File.DirAssets, Spinner1.SelectedItem & "/" & store1 & ".mp3")
MP.play
Playing
End Sub
Sub Playing
Do While MP.IsPlaying
i = i + 1
Loop
If store2 = store1 Then
store1 = Spinner3.SelectedItem
store2 = Spinner4.SelectedItem
Return
End If
store1 = store1 + 1
Button1_Click
End Sub
Sub Button2_Click
MP.Stop
End Sub
:sign0085: