コード例 #1
0
ファイル: WaveIn.cs プロジェクト: ericQiang/selector-theater
 public WaveInRecorder(WavInDevice device, WaveFormat format, int bufferSize, int bufferCount)
 {
     SaveBufSize = bufferSize;
     SaveBufCount = bufferCount;
     WaveInHelper.Try(WINMM_DLL.waveInOpen(out m_WaveIn, device.Index, format, m_BufferProc, 0, WINMM_DLL.CALLBACK_FUNCTION));
     WaveInFormat = format;
     AllocateBuffers(bufferSize, bufferCount);
     for (int i = 0; i < bufferCount; i++)
     {
         SelectNextBuffer();
         m_CurrentBuffer.Record();
     }
     WaveInHelper.Try(WINMM_DLL.waveInStart(m_WaveIn));
     m_Thread = new Thread(new ThreadStart(ThreadProc));
     m_Thread.Start();
 }
コード例 #2
0
ファイル: WaveOut.cs プロジェクト: ericQiang/selector-theater
        public WaveOutPlayer(WavInDevice device, WaveFormat format, int bufferSize, int bufferCount)
        {
            SaveBufSize = bufferSize;
            SaveBufCount = bufferCount;
            WaveOutHelper.Try(WINMM_DLL.waveOutOpen(out m_WaveOut, device.Index, format, m_BufferProc, 0, WINMM_DLL.CALLBACK_FUNCTION));
            WaveOutFormat = format;
            AllocateBuffers(bufferSize, bufferCount);

            m_Thread = new Thread(new ThreadStart(ThreadProc));
            m_Thread.Start();
        }