Thks, yes. but not found, hoe to play form "Internal Storage"Had you a look thru this posts ?
https://www.b4x.com/android/forum/pages/results/?query=Soundpool
Thks ErelAssuming that you are asking about XUI.DefaultFolder = File.DirInternal, then yes, you can play from this folder.
If File.Exists(File.DirInternal,"Pling.mp3") Then
Log("OK, file is here")
Else
Log("No such file")
End If
End If
HiThe file isn't there.
Where is the code that copies it to File.DirInternal?
Private Sub ListView1_ItemClick (Position As Int, Value As Object)
Dim f As ExternalFile = Value
If f = UpItem Then
'remove the current folder
FoldersStack.RemoveAt(FoldersStack.Size - 1)
'get the parent folder which is now the topmost folder
Dim folder As ExternalFile = GetCurrentFolder
'remove it and enter it again
FoldersStack.RemoveAt(FoldersStack.Size - 1)
EnterFolder(folder)
Else
If f.IsFolder Then
EnterFolder(f)
Else If IsImageFile(f.Name) Then
LogColor("File name: " & f.Name, Colors.Red)
Dim in As InputStream = Storage.OpenInputStream(f)
'We can open the image directly with Bitmap.Initialize2 however it will not allow us to use LoadBitmapResize
'so instead we copy it to a temporary file.
Dim out As OutputStream = File.OpenOutput(File.DirInternal, "temp", False)
File.Copy2(in, out)
out.Close
LoadId1= sp1.Load(File.DirInternal,"temp")
'ImageView1.SetBackgroundImage(LoadBitmapResize(File.DirInternal, "temp", ImageView1.Width, ImageView1.Height, True))
End If
End If
End Sub
You can't. The internal storage is not accessble.I copied it manually, tablet connected to PC.
You must copy it to a temporary file.but only if it is copied to a temporary file.
Thks,hm,......You can't. The internal storage is not accessble.
You must copy it to a temporary file.
OKFile.DirInternal is not accessible externally. Only your app can access this folder.
Accessing the folders in these screenshots should be done with ExternalStorage or better with ContentChooser. You will then need to copy the file to File.DirInternal and play it.
Hi,You haven't really told us what you are trying to do. If you want to let the user choose a file and then play it then search for ContentChooser
You will need to use ContentChooser or ExternalStorage - choose the file or folder and then copy them to File.DirInternal (=XUI.DefaultFolder).I can upload them, but I don't know how to "put" them in a folder, programmatically not manually, where I can play them.
Private Sub btOpen_Click
Dim cc As ContentChooser
cc.Initialize("cc")
cc.Show("audio/*", "Choose audio file")
Wait For CC_Result (Success As Boolean, Dir As String, FileName As String)
If Success Then
Dim InStr As InputStream = File.OpenInput("ContentDir",FileName)
Dim OutStr As OutputStream = File.OpenOutput(File.DirInternal,"YOUR_FILENAME",False)
File.Copy2(InStr,OutStr)
OutStr.Close
Else
MsgboxAsync("open file error","")
End If
End Sub
Thks. Yes, its what i need.Try this
B4X:Private Sub btOpen_Click Dim cc As ContentChooser cc.Initialize("cc") cc.Show("audio/*", "Choose audio file") Wait For CC_Result (Success As Boolean, Dir As String, FileName As String) If Success Then Dim InStr As InputStream = File.OpenInput("ContentDir",FileName) Dim OutStr As OutputStream = File.OpenOutput(File.DirInternal,"YOUR_FILENAME",False) File.Copy2(InStr,OutStr) OutStr.Close Else MsgboxAsync("open file error","") End If End Sub