0
0

EDIT 1
Added debug.log for fmodEventInstance.start()
/EDIT 1

I am trying to get a basic step sound to play but when I go into "play mode" all I hear is a static sound for half a second and silence.

This is all the code related to FMOD.
[code:1o4tj6br]using UnityEngine;
using System.Collections;
using System.Xml;
using FMOD.Studio;

public class Movement : MonoBehaviour {
private FMOD_StudioSystem system;
private FMOD.Studio.EventInstance fmodEventInstance;
public FMOD.Studio.Bank fmodBank;
private FMOD.Studio.ParameterInstance fmodParaInst;

bool playing = false;

void Start() {
    //fmodStudioSystem.GetEvent();
    //fmodEmitter = GetComponent<FMOD_StudioEventEmitter>();
    anim = GetComponent<Animator>();
    nav = GetComponent<NavMeshAgent>();
    nav.updateRotation = false;

    //Debug.Log(system.GetEvent("Debug.Log(system.GetEvent(""));"));


    system = FMOD_StudioSystem.instance;
    string fileName = Application.dataPath + "/StreamingAssets/Master Bank.bank";
    system.System.loadBankFile(fileName,LOAD_BANK_FLAGS.NORMAL , out fmodBank);
    FMOD.Studio.Bank bankStrings;
    system.System.loadBankFile(fileName + ".strings",LOAD_BANK_FLAGS.NORMAL, out bankStrings);
    fmodEventInstance = system.GetEvent("event:/Steps");
    fmodEventInstance.getParameter("Steps", out fmodParaInst);        
    Debug.Log("StudioSystem      -> " + system                 + " <-");
    Debug.Log("Bank              -> " + fmodBank           + " <-");
    Debug.Log("EventInstance     -> " + fmodEventInstance  + " <-");
    Debug.Log("ParameterInstance -> " + fmodParaInst       + " <-");
    Debug.Log("Start             -> " fmodEventInstance.start()+ " <-");      
}[/code:1o4tj6br]Debug.Log output[code:1o4tj6br]StudioSystem      ->FMOD_StudioSystem (FMOD_StudioSystem) <-

UnityEngine.Debug:Log(Object)
Movement:Start() (at Assets/Scripts/Player/Movement.cs:43)

Bank -> <-
UnityEngine.Debug:Log(Object)
Movement:Start() (at Assets/Scripts/Player/Movement.cs:44)

EventInstance ->FMOD.Studio.EventInstance <-
UnityEngine.Debug:Log(Object)
Movement:Start() (at Assets/Scripts/Player/Movement.cs:45)

ParameterInstance -> <-
UnityEngine.Debug:Log(Object)
Movement:Start() (at Assets/Scripts/Player/Movement.cs:46)

Start -> OK <-
UnityEngine.Debug:Log(Object)
Movement:Start() (at Assets/Scripts/Player/Movement.cs:47)[/code:1o4tj6br]

Anyone has any idea what I can try?

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.