-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
leadin sound not played for looping sound shaders #291
Comments
The weird thing is, the leadin seems to work with (some?) shaders that come with the game, like |
More specifically, this seems to work if the main (non leadin-) sound is an .ogg
no matter which leadin I use, apparently it's only played if the main/loop sound is an ogg.. I guess I'll have to do some proper debugging |
Thanks! That's already a good investigation. I hope you can find the problem. |
If i'm reading this correctly, it is detecting one file format, but not back on the other like it should. I have had this problem with vanilla D3 years and years ago. |
If the main sound in a shader was a .wav (soundShader->entries[0]->hardwareBuffer == true), only that sound was played (and looped with AL_LOOPING), even if a leadin was configured. If the main sound was an .ogg it worked. Not it should always work.
(I've transferred this issue to the dhewm3 repository because it's a bug in the engine, not in the SDK-part of the code) I'm pretty sure this issue already existed in original Doom3, at least when using OpenAL (dhewm3 only supports OpenAL for sound output). The problem is: if ( ( !looping && chan->leadinSample->hardwareBuffer ) || ( looping && chan->soundShader->entries[0]->hardwareBuffer ) ) {
// handle uncompressed (non streaming) single shot and looping sounds
if ( chan->triggered ) {
alSourcei( chan->openalSource, AL_BUFFER, looping ? chan->soundShader->entries[0]->openalBuffer : chan->leadinSample->openalBuffer );
}
} else {
// ...
Anyway, I think I have a fix in the following branch: https://github.com/dhewm/dhewm3/tree/fix-looping-sound-leadin |
@DanielGibson Thanks a lot for this! I'll test it in the next days! |
If the main sound in a shader was a .wav (soundShader->entries[0]->hardwareBuffer == true), only that sound was played (and looped with AL_LOOPING), even if a leadin was configured. If the main sound was an .ogg it worked. Not it should always work.
I created a fresh (Win32) build with this fix (and some more) included, based on the openal-fixes branch): dhewm3-oal-fixes.zip |
Your fix seems to have solved the issue. Thanks! |
I played some more maps and I didn't find any issue with your fixes. :D |
Awesome, thanks for testing! |
This fix in master, but I have another OpenAL related fix that needs testing, see #296 There you can also get Windows binaries for testing that include all the OpenAL fixes of the build linked above, the aforementioned timing fix and latest changes from master. |
If the main sound in a shader was a .wav (soundShader->entries[0]->hardwareBuffer == true), only that sound was played (and looped with AL_LOOPING), even if a leadin was configured. If the main sound was an .ogg it worked. Not it should always work.
Given the following shader, the leadin sound is played in vanilla D3, but not in dhewm.
Steps to reproduce:
testSound loop_with_leadin
The text was updated successfully, but these errors were encountered: