Skip to content
Discussion options

You must be logged in to vote

Hello,

Here the solution : define the callback type :

type PaStreamCallback = fn (input voidptr, output voidptr, frame_count u64, time_info &C.PaStreamCallbackTimeInfo, status_flags u64, user_data voidptr) int

and

tream_callback PaStreamCallback,// or stream_callback &PaStreamCallback (with &)

in

fn C.Pa_OpenDefaultStream(
    stream &PaStream,
    num_input_channels int,
    num_output_channels int,
    sample_format PaSampleFormat,
    sample_rate f64,
    frames_per_buffer u64,
    stream_callback PaStreamCallback,// or stream_callback &PaStreamCallback (with &)
    user_data voidptr
)int

Final code :

module main
import math
import time

#flag -L/opt/homebrew/Cellar/portaudio/19.7.0…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by AudioNiceMicroController
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants