I’ve been using FMOD for a short time and I’ve been having some problems. Any advice is appreciated.
1.- I’m using a sound when selecting an option in a menu. When press and hold down a key, the selected option starts to change quickly and the sound is played multiple times. After a while, the sound is no longer heard and some times even the music stops (not often, I supose I only need to prioritize it better). If let go the key and hold down to it again, the sound would only be heard once (the first time). My guess is that I’m running out of channels, but, as the sound is quite short, shouldn’t FMOD get free channels each time some sound stops?
Right now I’m loading the sounds from memory using something similar to this (where sound_error is a function used to check if there has been any problem):
iResult = FMOD_System_CreateSound(ptFSystem, pszPosition, FMOD_SOFTWARE | FMOD_2D | FMOD_CREATESAMPLE | FMOD_OPENMEMORY, ptInfo, psndSound);
I play the sound using something like this:
iResult = FMOD_System_PlaySound(ptFSystem, FMOD_CHANNEL_FREE, sndSound, TRUE, &cnlChannelSounds[iChannel]);
And I update FMOD System in every loop.
2.- When I play a commpresed song from memory, the song loops even when it hasn’t finished. I don’t have this problem when I play a regular sound from memory or when the compressed sound wasn’t created from memory. Right now, the songs are looping at about 1/3 of the length. If I change the size when creating the sound by half, it does seem to play half of what it was playing but if I double it I have problems. The code looks something like this:
iResult = FMOD_System_CreateSound(ptFSystem, pszPosition, FMOD_SOFTWARE |FMOD_2D | FMOD_CREATECOMPRESSEDSAMPLE | FMOD_OPENMEMORY, ptInfo, psndSound);
3.- I’m also having problems when trying to play a song backwards. I’m setting the loop as FMOD_LOOP_BIDI and changing the frequency to -44100. At first the song plays normally. When it reaches the end, it starts playing backwards until it reachs the start a plays forward again. When I print the current the frequency, using getFrequency, it tells that frquency is -44100. So why does it play forward? Also, if i set the frequency inside the main loop, I get some weird results.
By the way, I’m using FMOD 4.04 in Suse 10.1 and gcc version 4.1.0, but I’ve also tested this (and had the same problems) in Windows 2000 and XP using Dev-C++.
Thanks for your help!
- pier_guillen asked 12 years ago
- You must login to post comments