0
0

When using either createSound or createStream I continually get the ERR_INVALID_PARAM result back and it isn’t obvious to me what the issue is.

[code:1khn6lcc]
RESULT result = fmodSys.createSound("sound.wav", MODE.DEFAULT, ref sound);
[/code:1khn6lcc]

Both variables ‘sound’ and ‘fmodSys’ are instance variables.
The application is being written with XNA Game Studio Express 1.0

Any help would be appreciated as I feel as if I’m missing something obscenely obvious.[/code]

  • You must to post comments
0
0

You should probably supply a complete path to sound.wav since it’s hard to predict what the current directory will be at runtime (remember to prefix the string with an at symbol ("@") before the first double-quote if you’re using C# so that you don’t have to double the backslashes in the path. In Microsoft Visual Studio, the current directory will probably be the debug or release folder where your application is compiled and not the folder where all your source files are.

  • You must to post comments
0
0

I tried both relative and absolute paths to the audio file and still receive the invalid param error. Also, if the audio path was the issue, shouldn’t it return a file not found error, not invalid param?

I threw all my code into a single class to test things out and I’m still running into the same issue.

[code:106wvrce]
static void Main(string[] args)
{
FMOD.System sys = new FMOD.System();
sys.init(100, FMOD.INITFLAG.NORMAL, System.IntPtr.Zero);

        FMOD.Sound sound = null;
        FMOD.RESULT result = sys.createSound(@"F:\Programming\Visual Studio Projects\fmodtest\ConsoleApplication1\ConsoleApplication1\bin\Debug\gamesound.wav", FMOD.MODE.DEFAULT, ref sound);

        if (result != FMOD.RESULT.OK)
        {
            throw new ApplicationException("Error when loading sound:" + result + "-" + FMOD.Error.String(result));
        }
        else
            Console.WriteLine("Sound Loaded");

        FMOD.Channel channel = null;
        result = sys.playSound(FMOD.CHANNELINDEX.FREE, sound, false, ref channel);

        if (result != FMOD.RESULT.OK)
        {
            throw new ApplicationException("Error when playing sound: " + result + "-" + FMOD.Error.String(result));
        }
        else
            Console.WriteLine("Sound Playing");
    }

[/code:106wvrce]

The exception is still being thrown after calling createSound()[/code]

  • You must to post comments
0
0

Perhaps the wav has a strange encoding not supported by FMOD — it might be worth trying to load one of the sample sounds delivered with the API package.

Also, you should maybe check that your sys.init call succeeded.

  • You must to post comments
0
0

Thank you. You were correct about the sys.init call. I failed to write this line before it:
[code:2taqb8fh]
FMOD.Factory.System_Create(ref sys);
[/code:2taqb8fh][/code]

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.