public void Stop() { //threadWorking = false; queue.Close(); foreach (var thread in threads) { thread.Join(); } //queue.Close (); if (pcm != IntPtr.Zero) { Asound.snd_pcm_close(pcm); pcm = IntPtr.Zero; } }
static void TestAsound() { IntPtr pcm = IntPtr.Zero; int ret = Asound.snd_pcm_open(out pcm, "default", Asound.snd_pcm_stream_t.SND_PCM_STREAM_PLAYBACK, 0); if (ret < 0) { Console.WriteLine("Open error, {0}", Asound._snd_strerror(ret)); return; } else { Console.WriteLine("Open ok"); Asound.snd_pcm_close(pcm); } }
private void _Stop() { threadWorking = false; queue.Close(); foreach (var thread in threads) { thread.Join(); } if (waveOut != IntPtr.Zero) { WaveNative.waveOutClose(waveOut); waveOut = IntPtr.Zero; } if (pcm != IntPtr.Zero) { Asound.snd_pcm_close(pcm); pcm = IntPtr.Zero; } }