public override void Sound_OnSoundTrigger(object sender, SoundTriggerEventArgs e) { if (!MaintainSounds) { return; } var soundID = e.SoundID; var gain = e.Gain; var objectID = e.ObjectID; var ownerID = e.OwnerID; var parentID = e.ParentID; var position = e.Position; var p = GetRegion(e.RegionHandle).LocalToGlobal(position); EnqueueRequestAsset(soundID, AssetType.Sound, true); EventQueue.Enqueue(() => { if (objectID != UUID.Zero) { OnObjectSound(objectID, soundID, gain); } else { SendNewRegionEvent(SimEventType.EFFECT, "On-Sound-Position-Trigger", soundID, ownerID, parentID, gain, p); } }); }
void Sound_SoundTrigger(object sender, SoundTriggerEventArgs e) { if (e.ObjectID != gameComponents.tableId) { return; } if (e.SoundID == soundBust) { Utils.OutputLine("BUST sound played from: " + e.ObjectID.ToString(), Utils.OutputLevel.Game); } else if (e.SoundID == soundRoll) { Utils.OutputLine("Dice roll sound played from: " + e.ObjectID.ToString(), Utils.OutputLevel.Game); } Utils.OutputLine("Object " + e.ObjectID.ToString() + " plays sound " + e.SoundID, Utils.OutputLevel.Game); }
/// <summary> /// Handle request to play a sound, which might (or mioght not) have been preloaded. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Sound_SoundTrigger(object sender, SoundTriggerEventArgs e) { if (e.SoundID == UUID.Zero) { return; } Logger.Log("Trigger sound " + e.SoundID + " in object " + e.ObjectID, Helpers.LogLevel.Debug); new BufferSound( e.ObjectID, e.SoundID, false, true, e.Position, e.Gain * ObjectVolume); }