Sub SaveWavFile
Dim raf As RandomAccessFile
Msgbox("Saving to sd card","")
raf.Initialize(File.DirDefaultExternal, "packet.wav", False)' open the file which will end up in I:\Android\data\test.test.test\files (test.test.test is my program)
raf.WriteBytes(audiofile,0,30000, 0) ' write bytes. Is 32768 the max size as this is an integer variable
raf.close
End Sub