/// <summary> /// Sets the speedrate of the audio being played /// </summary> private void trackBar_PlayBackRate_Scroll(object sender, EventArgs e) { if (_player.SetOutput) { _player.SetRate(SpeedRate.ConvertRate(trackBar_PlayBackRate.Value)); Thread.Sleep(100); label_PlayBackRate.Text = SpeedRate.DisplayRate(_player.Rate.ToString()); } else { label_PlayBackRate.Text = SpeedRate.DisplayRate(SpeedRate.ConvertRate(trackBar_PlayBackRate.Value).ToString()); } enhanchedTextBox1.txtBox.Focus(); }
/// <summary> /// Used when on auto speed. /// </summary> private void CheckRateOK() { if (wordcount >= 10) { _player.SetRate(SpeedRate.ConvertRate(1)); Thread.Sleep(100); label_PlayBackRate.Text = SpeedRate.DisplayRate(_player.Rate.ToString()); trackBar_PlayBackRate.Value = 1; } else if (wordcount <= 5) { _player.SetRate(SpeedRate.ConvertRate(-1)); Thread.Sleep(100); label_PlayBackRate.Text = SpeedRate.DisplayRate(_player.Rate.ToString()); trackBar_PlayBackRate.Value = -1; } }