Esempio n. 1
0
 public abstract void Play(AudioDevice dev);
Esempio n. 2
0
 public virtual void Setup(AudioDevice dev)
 {
     dev.SetFormat(Format, Channels, Rate);
 }
Esempio n. 3
0
 public abstract void Play(AudioDevice dev);
Esempio n. 4
0
 public virtual void Setup(AudioDevice dev)
 {
     dev.SetFormat(Format, Channels, Rate);
 }
Esempio n. 5
0
 public override void Play(AudioDevice dev)
 {
     ThreadUtils.StartBackgroundThread(WaitStopEvent);
     var count = _dataLen;
     _stream.Position = 100;
     while (!IsStopped && count > 0)
     {
         var read = _stream.Read(s_sampleBuffer, 0, Math.Min(BUFFER_SIZE, count));
         if (read <= 0)
             break;
         count -= read;
         dev.PlaySample(s_sampleBuffer, read / _frameDivider);
     }
     if (IsStopped)
         dev.StopPlaying();
     else
         dev.WaitForPlayingFinished();
     dev.Close();
     PlayingFinishedEvent.Set();
 }