private void OpenFile() { var openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "All Supported Files (*.wav;*.mp3)|*.wav;*.mp3|All Files (*.*)|*.*"; bool? result = openFileDialog.ShowDialog(); if (result.HasValue && result.Value) { selectedFile = openFileDialog.FileName; reader = new AudioFileReader(selectedFile); equalizer = new Equalizer(reader, bands); player = new WaveOutEvent(); player.Init(equalizer); } }