0
0

Based on the recommended initialisation I have translated the below C++

[code:2tf43mn2]FMOD_CAPS caps;
system->getDriverCaps(0, &caps, 0, 0, &speakermode);
if (caps & FMOD_CAPS_HARDWARE_EMULATED)[/code:2tf43mn2]

to C# (As there are no C# examples of the new code)

[code:2tf43mn2]FMOD.CAPS caps = FMOD.CAPS.NONE;
system.getDriverCaps(0, ref caps, ref minfrequency, ref maxfrequency, ref speakermode);
if (caps & FMOD.CAPS.HARDWARE_EMULATED)[/code:2tf43mn2]

but it does not work. In the if statement I get the following compiler error

[code:2tf43mn2]Error 3 Cannot implicitly convert type ‘FMOD.CAPS’ to ‘bool'[/code:2tf43mn2]

What have I done wrong and how can I fix it?

Thanks

  • You must to post comments
0
0

i think you have to cast it to a uint first before you can do a bitwise operation on it.

  • You must to post comments
0
0

I tried casting it to a unit and the compiler now says that it can not convert a uint to a bool so I tried casting it to a bool and the compiler says it can not convert a FMOD.CAPS to a bool and then I tried … well you get the picture. What ever I tied casting it to it complained with a different error message everytime.

  • You must to post comments
0
0

Hi,

You should use:

[code:2khv20jz]
if ((caps & FMOD.CAPS.HARDWARE_EMULATED) == FMOD.CAPS.HARDWARE_EMULATED)
{
...
}
[/code:2khv20jz]

Also, I have put the c# version of the recommended initialisation code into our wiki:

[url:2khv20jz]http://www.fmod.org/wiki/index.php5?title=PC_Configuration_Issues#Recommended_start_sequence[/url:2khv20jz]

  • You must to post comments
0
0

[quote="chenpo":31uiws79]Hi,

You should use:

[code:31uiws79]
if ((caps & FMOD.CAPS.HARDWARE_EMULATED) == FMOD.CAPS.HARDWARE_EMULATED)
{
...
}
[/code:31uiws79]

Also, I have put the c# version of the recommended initialisation code into our wiki:

[url:31uiws79]http://www.fmod.org/wiki/index.php5?title=PC_Configuration_Issues#Recommended_start_sequence[/url:31uiws79][/quote:31uiws79]

That did it. Thanks.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.