public CaptureInitializer() { deviceName = ""; frequency = 22050; format = AudioBuffer.AudioFormat.MONO16; captureSampleringBufferSize = 4410; //200ms of data }
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); }