I’m very new also with fmod
I load up a sample like so,
m_Sample = FSOUND_Sample_Load(FSOUND_FREE, fileName.c_str(), mode, 0, 0);
and I play it like so…
m_Channel = FSOUND_PlaySound(FSOUND_FREE, m_Sample);
What I noticed that m_Channel is getting bigger and bigger it starts around 4096 and then grows and grows.
I was expecting this to just loop around 4096+32(max channels)
Or should I be checking somewhere when a sample is finished and do something???
Also is there a good example of how to create a soundmanager somewhere(c++)?
As I’m sure this has been done a lot of times before..
- tekjunkie asked 12 years ago
[quote="brett":k6tvzkcy]fmod channels have reference counting.
Just forget what the handles contain, and store them, but don’t try to parse them for information, there is no point.[/quote:k6tvzkcy]
I should store them!
Do I need to do something with them like release them or something?
[quote="brett":3bw3hcv6]you dont need to store them, you just might want to use the return value to pass to FSOUND_SetVolume and all of the other channel based functions, or even FSOUND_StopSound.[/quote:3bw3hcv6]
The Idea is I should keep an arrary[MAX_CHannels] with these values in?
As the way I working now will cause problems I think.
I do a load_sample and store it is m_sample
and then I do a play_sample(ID);
ID = reference to the sample
If I do a play_sample(ID) again.
Now I have the same sample playing twice.
I try then to set the volume and this is a problem
I only know the sample reference ID.
I think I need to rethink how this works.
Please login first to submit.