hi, i have a strange behaviour when playing sounds in panda: most of my sounds are not played to the end, they get cut off.
The sound files that are cut off are edited with audacity and then exported (wav and mp3), whereas those that came directly from our recording studio are playing fine (i don’t know which software they use).
when i use a SoundInterval, the interval keeps going for the original length of the file, it just mutes at some point (near the end).
Have you tried changing the sampling rate? I remember once exposing a bug in OpenAL under OSX when trying to play 22KHz Oggs. (The libvobris wrapper code was making some assumptions about proper up-sampling.)
Yeah, as long as you link in all of the vorbis stuff, including the OpenAL wrappers.
I haven’t built OpenAL from scratch in ages, though. I haven’t yet started work with sound in my game, so no idea how OpenAL behaves these days. I only remember real problems cropping up with OpenAL when porting my past games from Windows to OSX. There were slight differences in how the library behaved between OSes.
Have you checked to see what kind of encoding format your WAV files are using? Try saving them as pure standard PCM instead of using any of the compression schemes. This would demonstrate if the problem is with the actual sound-playing, or with the decoding parts.
Although you really don’t want to ship mp3 files with your game if you don’t want some angry lawyers with pitchforks at your doorstep, this is indeed a bug which I’ve seen before - a workaround is to change the sampling rate.
Please report this bug to the panda3d bugtracker at launchpad so I can move it upstream to ffmpeg.
i did a bit more testing on this and found out that it has to do with the length (or more precise the uncompressed size) of the sound files.
i switched on debug output for audio and noticed that the shorter soundfiles got loaded completely before they where played, whereas the longer files where streamed. the problem here could be that the size threshold at which sounds are streamed may be too high, or put another way, the buffer for short sounds may be too small.
all sounds between ~5 - 8 seconds (44.1KHz, 16Bit, Mono) are cut off at the end and they are not streamed, all longer sounds play fine and from the debug output i could see that they are streamed.
so the question is, how can i change the size threshold for buffered sounds or increase the buffer size?
I am having the same issue on Ubuntu Jaunty. I haven’t tried it on Windows, yet. I’ve registered on Launchpad and if there’s any information I can submit to the bug report that thbusch added, please let me know.