Android Question Android 11 not playing mp3 soundpool DirAssets

WimS

Member
Licensed User
I'am playing a little mp3 file with soundpool (sound airhorn) which is located on DirAssets. This was allways working but now on Android 11 it doesn't work any more (several devices).
When i send the mp3 file by a mail attachment it will normaly playing.

Any suggestions?

{code}Dim Snd As SoundPool
Dim LoadId As Int

If Snd.IsInitialized = False Then Snd.Initialize(1)
LoadId = Snd.Load(File.DirAssets,"LuchtHoorn.MP3")
Snd.Play(LoadId,1,1,1,0,0){/code}
 

WimS

Member
Licensed User
I tried to copy the file to File.DirInternal but it doesn't work. I have the mp3 file converted to wav format but it will not playing also.

The smartphone gives a hum sound instead of playing the mp3/wav file.
 
Upvote 0

WimS

Member
Licensed User
I have test it to play the sound with mediaplayer and this works good. So this is oke for me.
 
Upvote 0

el maajoun

New Member
Licensed User
Longtime User
Je l'ai testé pour jouer le son avec mediaplayer et cela fonctionne bien. Donc c'est bon pour moi.
bonjour j'ai le même problème mais quand j'ai remplacé Snd.Play(LoadId,1,1, 1,0,0) par Snd.Play(LoadId,1,1, 1,0,1) ça fonctionne
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
bonjour j'ai le même problème mais quand j'ai remplacé Snd.Play(LoadId,1,1, 1,0,0) par Snd.Play(LoadId,1,1, 1,0,1) ça fonctionne
this is the english part of the forum. Please write english here.
Alternatively you can use the french forum
 
Upvote 0

appie21

Active Member
Licensed User
Longtime User
Hi i have also same issue and still no luck

i use android 12


B4X:
    Dim PlayMusic As SoundPool
    Dim LoadId As Int
       
    PlayMusic.Initialize(1)
    LoadId = PlayMusic.Load(File.DirAssets,"3.wav")
    'PlayMusic.Play(LoadId,1,1,0,2,1)

    PlayMusic.Play(LoadId, 1, 1, 1, 1, 1)
    Log("id " &LoadId)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…