Greetings,
I have an EXOPlayer puzzler for you. My app uses 3 EXO players to play 3 different sound files based on timers. All of the players play for a short while then there is no sound. The coding is set so each of the sounds are played when each of them has finished playing to create background sounds for the app.
Here is the coding:
The highlighted section of code shows a Log statement after .Play which is where I expected to have a "True" for IsPlaying but it returns False as shown in the screen attachment. It could be the reason why the sound stops playing randomly. The strange thing is that the sound file does loop as expected for maybe about a half hour or so before playing multiple times to quickly.
According to the coding, I thought the .IsPlaying flag should be set to "True" right after the .Play is used. blnASongIsPlaying is set to True when the user taps a button to start the background sounds which should stop the code from repeating prematurely. I'm puzzled by the fact that the background sound does actually play correctly even for a short while because if the .IsPlaying flag is set to "False" like that, the player would keep playing on every second of time because that's how the timer is set up. This actually does happen after a half hour or so.
I originally used a "_Complete" handler to simply call the same coding when the player finishes the sound file but that only worked for about a half hour or so before it didn't call the coding. That's why I tried a timer approach.
All help will be appreciated.
I have an EXOPlayer puzzler for you. My app uses 3 EXO players to play 3 different sound files based on timers. All of the players play for a short while then there is no sound. The coding is set so each of the sounds are played when each of them has finished playing to create background sounds for the app.
Here is the coding:
Coding for one of the EXO Players:
Sub tmrForCrickets_Tick
If blnAsongIsPlaying And PlayerForCrickets.IsPlaying = False Then
PlayerForCrickets. _
Prepare(PlayerForCrickets.CreateFileSource(File.DirAssets, _
kvs.Get("Song" & intSongNumberSelected & "Creature0FileName")))
PlayerForCrickets.Volume = kvs.Get("Song" & intSongNumberSelected & "Creature0Volume")
PlayerForCrickets.Play
Log("Playing the Crickets Timer at: " & _
DateTime.GetHour(DateTime.Now) & ":" & DateTime.GetMinute(DateTime.Now) & _
Chr(10) & Chr(10) & PlayerForCrickets.IsPlaying)
Log("Crickets volume: " & kvs.Get("Song" & intSongNumberSelected & "Creature0Volume"))
End If
End Sub
The highlighted section of code shows a Log statement after .Play which is where I expected to have a "True" for IsPlaying but it returns False as shown in the screen attachment. It could be the reason why the sound stops playing randomly. The strange thing is that the sound file does loop as expected for maybe about a half hour or so before playing multiple times to quickly.
According to the coding, I thought the .IsPlaying flag should be set to "True" right after the .Play is used. blnASongIsPlaying is set to True when the user taps a button to start the background sounds which should stop the code from repeating prematurely. I'm puzzled by the fact that the background sound does actually play correctly even for a short while because if the .IsPlaying flag is set to "False" like that, the player would keep playing on every second of time because that's how the timer is set up. This actually does happen after a half hour or so.
I originally used a "_Complete" handler to simply call the same coding when the player finishes the sound file but that only worked for about a half hour or so before it didn't call the coding. That's why I tried a timer approach.
All help will be appreciated.
Last edited: