NAudio.Wave.WaveOutEvent.Play C# (CSharp) Method

Play() public method

Start playing the audio from the WaveStream
public Play ( ) : void
return void
        public void Play()
        {
            if (this.buffers == null || this.waveStream == null)
            {
                throw new InvalidOperationException("Must call Init first");
            }
            if (playbackState == PlaybackState.Stopped)
            {
                playbackState = PlaybackState.Playing;
                ThreadPool.QueueUserWorkItem((state) => PlaybackThread(), null);
            }
            else if (playbackState == PlaybackState.Paused)
            {
                Resume();
                callbackEvent.Set(); // give the thread a kick
            }
        }

Usage Example

コード例 #1
1
ファイル: VoiceCallCore.cs プロジェクト: astorks/BlazeIM
        public Call(IPEndPoint Address)
        {
            UdpSender = new UdpClient();
            UdpSender.Connect(Address);
            this.Address = Address;

            _encoder = new SpeexEncoder(BandMode.Wide);
            SpeexProvider = new JitterBufferWaveProvider();

            SoundOut = new WaveOutEvent();
            SoundOut.Init(SpeexProvider);
            SoundOut.Play();
        }
All Usage Examples Of NAudio.Wave.WaveOutEvent::Play