Hello.
Some days ago, Ryan answered my question on calculating the length of a
SDL_mixer chunk.
I’ve now tested the proposed code and I have strange results: Sometimes the
calculated length is correct, sometimes it differs from the length I found with
audacity.
CSoundEngine::loadSample : Loading sample ‘intro-thunder’ … (Length: 3345 ms,
calculated length: 2430 ms) done
CSoundEngine::loadSample : Loading sample ‘intro-grenade-0’ … (Length: 2253
ms, calculated length: 2253 ms) done
CSoundEngine::loadSample : Loading sample ‘intro-machine_gun-0’ … (Length: 888
ms, calculated length: 888 ms) done
CSoundEngine::loadSample : Loading sample ‘intro-machine_gun-1’ … (Length: 691
ms, calculated length: 501 ms) done
The samples have the format:
$ file intro-*.wav
intro-grenade-0.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8
bit, mono 11025 Hz
intro-machine_gun-0.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM,
16 bit, mono 11025 Hz
intro-machine_gun-1.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8
bit, mono 8000 Hz
intro-thunder.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8
bit, mono 8012 Hz
It seems as if there is a relation to the frequency of the files: Those with
11025 Hz work the other ones not.
You can download the files if probably you need them to help me here:
http://files.mgeek.de/intro-grenade-0.wav
http://files.mgeek.de/intro-machine_gun-0.wav
http://files.mgeek.de/intro-machine_gun-1.wav
http://files.mgeek.de/intro-thunder.wav
Thanks in advance for any help …