示例#1
0
 public abstract void Play(AudioDevice dev);
示例#2
0
 public virtual void Setup(AudioDevice dev)
 {
     dev.SetFormat(Format, Channels, Rate);
 }
示例#3
0
 public abstract void Play(AudioDevice dev);
示例#4
0
 public virtual void Setup(AudioDevice dev)
 {
     dev.SetFormat(Format, Channels, Rate);
 }
示例#5
0
文件: WavData.cs 项目: nico-izo/KOIB
 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();
 }