Hi Everyone,
I get a "Prepare failed" error when the code is run on the media load statement. Can you check the code and tell us what to fix to stop the errors?
If I use File.DirRootExternal it works ok and no errors.
If I use File.DirDefaultExternal it works ok and no errors.
Using File.DirAssets gives a "no such file or directory" error.
Using File.DirInternal gives a "prepare failed" error.
Using File.DirInternalCache gives a "prepare failed" error.
Thanks.
I get a "Prepare failed" error when the code is run on the media load statement. Can you check the code and tell us what to fix to stop the errors?
If I use File.DirRootExternal it works ok and no errors.
If I use File.DirDefaultExternal it works ok and no errors.
Using File.DirAssets gives a "no such file or directory" error.
Using File.DirInternal gives a "prepare failed" error.
Using File.DirInternalCache gives a "prepare failed" error.
Thanks.
B4X:
Sub DownloadedMp3File
ProgressBarDownloading.Indeterminate = True
ProgressBarDownloading.Visible = True
HttpUtils.Download("Job1", mp3Url)
End Sub
Sub JobDone(Job As String)
Select Job
Case "Job1"
If HttpUtils.IsSuccess(mp3Url) Then
Dim mp3 As InputStream
mp3 = HttpUtils.GetInputStream(mp3Url)
File.Copy2(mp3,File.OpenOutput(File.DirInternal,"077.mp3",False))
ProgressBarDownloading.Visible = False
ToggleButtonPlayPause.Checked = True
ToggleButtonPlayPause.Enabled = True
blnCurrentPauseCheckedState = True
blnCurrentPauseEnabledState = True
mpTheMediaPlayer.Release
mpTheMediaPlayer.Initialize2("SurahAlMorsalat")
mpTheMediaPlayer.Load(File.DirInternal, "077.mp3")
mpTheMediaPlayer.Play
End If
End Select
End Sub
Last edited: