Original Author Paul Laughton, 2011
Page 188
De Re BASIC!
Audio.position.seek <nexp>
Moves the playing position of the currently playing file to <nexp> expressed in milliseconds.
Audio.length <length_nvar>, <aft_nexp>
Returns the total length of the file in the Audio File Table pointed to by <aft_nexp>. The length in
milliseconds will be returned in <length_nvar>.
Audio.release <aft_nexp>
Releases the resources used by the file in the Audio File Table pointed to by <aft_nexp>. The file must
not be currently playing. The specified file will no longer be able to be played.
Audio.isdone <lvar>
If the current playing file is still playing then <lvar> will be set to zero otherwise it will be set to one. This
can be used to determine when to start playing the next file in a play list.
Audio.play f[x]
Do
Audio.isdone isdone
Pause 1000
Until isdone
Audio.record.start <fn_svar>
Start audio recording using the microphone as the audio source. The recording will be saved to the
specified file. The file must have the extension .3GP. Recording will continue until the audio.record.stop
command is issued.
Audio.record.stop
Stops the previously started audio recording.
SoundPool
Introduction
A SoundPool is a collection of short sound bites that are preloaded and ready for instantaneous play.
SoundPool sound bites can be played while other sounds are playing, either while other sound bites are
playing or over a currently playing sound file being played my means of Audio.play. In a game, the
Audio.play file would be the background music while the SoundPool sound bites would be the game
sounds (Bang, Pow, Screech, etc).
A SoundPool is opened using the SoundPool.open command. After the SoundPool is opened, sound
bites will be loaded into memory from files using the SoundPool.load command. Loaded sound bites can
be played over and over again using the SoundPool.play command.