ERR_INVALID_PARAM when creating low level sound in Unity

I have begun delving into the low-level API and have so far recreated the net_stream example in Unity and added some DSP effects onto this.

I am now wanting to create a sound to be placed in the world but am getting an ERR_INVALID_PARAM.

Here is the section of code:

string absolutePath = Path.GetFullPath(file);
CREATESOUNDEXINFO exInfo = new CREATESOUNDEXINFO();
result = system.createSound(absolutePath, MODE.CREATESTREAM, ref exInfo, out sound);
print(result);

I have tried using MODE.DEFAULT as well as messing around a little with the exInfo but to no success. I’m thinking it’s something to do with the file path but feel I am missing something.

Oh, and using the same file (full path, not the file name) in the play_sound example gives the same error.

Any help will be greatly appreciated!

Fix: Choose the createSound method that doesn’t take in a CREATESOUNDEXINFO.

Using CREATESOUNDEXINFO is for passing more information to the system when creating a sound. There are certain member variables of the CREATESOUNDEXINFO that need to be set otherwise you will get an ERR_INVALID_PARAM, which means the CREATESOUNDEXINFO you passed in is not valid.

If you do not wish to use or specify a CREATESOUNDEXINFO, you can use the functions that do not take in a CREATESOUNDEXINFO.