Inheritance: IDisposable
		/// <summary>
		/// 
		/// </summary>
		/// <param name="effect"></param>
		/// <param name="voice"></param>
        internal SoundEffectInstance( SoundSystem device, SoundEffect effect, SourceVoice voice )
        {
			this.device = device;

            _effect = effect;
            _voice = voice;
        }
Beispiel #2
0
		/// <summary>
		/// Starts playing sound
		/// </summary>
		/// <param name="soundEffect"></param>
		/// <param name="options"></param>
		/// <param name="volume"></param>
		/// <param name="pitch"></param>
		public void PlaySound ( SoundEffect soundEffect, PlayOptions options = PlayOptions.None )
		{
			soundInstance	=	soundEffect.CreateInstance();

			soundInstance.IsLooped	=	options.HasFlag(PlayOptions.Looped);

			soundInstance.Play(); 
		}
		/// <summary>
		/// 
		/// </summary>
        public void Dispose()
        {
            if (_voice != null) {
                _voice.DestroyVoice();
                _voice.Dispose();
                _voice = null;
            }
		    _effect = null;
			isDisposed = true;
		}