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); }
private void Player_PlaybackStopped(object sender, StoppedEventArgs e) { OnSoundStateChange?.Invoke(SoundState.Stopped); }