text: import { __extends } from "tslib";
  import { Action } from "./action";
  import { _TypeStore } from '../Misc/typeStore';
  /**
   * This defines an action helpful to play a defined sound on a triggered action.
   */
  var PlaySoundAction = /** @class */ (function (_super) {
      __extends(PlaySoundAction, _super);
      /**
       * Instantiate the action
       * @param triggerOptions defines the trigger options
       * @param sound defines the sound to play
       * @param condition defines the trigger related conditions
       */
      function PlaySoundAction(triggerOptions, sound, condition) {
          var _this = _super.call(this, triggerOptions, condition) || this;
          _this._sound = sound;
          return _this;
      }
      /** @hidden */
      PlaySoundAction.prototype._prepare = function () {
      };
      /**
       * Execute the action and play the sound.
       */
      PlaySoundAction.prototype.execute = function () {
          if (this._sound !== undefined) {
              this._sound.play();
          }
      };
      /**
       * Serializes the actions and its related information.
       * @param parent defines the object to serialize in
       * @returns the serialized object
       */
      PlaySoundAction.prototype.serialize = function (parent) {
          return _super.prototype._serialize.call(this, {
              name: "PlaySoundAction",
              properties: [{ name: "sound", value: this._sound.name }]
          }, parent);
      };
      return PlaySoundAction;
  }(Action));
  export { PlaySoundAction };
  /**
   * This defines an action helpful to stop a defined sound on a triggered action.
   */
  var StopSoundAction = /** @class */ (function (_super) {
      __extends(StopSoundAction, _super);
      /**
       * Instantiate the action
       * @param triggerOptions defines the trigger options
       * @param sound defines the sound to stop
       * @param condition defines the trigger related conditions
       */
      function StopSoundAction(triggerOptions, sound, condition) {
          var _this = _super.call(this, triggerOptions, condition) || this;
          _this._sound = sound;
          return _this;
      }
      /** @hidden */
      StopSoundAction.prototype._prepare = function () {
      };
      /**
       * Execute the action and stop the sound.
       */
      StopSoundAction.prototype.execute = function () {
          if (this._sound !== undefined) {
              this._sound.stop();
          }
      };
      /**
       * Serializes the actions and its related information.
       * @param parent defines the object to serialize in
       * @returns the serialized object
       */
      StopSoundAction.prototype.serialize = function (parent) {
          return _super.prototype._serialize.call(this, {
              name: "StopSoundAction",
              properties: [{ name: "sound", value: this._sound.name }]
          }, parent);
      };
      return StopSoundAction;
  }(Action));
  export { StopSoundAction };
  _TypeStore.RegisteredTypes["BABYLON.PlaySoundAction"] = StopSoundAction;
  _TypeStore.RegisteredTypes["BABYLON.StopSoundAction"] = StopSoundAction;
  //# sourceMappingURL=directAudioActions.js.map