Beispiel #1
0
    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();
    }
Beispiel #2
0
 public void stop()
 {
     stream.StopStream();
     stream.Dispose();
     stream = null;
 }
Beispiel #3
0
 public static extern IntPtr Pa_GetStreamInfo(PaStream* stream);
Beispiel #4
0
 public static PaStreamInfo Pa_GetStreamInfo(PaStream* stream)
 {
     IntPtr ptr = NativeMethods.Pa_GetStreamInfo(stream);
     PaStreamInfo info = (PaStreamInfo) Marshal.PtrToStructure(ptr, typeof(PaStreamInfo));
     return info;
 }