0
0

What am I doing wrong. Last week I put out a new version of our game and over the weekend we still get a lot of crashes in FMOD.
Now I’m almost sure it is not FMOD. I wrote a test program that just played random samples, random streams. Left it playing for the night came back it was fine.
Is there anything I can do to find out what is wrong. I will add extra stuff to the log file, anything I’m pretty much screwed at the moment.

Kind Regards,

jippie

[code:vujenq43]
int Sound::PlaySample(byte volume, byte pan, bool loopSample)
{
if (!SoundManager::IsAudioAvailable())
{
return -1;
}

if (m_Sample != NULL)
{
    FSOUND_Sample_SetMode(m_Sample, loopSample ? FSOUND_LOOP_NORMAL : FSOUND_LOOP_OFF);

    volume = (byte)( ((int)m_SampleVolume * (int)volume) / 255);

// if( -1 != m_Channel )
// {
// LOG(PR_SPECIAL,"[stopped]");
// FSOUND_StopSound(m_Channel);
// }

    if ((volume == 255) && (pan==128))
    {
        // Just play it!
        LOG(PR_SPECIAL,"PS[%s]", m_FileName.c_str());
        m_Channel = FSOUND_PlaySound(FSOUND_FREE, m_Sample);
        LOG(PR_SPECIAL,"[%d]\n", m_Channel);
    }
    else
    {
        // Adjust the volume before playing it
        LOG(PR_SPECIAL,"PSE[%s]", m_FileName.c_str());
        int channel = FSOUND_PlaySoundEx(FSOUND_FREE, m_Sample, NULL, true);
        if( -1 != channel )
        {
            FSOUND_SetVolume(channel, volume);
            FSOUND_SetPan(channel, pan);
            FSOUND_SetPaused(channel, false);
        }
        m_Channel = channel;
        LOG(PR_SPECIAL,"[%d]\n", m_Channel);
    }
}
else
{
    LOG(PR_ERROR,"ERROR: Sample not found!");
    m_Channel = -1;
}
return m_Channel;

}
[/code:vujenq43]

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.