FMOD and Panda Help

Hello, I’m new to Panda, and so far I love it. I’m a sound designer, so the fact that you can use FMOD with Panda was a huge selling point. I’ve looked over the documentation, and done some searches (desperately trying to not post stupid questions, I promise), and the only thing I found was modifying the Config.prc file (which I did). So, first question: do I need to rebuild Panda with this config, or does it just set it and you’re good to go?

Second question: After setting this, how do you actually use it? Do all of your audio functions automatically look for FMOD, or are there functions you need to use specifically for it? If you could just point me to any kind of documentation for it, I would reeeeally appreciate it.

I’ve also seen that there are things like PyFmod and PyOpenal, which I’m not completely against, but it seems like it defeats the purpose of using FMOD… or maybe not, I don’t know.

I should just note that my biggest reason for wanting to use FMOD is reverb; I’d really like to have changing audio for different environments.

You don’t need to recompile or so after you edited the Config.prc file, the changes will instantly have effect on the next time you use Panda3D.

How to use it is explained in this section of the manual:
Use the “next” buttons on the top to navigate to the next page.

I believe to get reverb you’d have to play with DSP effects or so, I would have no idea how. There’s probably already something on the forums.

Thanks, that’s good to know. The problem with DSP is that that page of the manual is blank. The configurefilters function is undocumented, and the threads dealing with these things are so old that FMOD filters were not yet implemented, and audiosound didn’t work at all, and it doesn’t seem like there are any working examples of these features anywhere. I was hoping to find out if these features were implemented at some point, and if so, if there was a working example of them. Thanks. :slight_smile:

Also: the functions in the reference appear to be in C and not Python, which only causes me to be more confused.

For example, the code given for adding reverb:

void FilterProperties::add_reverb(float drymix, float wetmix, float roomsize, float damp, float width);

Is this something you can’t do in Python?

It’s in the API ref so it should be doable in python. You may be having a common misunderstanding of the C++ and python interfaces. Generally the C++ function names have an underscore and can be used in python by removing the underscore and camel casing it.

I may be new to Python, but in every reference I could find, I never saw Python use the “void” keyword for a function, use a double colon to declare a class, or require semicolon to define the end of the statement.

And so my only guess as to translating this would be:

FilterProperties.add_reverb(float drymix, float wetmix, float roomsize, float damp, float width)

Which I’ll have to try next time I can, but it seems to me that the code is hinting that it’s something you would have to do in C and import it into your Python code.

No, this is just the C++ function definition, since also the python wrappers are in C++ written.
You’d just have to translate the function prototype to Python and just use it – the python wrappers make sure the actual C++ function gets called.
It’s confusing, I know, but I see no other way.

Translated it would be something like:

from pandac.PandaModules import FilterProperties
fp = FilterProperties()
fp.addReverb(drymix, wetmix, roomsize, damp, width)

Note that add_reverb in C++ becomes addReverb in Python!

Ah, thank you! That makes the API reference so much more useful, haha. :slight_smile: Now I can’t wait to get to work on this!

Sorry, I just have one last question (honestly!).

After you add the filter, how do you assign it to a sound? Just adding the filter and reverb doesn’t do it, and I couldn’t find any sound playing function that uses a filter argument. It seems like there’s one last tiny missing piece to the puzzle, and one command will let me start really doing some fun things!

Hmm, what about configureFilters(filterProps) ? … ureFilters


After looking through that command, and searching through the other threads for it, I found one that gave me this:


I added that line to the end of the DSP commands, and it works!

Thank you so much for the help. I’ll probably be writing a little tutorial on sound things if I figure out enough to try and give back a little to the community. :slight_smile: