Older Version
Newer Version
BillW
May 25, 2006
- "The bug was in a local version I was running"
Sometimes it is useful to know the length of a wave file without having to manually check it. Since LB has no native function for determining the length of a wave file, it is useful to have a custom function for this purpose. [[code]] FUNCTION WaveLength(wave$) if wave$ = "" then exit function starttime = time$("ms") playwave wave$, sync endtime = time$("ms") WaveLength = endtime - starttime END FUNCTION [[code]] It is important to note that this function will not report the correct time if the date changes while the wave is being played.Also, this doesn't seem to behave right with sounds less than a second in length.