Sub WebView1_OverrideUrl (Url As String) As Boolean
Dim SU As StringUtils
Dim StrData As String
Dim buffer () As Byte
Dim out As OutputStream
MediaPlayer1.Initialize 'Set up media player
StrData = Url.Replace ("data: audio / midi,", "") 'Strip off the beginning bit
StrData = SU.DecodeUrl (StrData, "ISO-8859-1") 'Decode the url
buffer = StrData.GetBytes ("ISO-8859-1") 'Change to byte array
'Save the file to temp.mid
out = File.OpenOutput (File.DirRootExternal & "/ Download", "temp.mp3", False)
out.WriteBytes (buffer, 0, buffer.Length)
out.Close
'Play the file
MediaPlayer1.Load (File.DirRootExternal & "/ Download", "temp.mp3")
MediaPlayer1.Play
Return True
End Sub