Hello. We are encountering:
[FMOD] AsyncManager::asyncThreadLoop : System::update returned error 30.<br>FMODUnity.RuntimeManager:DEBUG_CALLBACK(DEBUG_FLAGS, IntPtr, Int32, IntPtr, IntPtr)<br><br>
Wed Aug 31 2022 15:11:27 GMT-0400 (Eastern Daylight Time):error19693/19524 Unity
when trying to play some “one-shot” events like footsteps (an event with parameters). The exceptions will start happening in place of playing those sound effects. Peculiarly, it is the same set of events that are affected and not a random selection each occurrence. Those sounds will not play at all. Is there anything apparent about this code that would trigger this? There are some VOIP systems as well that I can post if this couldn’t be the culprit.
*Note _cacheOneShots = false.
public virtual void PlayOneShot(int playerId, string audioEventName, GameObject attachPoint = null,
Rigidbody attachPointRigidbody = null, Dictionary<string, float> parameterCollection = null)
{
if (!IsAudioEnabled) return;
if (playerId < 0) return;
if (string.IsNullOrEmpty(audioEventName))
{
#if UNITY_EDITOR
SlLogger.LogWarning("Audio event name is not provided.");
#endif
return;
}
//one-shots only allowed this way
if (!IsOneShotType(audioEventName))
{
SlLogger.LogError($"Trying to play streaming audio as one-shot: {audioEventName}");
return;
}
//returns an available pool member or create a new instance
EventInstance instance;
bool needsInit = true;
//cache one shots is currently FALSE
if (_cacheOneShots) instance = GetOneShotEventInstance(playerId, audioEventName, out needsInit);
else instance = RuntimeManager.CreateInstance(audioEventName);
//only configure if its a new instance, increases performance by
//avoiding additional instructions
if (needsInit)
{
if (attachPoint != null) RuntimeManager.AttachInstanceToGameObject(instance, attachPoint.transform, attachPointRigidbody);
else instance.set3DAttributes(Vector3.zero.To3DAttributes());
}
//always apply params
if (parameterCollection != null)
{
foreach (KeyValuePair<string, float> parameter in parameterCollection)
{
if (string.IsNullOrEmpty(parameter.Key)) continue;
instance.setParameterByName(parameter.Key, parameter.Value);
}
}
instance.start();
//if not cached, we should release this immediately
if (!_cacheOneShots) instance.release();
}
private bool IsOneShotType(string audioEventName)
{
//check to see if the event is in our banks
var eventDescription = RuntimeManager.GetEventDescription(audioEventName);
if (!eventDescription.isValid()) return false;
//very important: only play one shot events here this way
bool isOneShot = false;
//snapshots should not be played as one-shots
if (!audioEventName.StartsWith(FmodSnapshotString, StringComparison.CurrentCultureIgnoreCase))
{
eventDescription.isOneshot(out isOneShot);
}
return isOneShot;
}