Пример #1
0
        public void PlaySound()
        {
            player.PlaybackStopped -= Player_PlaybackStopped;
            player.Stop();
            player = new WaveOut();
            player.PlaybackStopped += Player_PlaybackStopped;
            player.DeviceNumber     = _idAudioDevice;
            afr        = new AudioFileReader(_fileAudioPath);
            afr.Volume = this._volume;
            player.Init(afr);
            player.Play();

            OnSoundStateChange?.Invoke(SoundState.Started);
        }
Пример #2
0
 private void Player_PlaybackStopped(object sender, StoppedEventArgs e)
 {
     OnSoundStateChange?.Invoke(SoundState.Stopped);
 }