0
0

Hi!

I am currently implementing a simple sound engine in C#.

I am having a problem; after 20-or-so calls to system.playSound(…), I get an ERR_OUTPUT_DRIVERCALL error returned.

I can fix this by having a small number of channles when I call System::init(), but then I get the clipping artifacts associated with a small channel acount.

Here is the code I suppose is relevant for debugging:

If I use this code I will get the error.

Initialization:
[code:2tb4zip4] uint version = 0;
RESULT result;

        result = Factory.System_Create(ref system);
        ERRCHECK(result);

        result = system.getVersion(ref version);
        ERRCHECK(result);
        if (version < 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 = system.init(24, INITFLAG.NORMAL, (IntPtr)null);
        ERRCHECK(result);

[/code:2tb4zip4]

To load sounds:
[code:2tb4zip4]
public static void LoadSound(string name)
{
RESULT result;

        Sound sound = null;
        result = system.createSound(path + "\\" + name, MODE.DEFAULT, ref sound);
        ERRCHECK(result);

        soundDictionary.Add(name, sound);
    }

[/code:2tb4zip4]

To play sounds:
[code:2tb4zip4]
public static void PlaySound(string name)
{
if (!soundOn) {
return;
}

        Sound sound;
        soundDictionary.TryGetValue(name, out sound);
        RESULT result = system.playSound(CHANNELINDEX.REUSE | CHANNELINDEX.FREE, sound, false, ref channel);
        ERRCHECK(result);
    }

[/code:2tb4zip4]

So, I can initialize, but after 20-or-so calls to PlaySound() I get this error

Let me know if you need futher code.

Thanks!

  • You must to post comments
0
0

I didn’t realize one had to call System::update() each frame.

Everything woks now 😉

  • You must to post comments
0
0

So this is a bug? I mean I shouldn’t really need to call System.update()?

If this was the first time someone discoverd this bug, it explains why googling for ERR_OUTPUT_DRIVERCALL didn’t return any results.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.