Exemple #1
0
 public CaptureInitializer()
 {
     deviceName = "";
     frequency  = 22050;
     format     = AudioBuffer.AudioFormat.MONO16;
     captureSampleringBufferSize = 4410; //200ms of data
 }
Exemple #2
0
        public Capture(CaptureInitializer init)
        {
            myFrequency  = init.frequency;
            myFormat     = init.format;
            myBufferSize = init.captureSampleringBufferSize;
            myDeviceName = init.deviceName;

            ALFormat alFormat = 0;

            switch (myFormat)
            {
            case AudioBuffer.AudioFormat.MONO8: alFormat = ALFormat.Mono8; break;

            case AudioBuffer.AudioFormat.MONO16: alFormat = ALFormat.Mono16; break;

            case AudioBuffer.AudioFormat.STEREO8: alFormat = ALFormat.Stereo8; break;

            case AudioBuffer.AudioFormat.STEREO16: alFormat = ALFormat.Stereo16; break;
            }

            myDevice = new AudioCapture(myDeviceName == "" ? AudioCapture.DefaultDevice : myDeviceName, myFrequency, alFormat, myBufferSize);
        }