Can I just check the syntax for random access files?
This is what I have working for media player to play a .wav file off an sd card:
and in the autocomplete it says "Load(Dir as string, Filename as string)"
So I tried the same syntax in random files
the autocomplete looks very similar "Dir as string, File as string"
and it compiles ok, but when running it gives an error "an error has occurred java.io.filenotfoundexception /sdcard/packet.wav
The file does not yet exist as it has been opened for writing.
Do I need to create this file first? If so, is there a method for doing so within the random library (I can't see one) or do I need to do that from another file library?
This is what I have working for media player to play a .wav file off an sd card:
B4X:
Dim MediaPlayer1 As MediaPlayer
MediaPlayer1.Initialize( )
MediaPlayer1.Load("/sdcard", "1200.wav")
and in the autocomplete it says "Load(Dir as string, Filename as string)"
So I tried the same syntax in random files
B4X:
Dim raf As RandomAccessFile
raf.Initialize("/sdcard", "packet.wav", False)' open the file
the autocomplete looks very similar "Dir as string, File as string"
and it compiles ok, but when running it gives an error "an error has occurred java.io.filenotfoundexception /sdcard/packet.wav
The file does not yet exist as it has been opened for writing.
Do I need to create this file first? If so, is there a method for doing so within the random library (I can't see one) or do I need to do that from another file library?