I am getting this error when I try to play an mp3 file in MediaPlayer object in linux
The code is the following:
I suspect that the problem is in the URI that creates the File.GetUri(....). The uri it creates is the following.
I tried to manually create the following but the result is the same
Any suggestions?
Tested in Ubuntu 22.04 with B4J Bridge...
MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!
The code is the following:
B4X:
Dim savefolder As String = "delthisfolder"
Dim sHomeFolder As String
sHomeFolder = GetSystemProperty("user.home", "")
If File.Exists(sHomeFolder & "/" & savefolder, "") = False Then
File.MakeDir(sHomeFolder , savefolder)
End If
Dim sFolder As String = sHomeFolder & "/" & savefolder
If File.Exists(sFolder,"PleaseWaitProcessing.mp3") = False Then
File.Copy(File.Dirassets, "PleaseWaitProcessing.mp3", sFolder, "PleaseWaitProcessing.mp3")
End If
mp.Initialize("mp", File.GetUri(sFolder, "PleaseWaitProcessing.mp3"))
mp.Play
I suspect that the problem is in the URI that creates the File.GetUri(....). The uri it creates is the following.
file:/root/delthisfolder/PleaseWaitProcessing.mp3
I tried to manually create the following but the result is the same
file:///root/delthisfolder/PleaseWaitProcessing.mp3
Any suggestions?
Tested in Ubuntu 22.04 with B4J Bridge...
Last edited: