Hi, I’m new here, trying to get my first test going, been following the examples here, and I have the code sorted with no errors, and it looks like it should be working, but the audio doesn’t play.
The fmod debug shows successful init and bank load:
my code so far, I expect the drum_test_01 event to start playing automatically, and the drumIntensity parameter to be modified on the fly based on the distance float (it’s clamped to 0 - 1 in another script).
I can play back the sound in the inspector of the event asset, and the slider controls the parameter, but there is no playback at runtime or in a build.
I followed the checklist from another thread too, the listener script is on the camera, an event emitter is in the scene…
Any help would be appreciated
using UnityEngine;
using System.Collections;
using FMOD.Studio;
public class fmodTest : MonoBehaviour {
FMOD.Studio.EventInstance drums;
FMOD.Studio.ParameterInstance paramDrum;
public distanceListener distanceMeter;
void Start () {
drums = FMOD_StudioSystem.instance.GetEvent("event:/drum_test_01");
drums.start();
drums.getParameter("drumIntensity", out paramDrum);
}
void Update () {
float distance = distanceMeter.cubeRange;
paramDrum.setValue(distance);
}
void OnDisable()
{
drums.stop();
drums.release();
}
}