Original Author Paul Laughton, 2011
Page 186
De Re BASIC!
By default, objects hidden with Gr.hide are not included in the returned array. To get all objects,
including hidden objects, set the optional keep_all_objects flag to true (any non-zero value).
Audio Interface
Introduction
The Audio Interface
BASIC! uses the Android Media Player interface for playing music files. This interface is not the most
stable part of Android. It sometimes gets confused about what it is doing. This can lead to random
"Forced Close" events. While these events are rare, they do occur.
Audio File Types
The file types you can play depend on your device and the version of Android it runs. For a current list
check the
. Here is a partial summary:
Audio File Type
Played by Android Version
AAC AMR MIDI MP3 OGG WAV WMA
all
FLAC
3.1+
AAC-ELD
4.1+
MKV
5.0+
Commands
Audio files must be loaded into the Audio File Table (AFT) before they can be played. Each audio file in
the AFT has a unique index which is returned by the audio.load command.
Audio.load <aft_nvar>, <filename_sexp>
Loads a music file or internet stream into the Audio File Table. The AFT index is returned in <aft_nvar>. If
the file or stream can't be loaded, the <aft_nvar> is set to 0. Your program should test the AFT index to
find out if the audio was loaded. If the AFT index is 0, you can call the GETERROR$() function to get
information about the error. If you use index 0 in another Audio command you will get a run-time error.
To load a music file, specify an optional path and a filename. For example:
"Blue Danube Waltz.mp3" would access "<pref base drive>/rfo-basic/data/Blue Danube Waltz.mp3".
"../../Music/Blue Danube Waltz.mp3" would access "<pref base drive>/Music/Blue Danube Waltz.mp3".
To load an internet stream, specify a full URL.
Audio.play <aft_nexp>
Selects the file from the Audio File Table pointed to by <aft_nexp> and begins to play it. There must not
be an audio file already playing when this command is executed. If there is a file playing, execute
audio.stop first.