0
0

Hello

I am initializing FMOD with 32 channels and playing short samples (1 second) with the following "standard" code:

[code:24rhr7rq]result = system->init(32, FMOD_INIT_NORMAL , NULL);
result = system->playSound(FMOD_CHANNEL_FREE, grid[_sound], false, &channel);[/code:24rhr7rq]

It works as intended, but now I realized that when I have played 32 samples (not at the same time), only one sound can be played at a time. It looks like FMOD_CHANNEL_FREE behaves like an incremental counter and when it hits 32, it stays there, deallocating the last sound while it’s still playing to allocate the new one.

Do I have to remove sounds when they have stopped playing? How? I feel like I am missing something basic

Thanks!

Marc

(BTW: Is there a reference? I looked around but couldn’t find any official docs. Sorry for my googling-incompetence)

  • You must to post comments
0
0

Sounds like you’re using a stream which has the limitation of being able to be played once at a time.
Use FMOD_CREATECOMPRESSEDSAMPLE or FMOD_CREATESAMPLE instead if you want the sound to play more than once at a time.

  • You must to post comments
0
0

I cannot explain the behavior that you’re seeing. Does the same behavior happen on the FMOD samples?

The documentation is a CHM, and is installed along with FMOD. If you’re on Windows, it’ll be on your start menu (on Windows Vista/7, just type in "fmod doc"). Not sure where it is on the other platforms.

  • You must to post comments
0
0

Virtual channels are cheap so there is no need t limit yourself to 32, and normal value for that would be something like 1024. The number of underlying real channels can be set using System::setSoftwareChannels, the default is 32.

Documentation can be found in your FMOD install directory. fmodex.chm is the API reference and there is also a getting start guide for each platform.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.