I´m trying to download a "mp3" file and then play it
The request
The jobdone
I get an error when I try to initialize the file ( theis line MyPlayer1.Initialize ( File.DirTemp, "voz.mp3", "MyPlayEnd")
The log ( "file Exists" appear
The log
The request
B4X:
job_evento.Initialize ("mp3", Me)
job_evento.Download ( "http://www.consulta10.com.br/ttm/voz/audio.mp3")
job_evento.GetRequest.SetContentType ("audio/mpeg")
The jobdone
B4X:
Select Job.JobName
' Case "Job_Indicacao"
'' ToastMessageShow ( xresp, True )
' CallSub2 ( Main, "Back_Indicacao", xresp )
Case "Job_Token"
xresp = Job.GetString
Msgbox (xresp, "Retorno")
Case "Job_File"
xresp = Job.GetString
Msgbox (xresp, "File")
Case "mp3"
Dim xOutput As OutputStream = File.OpenOutput (File.DirTemp, "voz.mp3", False)
File.Copy2(Job.GetInputStream, xOutput)
xOutput.Close
If File.Exists (File.DirTemp, "voz.mp3" ) Then
Log ( "file exists")
End If
MyPlayer1.Initialize ( File.DirTemp, "voz.mp3", "MyPlayEnd")
MyPlayer1.Looping=False
MyPlayer1.Volume = 1
MyPlayer1.Play
End Select
I get an error when I try to initialize the file ( theis line MyPlayer1.Initialize ( File.DirTemp, "voz.mp3", "MyPlayEnd")
The log ( "file Exists" appear
The log
Error loading file: Error Domain=NSOSStatusErrorDomain Code=1685348671 "(null)"