/// <summary> /// returns lenght of sound in milliseconds /// </summary> public static int GetLength(FMOD.Studio.EventInstance event_) { int lengthms = 0; FMOD.Studio.EventDescription ed = null; event_.getDescription(out ed); ed.getLength(out lengthms); return(lengthms); }
/// <summary> /// Returns normalized current timeline position (from 0 to 1) /// </summary> /// <returns></returns> public float GetNormalizedTimelinePosition() { int current_ms; _audio.getTimelinePosition(out current_ms); int length_ms; _info.getLength(out length_ms); return(current_ms / (float)length_ms); }
/* * private void OnDrawGizmosSelected() * { * Gizmos.DrawIcon(transform.position, "FMODEmitter.tiff", true); * * if (is3D && OverrideAttenuation) * { * Gizmos.color = new Color(0.6f, 0.6f, 1f, 0.8f); * if (OverrideAttenuation) * { * Gizmos.DrawWireSphere(transform.position, OverrideMinDistance); * Gizmos.DrawWireSphere(transform.position, OverrideMaxDistance); * } * } * } */ public float GetLength(string eventPath) { if (instance.isValid()) { eventDescription = FMODUnity.RuntimeManager.GetEventDescription(eventPath); int length; eventDescription.getLength(out length); return(length / 1000f); } else { return(-1f); } }
public AudioEventSTInstance(FMOD.Studio.EventInstance instance) { this.instance = instance; instance.getDescription(out description); int count; description.getLength(out length); description.getParameterDescriptionCount(out count); for (int i = 0; i < count; i++) { FMOD.Studio.PARAMETER_DESCRIPTION paramDescription; description.getParameterDescriptionByIndex(i, out paramDescription); parameters.Add(paramDescription.name, paramDescription.id); Debug.Log(paramDescription.name); } }