public void start() { var device = paLibrary.DefaultOutputDevice; var outputParameters = new PaStreamParameters() { device = device, channelCount = 1, sampleFormat = PaSampleFormat.paFloat32, suggestedLatency = paLibrary.GetDeviceInfo(device).Value.defaultLowOutputLatency, hostApiSpecificStreamInfo = IntPtr.Zero }; osc = 0; stream = paLibrary.OpenStream( null, outputParameters, SampleRate, 512, PaStreamFlags.paNoFlag, SineCallback, IntPtr.Zero); stream.StartStream(); }
public void stop() { stream.StopStream(); stream.Dispose(); stream = null; }
public static extern IntPtr Pa_GetStreamInfo(PaStream* stream);
public static PaStreamInfo Pa_GetStreamInfo(PaStream* stream) { IntPtr ptr = NativeMethods.Pa_GetStreamInfo(stream); PaStreamInfo info = (PaStreamInfo) Marshal.PtrToStructure(ptr, typeof(PaStreamInfo)); return info; }