Android Question Wav file cut in the middle

Shay

Well-Known Member
Licensed User
Longtime User
Hi

I am using SoundPool to play wav file (in side service)
and the wav is cut in the middle of playing
any way to solve this?
B4X:
  If AlreadyPlay = False Then
      If Area=True Then
        If Main.Sound > 1 Then
        ph.Vibrate (1000)
        Log("Play..")
        SP1.Play(LoadId1, 1,1,2,0,0)
        End If
        ToastMessageShow(Location, True)
        ToastMessageShow(Location, True)
        AlreadyPlay=True
'        WriteToLog
        Log("Alarm in all areas !!!")
      End If   
    End If
 

stevel05

Expert
Licensed User
Longtime User
How long are the files? Soundpool is only intended for playing short audio clips.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Media player should work for this, or you can use AudioStreamer or AudioTrack.

What's the problem with MediaPlayer?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
It could be a file format issue, not all devices can play all format of files. You could try compressing the files with Ogg and using media player. That seems to be the best supported format. And will make your APK considerably smaller. Although you still may need to change the formatting (mainly the sample rate causes issues)
 
Upvote 0
Top