EvilTurtleProductions Posted July 17, 2022 Share Posted July 17, 2022 I'm playing with the OpenAL-soft EFX library, already compiled the game with the latest version of OpenAL-soft and it all seems to work well so far. To make effects work I need to configure the OpenAL source to send the audio signal to the EFX aux, but I have no clue how to fetch the ID of the source? Basically like this: Source* mysource; ALuint uiSource = mysource->OpenALID; alSource3i(uiSource, AL_AUXILIARY_SEND_FILTER, effectslot, 0, NULL); @Joshis this in any way possible? I see no (exposed) member or method in the various audio-related classes for this. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 17, 2022 Share Posted July 17, 2022 It's very possible, but why are you doing this? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
EvilTurtleProductions Posted July 17, 2022 Author Share Posted July 17, 2022 1 hour ago, Josh said: It's very possible, but why are you doing this? Experimentation mostly at the moment to see what's possible, what the performance of OpenAL EFX is etc. I want to implement some dynamic sound effects in a future update for Disinfection. So where do I fetch that ID? Quote Link to comment Share on other sites More sharing options...
Josh Posted July 18, 2022 Share Posted July 18, 2022 I sent you some code. I would be extremely wary of importing a replacement version of OpenAL when it's already been compiled into the engine. You may have random memory overwrites causing untraceable crashes, or who knows what else. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
EvilTurtleProductions Posted July 18, 2022 Author Share Posted July 18, 2022 Yeah I'm a little wary of it for those reasons. Still, it allows me to experiment with things until the OpenAL-soft update for LW hits. Have I mentioned I can't wait for that LeadWerks update haha I'll have a gander at the code today, thanks Quote Link to comment Share on other sites More sharing options...
Josh Posted July 18, 2022 Share Posted July 18, 2022 Something to look for is that a Leadwerks source does not have a 1:1 relationship with an OpenAL source. The AL source is dynamically assigned depending on distance from the listener. The Channel is where the alsource is stored. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
EvilTurtleProductions Posted July 18, 2022 Author Share Posted July 18, 2022 2 hours ago, Josh said: Something to look for is that a Leadwerks source does not have a 1:1 relationship with an OpenAL source. The AL source is dynamically assigned depending on distance from the listener. The Channel is where the alsource is stored. Yeah I noticed this looking at the code you send me. I was under the wrong impression that the LW source contain the AL source too. This also explains why I had issues with my custom sound manager. Learning so much today Quote Link to comment Share on other sites More sharing options...
Josh Posted July 19, 2022 Share Posted July 19, 2022 I actually asked about the design of this in OpenAL-soft, and it looks like we can do a 1:1 relationship in Ultra: https://github.com/kcat/openal-soft/issues/736 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
EvilTurtleProductions Posted July 19, 2022 Author Share Posted July 19, 2022 Yeah, from what I understood OpenAL-soft does software mixing, i.e. uses actual software DSP to mix all playing sources together into one final output. Much like an actual DAW does. With how powerful CPU's are nowadays (counting the past 5 years) you can easily have something like 100+ playing sources in a game, I'd say based on my experience with programming DSP & DAW plugins. Of course it also depends on how heavy the game already is CPU-wise, might be more or less The old OpenAL actually uses the (rather limited) hardware of your soundcard, which from what I've read & observed often boils down to 16 to 64 maximum sources playing until things go awry (usually with a crash caused by OpenAL), even if OpenAL reports something like 255 as the max. Hardware mixing has been outdated for so long now. Quote Link to comment Share on other sites More sharing options...
EvilTurtleProductions Posted July 30, 2022 Author Share Posted July 30, 2022 Okay, I've experimented a bit with OpenAL EFX, but it doesn't work so well on old OpenAL. I think I'll wait for the LeadWerks update to OpenAL-soft, so I can do things a bit more proper haha For now I've implemented a very basic "dynamic" sound system which just uses two versions of the same sound, one muffled and with reverb and the other without those effects. This works well enough for now Definitely going to look into a proper EFX implementation when the time comes though, I just love DSP stuff haha, plus it might help others too. Quote Link to comment Share on other sites More sharing options...
reepblue Posted July 31, 2022 Share Posted July 31, 2022 6 hours ago, EvilTurtleProductions said: Okay, I've experimented a bit with OpenAL EFX, but it doesn't work so well on old OpenAL. I think I'll wait for the LeadWerks update to OpenAL-soft, so I can do things a bit more proper haha You're probably going to be waiting for a while. I still recommend FMOD Studio and if you want, you can integrate Steam Audio on top of it. Although the code is a bit outdated, you can follow it for a basic implementation. Leadwerks + FMOD Studio - reepblue's Blog - Ultra Engine Community - Best game engine for VR optimized for fastest virtual reality performance Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.