0
0

Hey everyone,

Currently I am attempting to get an FMOD event to play through Unity3 using the plugin stuff from http://www.squaretangle.com/FMODUnity.html
On the site it says that the plugin works with FMOD designer 4.24 and 4.26, however my audio colab is using 4.36 and I cannot find a 4.26 version anyways.
The examples provided on the site both work fine and I can get the regular Ex playbacks with my audio to play correctly but the events will not work.

When I attempt to run the game it appears to have a problem with the line "result = evensystem.load("duplication.fev");" and tells me it is an invalid file type or unsupported audio file and then I receive a null ref when I attempt to load the event. I know that the file exists in the proper location and that my paths to the files are correct so I can only assume that the error is caused due to the fev was created using a newer version of fmod and I don’t know what else would be the problem.

Has anyone had any success implementing fmod’s events with unity3 recently?

Here is the code that I am using to try and call the event:
[code:25wg4r2f]
using UnityEngine;
using System;
using System.Collections;

public class DuplicationEvent : MonoBehaviour
{

private FMOD.EventSystem eventsystem = null;
private FMOD.EventGroup eventgroup = null;
private FMOD.EventCategory mastercategory = null;
private FMOD.Event environment_BGs = null;
private FMOD.EventParameter level_progression = null;

float rangemin, rangemax, rangecurrent;
public FMOD.RESULT result;


// Use this for initialization
void Start()
{
    result = FMOD.Event_Factory.EventSystem_Create(ref eventsystem);
    ERRCHECK(result);

    result = eventsystem.init(64, FMOD.INITFLAG.NORMAL, (IntPtr)null, FMOD.EVENT_INIT.NORMAL);
    ERRCHECK(result);
    if (result == FMOD.RESULT.OK)
    {
        Debug.Log("FMOD init! " + result);
    }

    result = eventsystem.setMediaPath("Assets/Duplication_Build_AUG25/");
    ERRCHECK(result);

    result = eventsystem.load("duplication.fev"); //.fev file output from FMOD Designer
    ERRCHECK(result);

    result = eventsystem.getCategory("master", ref mastercategory);
    ERRCHECK(result);

    result = eventsystem.getGroup("Duplication/Envrionments", false, ref eventgroup);
    ERRCHECK(result);

    result = eventgroup.getEvent("environment_BGs", FMOD.EVENT_MODE.DEFAULT, ref environment_BGs);
    //result = eventgroup.getEvent("environment_BGs", FMOD.EVENT_MODE.USERDSP, ref environment_BGs);
    ERRCHECK(result);

    result = environment_BGs.getParameter("level_progression", ref level_progression); //paramter defined in FMOD Designer
    ERRCHECK(result);

    result = level_progression.getRange(ref rangemin, ref rangemax);
    ERRCHECK(result);

    result = level_progression.setValue(0.0f);
    ERRCHECK(result);

    result = environment_BGs.start();
    ERRCHECK(result);
}

// Update is called once per frame
void Update()
{

}

void OnDisable()
{
    Shutdown();
}

void Shutdown()
{
    //cleanup routine here  
    FMOD.RESULT result;
    if (eventgroup != null)
    {
        result = eventgroup.freeEventData();
        ERRCHECK(result);
    }
    if (eventsystem != null)
    {
        result = eventsystem.release();
        ERRCHECK(result);
    }
}
//FMOD Error checking from return codes
void ERRCHECK(FMOD.RESULT result)
{
    if (result != FMOD.RESULT.OK)
    {
        Debug.Log("FMOD error! " + result + " - " + FMOD.Error.String(result));
    }
}

}

[/code:25wg4r2f]

  • You must to post comments
0
0

Hi boneyard24,

I’m not sure if you’re aware but the guys at Unity are currently working on integrating FMOD Designer for their upcoming 4.5 release. If you can’t wait for that and you’re keen to get going right away, then I would reccomend updating the dll files as well. So make sure that you get the same version of fmodex.dll and fmod_event.dll that match the FMOD Designer version you are using. We try to maintain some level of backward/forward compatibility with our file versions but 4.26 is over 2 years old. If you want to access old versions of FMOD you can find them in the link at the bottom of each section in the download page where it says: "To search for previous versions of FMOD Ex click here."

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.