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

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.
Je joue un petit fichier mp3 avec soundpool (sound airhorn) qui se trouve sur DirAssets. Cela fonctionnait toujours mais maintenant sur Android 11 cela ne fonctionne plus (plusieurs appareils).
Lorsque j'envoie le fichier mp3 en pièce jointe, il jouera normalement.

Aucune suggestion?

{code}Dim Snd As SoundPool
Dim LoadId As Int

Si Snd.IsInitialized = False Alors Snd.Initialize(1)
LoadId = Snd.Load(File.DirAssets,"LuchtHoorn.MP3")
Snd.Play(LoadId,1,1,1,0,0){/code}
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
Top