private void inputStream_Sample(object sender, SampleEventArgs e) { sampleAggregator.Add(e.Left * 2.0f, e.Right * 2.0f); // I know, I know, magic numbers are bad, mmkay. if (ActiveStream != null) { if (sampleReset + 42000 < ActiveStream.Position) { sampleReset = ActiveStream.Position; sampleAggregator.Clear(); } } }
void inputStream_Sample(object sender, SampleEventArgs e) { if (OnSample != null) { OnSample(this, e); } }
void waveStream_Sample(object sender, SampleEventArgs e) { waveformAggregator.Add(e.Left, e.Right); }
private void inputStream_Sample(object sender, SampleEventArgs e) { sampleAggregator.Add(e.Left, e.Right); long repeatStartPosition = (long)((SelectionBegin.TotalSeconds / ActiveStream.TotalTime.TotalSeconds) * ActiveStream.Length); long repeatStopPosition = (long)((SelectionEnd.TotalSeconds / ActiveStream.TotalTime.TotalSeconds) * ActiveStream.Length); if (((SelectionEnd - SelectionBegin) >= TimeSpan.FromMilliseconds(repeatThreshold)) && ActiveStream.Position >= repeatStopPosition) { sampleAggregator.Clear(); ActiveStream.Position = repeatStartPosition; } }
/// <summary> /// This callback is called everytime a sample is player. This method handles current time and current position updates, /// the stop of the playing at the end of the track and the buffering state. /// </summary> /// <param name="sender">Unused params</param> /// <param name="e">Unused params</param> private void wc_Sample(object sender, SampleEventArgs e) { if (wc == null) return; if (wc.CurrentTime.TotalSeconds != currentTime) { currentTime = wc.CurrentTime.TotalSeconds; NotifyPropertyChanged("CurrentTime"); NotifyPropertyChanged("BufferPortion"); pos = lmem.Position; NotifyPropertyChanged("Position"); } if (lmem.Position == lmem.Length) { this.stop(); return; } long myBufferSize = 20480; if ((!BufferingState) && (localstream.Position != rsc.Tag.FileSize) && ((localstream.Position - lmem.Position) < myBufferSize)) { Console.WriteLine("Paused ... waiting!"); BufferingState = true; this.pause(); localstream.WaitForMore(); } }
void _notify_Sample(object sender, SampleEventArgs e) { if (SampleReceived != null) SampleReceived.Invoke(this, e); }
void OnSample(object sender, SampleEventArgs e) { aggregator.Add(e.Left); }
/// <summary> /// Event when player plays another sample /// </summary> private void SampleCounter(object sender, SampleEventArgs e) { m_SampleCount++; }
private void Sound0_Sample(object sender, SampleEventArgs e) { max = Math.Max(max, e.Left); min = Math.Min(min, e.Left); }
void eq_Sample(object sender, SampleEventArgs e) { inputStream_Sample(sender, e); }
private void channel_Sample(object sender, SampleEventArgs e) { InputSampler.Add(e.Left, e.Right); }
static void _waveChannel_Sample(object sender, SampleEventArgs e) { InputSampler.Add(e.Left, e.Right); }
private void SampleEvent(object sender, SampleEventArgs e) { nextval = Math.Abs(e.Left + e.Right / 2); }
private void inputStream_Sample(object sender, SampleEventArgs e) { sampleAggregator.Add(e.Left, e.Right); }