|
|
|
|
@ -104,7 +104,9 @@ int SoundSample::GetLength()
|
|
|
|
|
bytePerSample = 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return chunk->alen * 1000 / (frequency * channels * bytePerSample); |
|
|
|
|
Uint64 ms = 1000; // milliseconds, 64bit to avoid overflow when multiplied by alen
|
|
|
|
|
Uint32 bps = frequency * channels * bytePerSample; // bytes per second
|
|
|
|
|
return (Uint32)(chunk->alen * ms / bps); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
} // namespace dvl
|
|
|
|
|
|