audioLength()
Purpose
Find the length of an audio sample
Description
Get the audio length for given handle
Syntax
length = audioLength( handle )
Arguments
handle handle of the audio sample from loadaudio
length length of the audio sample
Example
handle = loadAudio( "David Silvera/jingle_level_complete_03" )
length = audioLength( handle )
volume = 0.5
pan = 0.5
speed = 1
playAudio( 0, handle, volume, pan, speed, 0 )
start = time()
elapsed = 0
// wait for audio to finish
while elapsed < length loop
clear()
now = time()
elapsed = now - start
printAt( 0, 0, length, " ", elapsed )
update()
repeat
printAt( 0, 1, "Finished" )
update()
sleep( 3 )
Associated Commands
getChannelStatus(), loadAudio(), note2Freq(), playAudio(), playNote(), setClipper(), setFilter(), setPan(), setVolume(), startChannel(), stopChannel()