0
0

Hello…
I’m french so please excuse my english…

In fact im experimenting some problems using fmod… i’m on linux… mandrake 9.1 the sound doesnt work everytime…. there is some time when there is no sound… It happens that i retry lot of times and it works after that… The same program using fmod works with sounds sometimes and nothing the major part of the time… i would like to know if there is an issue about this… this is not about the code of the program but fmod i guess or else a bad initializing of the sound card with fmod i don’t know how…

I thank you to answer me …

  • You must to post comments
0
0

Try with the Alsa driver as they seems to be more robust.

  • You must to post comments
0
0

Don’t know if it’s still the case but Mandrake between 6.0 and 8.2 was rather buggy- a good way to improve it is/was to build your own kernel from the standard kernel.org sources (with the low-latency patches for audio).
I’m using Slackware these days and crashes have become a thing of the past… Slackware doesn’t have the wizards though.

  • You must to post comments
0
0

I seem to have a similar problem, in that my code below will successfully play the same sound every other time – i.e it plays it, then won’t, then it plays it, then it won’t.

If I set a breakpoint in the code, the channel and stream values are always the same, as is the volume level.

I can’t see how the code itself can be doing this, so does anyone have any bright ideas?

Oh, and no comments about my code layout – it has tabs in it honest, they just didn’t copy and paste into the reply window :)

I’m developing/running this on Windows Server 2003, and developing in Visual C 6

void DoOneSound( char* name )
{
int channel = 0;
int volume = 0;
int soundIndex = 0;
int idx = 0;

if( soundActive == 0 )
    return;

// name is made up of the following:
// 3 bytes for the volume
// the rest is the filename

soundIndex = FindSoundIndex( &name[3] );

// if we found the sound
if( soundIndex != -1 )
{
    // open the stream if required
    if( sounds[soundIndex].stream == NULL )
        sounds[soundIndex].stream = FSOUND_Stream_Open( sounds[soundIndex].fileName, FSOUND_NORMAL | FSOUND_2D | FSOUND_MPEGACCURATE | FSOUND_NONBLOCKING, 0, 0);

    // see if the stream is properly open
    if (FSOUND_Stream_GetOpenState( sounds[soundIndex].stream ) != 0)
    {
        while (FSOUND_Stream_GetOpenState( sounds[soundIndex].stream ) == -2)
        {
            Sleep(20);
        }
    }

    // set the mode for playing the stream
    FSOUND_Stream_SetMode( sounds[soundIndex].stream, FSOUND_LOOP_OFF);

    // actually play the sound on either our old channel, or a new channel if its the first time
    if( sounds[soundIndex].channel == NULL )
        sounds[soundIndex].channel = FSOUND_Stream_Play( FSOUND_FREE, sounds[soundIndex].stream );
    else
        FSOUND_Stream_Play( sounds[soundIndex].channel, sounds[soundIndex].stream );

    // set the volume
    volume = atoi( name );
    FSOUND_SetVolume( sounds[soundIndex].channel, volume );
}

}

  • You must to post comments
0
0

That did not make any difference, unfortunately, but my program when running does not seem to chew up extra memory when it is playing.

The sounds play absolutely fine if I always assign a new channel, but I don’t know if that is a bad way to do it. How do I free up a channel?, or does the fmod system do that for me? Do I run the risk of having a big memory leak if I don’t free up channels after using them?

I assume that if I need to free up the channels myself, how do I know when a sound has finished playing so I can free up the channel?

BTW, you asked why I used non blocking, then blocking code. The answer is, don’t know. I nicked that code from the fmod sample program.

Finally, I think the fmod library is absolutely fantastic, and very very versatile.

  • You must to post comments
0
0

Brett,

Thanks for that. That makes sense.

PHB.

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.