Try my new website:
www.urcho.com
- the new SIMPLE social network
Sign up
|
284
members |
114
snippets
Search for:
ALL
POPULAR
File Controls
Multiplayer Code
2D Effects
3D Effects
Oldskool demos
Basic Functions
Maths/Physics
Sound
Tutorials
Misc
Username:
Password:
Sign up
Determine length of an audio sample in seconds by Perturbatio
[
back
]
Author:
Archive
| Viewed:
497
times | Language:
BlitzMax
| Category:
Sound
SuperStrict Local sample:TAudioSample = LoadAudioSample("battle.ogg") Local length:Float = getSampleLength(sample) Print "Length in seconds: " + length Print "Length: " + Int(Floor(length/60))+"m "+Int(length Mod 60)+"s" Function getSampleLength:Float(sample:TAudioSample) Return Float( (sample.length / Float( (sample.hertz * 60) ) ) * 60) End Function
Author Comments:
Determine length of an audio sample in seconds (tested with OGG files, but it should be the same for any file)
Login or
create an account
to comment on this snippet