示例#1
0
 public PortAudioRecord()
 {
     try
     {
         Audio.LoggingEnabled = true;
         audio = new Audio(NUM_CHANNELS, 2, SAMPLE_RATE, FRAMESPERBUFFER,
             new PortAudio.PaStreamCallbackDelegate(recordCallback));
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
        public JTAudioMixer()
        {
            _channels = new List<ConcurrentQueue<float>>();
            for (int i = 0; i < MAX_CHANELS; i++)
                _channels.Add(new ConcurrentQueue<float>());

            _audioHandle = new Audio(
                InputChannels,
                OutputChannels,
                OutputRate,
                FramesPerBuffer,
                new PortAudio.PaStreamCallbackDelegate(myPaStreamCallback));

            _audioHandle.Start();
        }
示例#3
0
        public void Run()
        {
            Audio audio = null;

            try {

                Audio.LoggingEnabled = true;
                audio = new Audio(1, 2, 44100, 2048,
                    new PortAudio.PaStreamCallbackDelegate(myPaStreamCallback));

                audio.Start();

                System.Threading.Thread.Sleep(3000);

                audio.Stop();

            } catch(Exception e) {
                Console.WriteLine(e.ToString());
            } finally {
                if (audio != null) audio.Dispose();
            }
        }