Sub Btnaudio_Click
audio.Initialize ("audio")
audio.Show ("*/*","selecciona tu musica:")
End Sub
Sub audio_Result (Success As Boolean, Dir As String, FileName As String)
If Success Then
archivo = FileName
If archivo.StartsWith("/") Then Return archivo 'If the user used a file manager to choose the image
Dim Cursor1 As Cursor
Dim Uri1 As Uri
Dim Proj() As String = Array As String("_data")
Dim cr As ContentResolver
cr.Initialize("")
If archivo.StartsWith("content://com.android.providers.media.documents") Then
Dim i As Int = archivo.IndexOf("%3A")
Dim id As String = archivo.SubString(i + 3)
Uri1.Parse(archivo)
Cursor1 = cr.Query(Uri1, Proj, "_id = ?", Array As String(id), "")
Else
Uri1.Parse(archivo)
Cursor1 = cr.Query(Uri1, Proj, "", Null, "")
End If
Cursor1.Position = 0
Dim res As String
Dim res1 As String
res = Cursor1.GetString("_data")
Cursor1.Close
res1 = res.SubString(res.LastIndexOf("/") + 1)
Dim largo As Int
Dim largo1 As Int
Dim musica As String
largo = res1.Length
largo1 = res.Length
musica = res.SubString2(0,res.LastIndexOf("/") + 1)
sonido.Initialize(2)
load = sonido.Load(musica, res1)
Log(res)
Log (res1)
Log(musica)
play = sonido.Play(load,1,1,1,2,2)
Else
Return
End If
End Sub