I’m trying to get into FMOD, it’s a fantastic tool and while i’m not a complete noob with C++/C I’m feeling a bit lost on researching up on all the great stuff hiding under the hood.
Is there any recent books or some kind of "course" material I can follow. I know there’s one for education institutions, what about for us normal folk?
Any and all help is greatly appreciated.
- MaestroRage asked 7 years ago
Thank you both kindly! Peter you must get asked this question a lot, those two tidbits cleared up an entire mountains worth of questions! Especially that pointer tip, for the longest while I was wondering what was going on there.
icuurd, thanks for providing some kind of suggested route. I have been at the help file reading all day and beginning to feel a bit more steady on my feet here.
I’ll be here bugging you guys a great long while, thanks ahead of time 😀
- MaestroRage answered 7 years ago
Peter, can a channel have a <valid> 0x00000000 value? Or does it start with 0x00000001, same with sounds, ect.
I must admit, I never paid attention to the result, like many others I assumed, until a while back, that I was dealing with pointers. And I do double check if the sound/channel is NULL…
If you want to use the higher level Designer API, I think a really good starting spot is actually the Designer tool and its docs. I often find that understanding how audio is created and used helps me understand the runtime APIs that support it and how I design my code to interface with said APIs.
- audiodev answered 7 years ago
Hi MaestroRage, welcome to the FMOD forums.
I understand how you feel, learning a new system is always daunting at first. There aren’t any books that i know of, but the installer comes with examples that offer a quite gentle learning curve.
Just as a quick intro, i’ll explain a couple of the features unique to FMOD Ex and FMOD Designer API which is different to other C++ libraries.
Every function will return an FMOD_RESULT, and you must check that it is FMOD_OK (or some other expected result), this is the mechanism FMOD uses to tell you when things go wrong. It’s easy to forget to check the result and then that can lead to difficult to track down bugs.
[b:2iz4ynsg]Handles not pointers[/b:2iz4ynsg]
Many of the objects in FMOD such as an FMOD::Event* or FMOD::Channel* aren’t really pointers to C++ objects. This is not particularly important from the user’s perspective, just don’t be concerned if you have a Channel* pointing to a strange place like 0x00000001.
The reason for doing this is to enable stealing. It is common to want to limit the number instances of a single sound that can be played at the same time. For example, say there is an ambient sound of birds chirping, you don’t want to waste CPU and memory playing 10 of them when 2 or 3 would sound just as good. On the other hand you don’t want to write heaps of code to track how many instances of each sound are playing at the same time.
We have SoundGroup::setMaxAudible to enable you to limit the maximum number of instances of a sound. The consequence of this is that you’re going to have instances which get stolen. So you have a Channel* and you call a function one frame and everything is fine, then the next frame the same function call on the same object returns FMOD_ERR_INVALID_HANDLE because the handle was stolen by a new instance. It is very common for channels to get invalidated from stealing and can be surprising at first.
Open up the help
Read the tutorial part
Start reading the Sound interface and the Channel interface.
These are the most significant classes. You can start from there. You can then easily understand the example projects
Then you can check out the group stuff, then the dsp stuff.
Please login first to submit.