示例#1
0
 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;
     }
 }
示例#2
0
        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);
            }
        }
示例#3
0
        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;
            }
        }