public AudioWorker() { _concentus = new ConcentusCodec(); _opus = new NativeOpusCodec(); _currentCodec = _concentus; _player = new NAudioPlayer(); _currentMusic = InputFiles[0]; }
private void sample3Button_Click(object sender, RoutedEventArgs e) { InputFileDef newFile = _worker.UpdateInputFile(2); attributionLabel.Content = newFile.Attribution; sample1Button.Background = this.Resources["GreyButtonBg"] as Brush; sample2Button.Background = this.Resources["GreyButtonBg"] as Brush; sample3Button.Background = this.Resources["GreenButtonBg"] as Brush; }
public InputFileDef UpdateInputFile(int newFileIndex) { if (newFileIndex < InputFiles.Length && newFileIndex >= 0) { _codecParamLock.WaitOne(); _currentMusic = InputFiles[newFileIndex]; _codecParamLock.ReleaseMutex(); } return(_currentMusic); }