0
0

Hi,

I am currently trying to implement a simple game soundtrack in the Unity3D Angry Bots Demo using FMod. For now it’s just one single event containing a Multisound module in which I have loaded two different 16 bar loops. I’ve set the Module to looping and random.

When I trigger the event in Unity3D using .start() it starts playing, however, after 32 bars the sound stops, and resumes after a brief amount of silence. There are no gaps in the loops and it loops correctly in FMod itself.

I am polling the "paused" value of the event in the Update() function and it’s always False, so the event is playing.

Any ideas what I might be missing?

  • You must to post comments
0
0

Hi Peter,

sorry for the late response. I got around to check back on this just today. I am indeed using FMod_Listener script in Unity3D. I have it attached to the AudioListener. Right after that I have this piece of code in another script:

[code:2ab205o3]
using UnityEngine;
using System.Collections;
using FMOD.Studio;

public class MusicManager : MonoBehaviour {
FMOD.Studio.EventInstance loop;
float volume;
bool paused;

// Use this for initialization
void Start () {
    loop = FMOD_StudioSystem.instance.GetEvent ("event:/Music/Explore");
    loop.start ();
}

// Update is called once per frame
void Update () {
    loop.getVolume (out volume);
    loop.getPaused (out paused);
    UnityEngine.Debug.Log (volume.ToString());
    UnityEngine.Debug.Log (paused.ToString());
}

}
[/code:2ab205o3]

My FMod Session contains just one looped event with a Multisound Module containing 2 loops. Inside FMod everything works as expected. Maybe I am missing something or doing sth. wrong (I have some experience when it comes to programming but I am mainly an audio guy :)).

Thanks again for the response and have nice weekend!
Michael

  • You must to post comments
0
0

The most likely cause would be update not being called. Are you calling Studio.System.update regularly (i.e. every frame) ? If you’re using the FMODListener.cs script this will happen automatically but if you’re creating the system yourself, you will need to make sure to call update. Other than that haven’t encountered any issues which would cause that problem, if it isn’t resolved by calling update please send you project through to support@fmod.org and I will take a look.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.