Sound Duration
Posted: Wed Mar 18, 2009 11:55 am
a command like GetSoundDuration(#Sound) that returns to duration of a sound in ms would be nice.
BTW: Does anyone have a good workaround for that? For wav you can do somthing like this:
; *Pointer is a Pointer to the wav file in memory
; FileSize if the Size of the wav file in memory
Size.l = FileSize - 44
Channels.l = PeekW(*Pointer+22)
SampleRate.l = PeekL(*Pointer+24)
ByteRate.l = PeekL(*Pointer+28)
Valuef1.f = Size
Valuef2.f = ByteRate
TrackLenght.f = Valuef1/Valuef2 * 1000
TrackLenght.l = Int(TrackLenght)
but it's not very clean and it does noch work for OGG or FLAG
BTW: Does anyone have a good workaround for that? For wav you can do somthing like this:
; *Pointer is a Pointer to the wav file in memory
; FileSize if the Size of the wav file in memory
Size.l = FileSize - 44
Channels.l = PeekW(*Pointer+22)
SampleRate.l = PeekL(*Pointer+24)
ByteRate.l = PeekL(*Pointer+28)
Valuef1.f = Size
Valuef2.f = ByteRate
TrackLenght.f = Valuef1/Valuef2 * 1000
TrackLenght.l = Int(TrackLenght)
but it's not very clean and it does noch work for OGG or FLAG