0
0

A friend is testing an app I’ve written using C# and FMODEx. Basically any time he tries to play a 24-bit sound from a file, it silently fails, no errors are reported.

I’m initialising FMOD like this as per the C# examples:

[code:2nluck1a] private void ERRCHECK(FMOD.RESULT result)
{
if (result != FMOD.RESULT.OK)
{
MessageBox.Show("FMOD error! " + result + " – " + FMOD.Error.String(result));
Environment.Exit(-1);
}
}
.
.
.

    result = FMOD.Factory.System_Create(ref systemFMOD);
    ERRCHECK(result);

    result = systemFMOD.getVersion(ref version);
    ERRCHECK(result);
    if (version < FMOD.VERSION.number)
    {
        MessageBox.Show("Error!  You are using an old version of FMOD " + version.ToString("X") + ".  This program requires " + FMOD.VERSION.number.ToString("X") + ".");
        Application.Exit();
    }

    result = systemFMOD.init(32, FMOD.INITFLAG.NORMAL, (IntPtr)null);
    ERRCHECK(result);[/code:2nluck1a]

I’m playing a sound like this:

[code:2nluck1a] FMOD.RESULT result;
if (channel != null)
channel.stop();
result = systemFMOD.createSound(sampleName, FMOD.MODE.HARDWARE, ref sound);
ERRCHECK(result);
result = sound.setMode(FMOD.MODE.LOOP_OFF);
ERRCHECK(result);
result = systemFMOD.playSound(FMOD.CHANNELINDEX.FREE, sound, false, ref channel);
ERRCHECK(result);

            if (channel != null)
                channel.setCallback(FMOD.CHANNEL_CALLBACKTYPE.END, new FMOD.CHANNEL_CALLBACK(this.soundEndedCallback), 0);[/code:2nluck1a]

He can play the same 24-bit audio files in WinAmp or other audio players without a problem. Any ideas?

  • You must to post comments
0
0

Update:

I tried changing it to create the sound using software (FMOD.MODE.SOFTWARE) and that fixed the problem. I’m not sure if it was a driver issue or not but in any case this is a pretty simple app that only plays one sound at a time so I’m not too concerned about the performance hit.

Carry on! :)

  • You must to post comments
0
0

there is no performance hit using software, in fact it may be a performance increase.
It is probably a driver issue, i know when you start using non 8bit/16bit/mono/stereo sounds in directsound it can do some random things, like bluescreen or cause white noise, where on another sound card it works fine.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.