W WimS Member Licensed User Longtime User Jan 24, 2022 #1 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}
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}
Erel B4X founder Staff member Licensed User Longtime User Jan 25, 2022 #2 mp3 files can be problematic with SoundPool. Have you tried to copy the file (when needed) to XUI.DefaultFolder? Upvote 0
mp3 files can be problematic with SoundPool. Have you tried to copy the file (when needed) to XUI.DefaultFolder?
W WimS Member Licensed User Longtime User Feb 2, 2022 #3 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
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.
W WimS Member Licensed User Longtime User Feb 3, 2022 #4 I have test it to play the sound with mediaplayer and this works good. So this is oke for me. Upvote 0
E el maajoun New Member Licensed User Longtime User May 31, 2022 #5 WN van Surksum said: Je l'ai testé pour jouer le son avec mediaplayer et cela fonctionne bien. Donc c'est bon pour moi. Click to expand... WN van Surksum said: 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} Click to expand... 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
WN van Surksum said: Je l'ai testé pour jouer le son avec mediaplayer et cela fonctionne bien. Donc c'est bon pour moi. Click to expand... WN van Surksum said: 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} Click to expand... 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
DonManfred Expert Licensed User Longtime User May 31, 2022 #6 el maajoun said: 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 Click to expand... this is the english part of the forum. Please write english here. Alternatively you can use the french forum Upvote 0
el maajoun said: 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 Click to expand... this is the english part of the forum. Please write english here. Alternatively you can use the french forum
E el maajoun New Member Licensed User Longtime User Jun 1, 2022 #7 DonManfred said: this is the english part of the forum. Please write english here. Alternatively you can use the french forum Click to expand... OK sorry Upvote 0
DonManfred said: this is the english part of the forum. Please write english here. Alternatively you can use the french forum Click to expand... OK sorry
appie21 Active Member Licensed User Longtime User Jul 22, 2022 #8 Hi i have also same issue and still no luck i use android 12 B4X: Copy 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
Hi i have also same issue and still no luck i use android 12 B4X: Copy 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)