L Laurie Member Licensed User Longtime User Jul 23, 2020 #1 Using a supplied example but trying to load and play a song from the device (Android 6) and using B4A 9.9 I am unable to play the song and get the EACCES error as titled above??? What am I doing wrong - or more likely failing to do.. Public Sub Play Service.StartForeground(nid, CreateNotification("Playing music - Radio Paradise")) 'pl.Prepare(pl.CreateUriSource("http://stream.radioparadise.com/aac-128")) Dim MyFolder As String MyFolder=File.DirRootExternal & "/Music" pl.Prepare(pl.createfilesource(MyFolder, "Standingthere.mid")) pl.Play End Sub
Using a supplied example but trying to load and play a song from the device (Android 6) and using B4A 9.9 I am unable to play the song and get the EACCES error as titled above??? What am I doing wrong - or more likely failing to do.. Public Sub Play Service.StartForeground(nid, CreateNotification("Playing music - Radio Paradise")) 'pl.Prepare(pl.CreateUriSource("http://stream.radioparadise.com/aac-128")) Dim MyFolder As String MyFolder=File.DirRootExternal & "/Music" pl.Prepare(pl.createfilesource(MyFolder, "Standingthere.mid")) pl.Play End Sub
Erel B4X founder Staff member Licensed User Longtime User Jul 23, 2020 #2 Please use [code]code here...[/code] tags when posting code. Runtime permissions: https://www.b4x.com/search?query=Runtime+permissions Upvote 0
Please use [code]code here...[/code] tags when posting code. Runtime permissions: https://www.b4x.com/search?query=Runtime+permissions
L Laurie Member Licensed User Longtime User Jul 24, 2020 #3 Thanks for responding Erel, but I had already viewed that area and I'm still utterly confused. I've spent hours trying to achieve what seems like a simple objective - a background task that will access and play songs from the devices own memory. I'm ready to give up and forget all about B4A. Upvote 0
Thanks for responding Erel, but I had already viewed that area and I'm still utterly confused. I've spent hours trying to achieve what seems like a simple objective - a background task that will access and play songs from the devices own memory. I'm ready to give up and forget all about B4A.
drgottjr Expert Licensed User Longtime User Jul 24, 2020 #4 don't use File.DirRootExternal. use File.DirInternal. store your stuff there. android doesn't want you to use File.DirRootExternal. it may be the device's "own memory", but it's not yours. you need permission to use it (and a number of other resources which belong to the device but not to you). Upvote 0
don't use File.DirRootExternal. use File.DirInternal. store your stuff there. android doesn't want you to use File.DirRootExternal. it may be the device's "own memory", but it's not yours. you need permission to use it (and a number of other resources which belong to the device but not to you).
Erel B4X founder Staff member Licensed User Longtime User Jul 24, 2020 #5 The video tutorial shows how to access File.DirRootExternal. Watch it. If it doesn't work then post your updated code. Upvote 0
The video tutorial shows how to access File.DirRootExternal. Watch it. If it doesn't work then post your updated code.