A set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound, ASIO, and WASAPI) operating systems.
Other
1.49k
stars
318
forks
source link
[ask question] Pass sample rate and channel count to the callback. #377
int my_callback(void * out, void * in, std::uint32_t frames, double time, RtAudioStreamStatus status, void * user_data)
{
return 0;
}
audio.openStream(&out_param, nullptr, RTAUDIO_FLOAT64, sample_rate, &frames, my_callback, user_data);
I can not find way to get the sample rate and channel count in the my_callback function, so I pass them through user_data, but in this way, the data is sent twice by openStream. Do you have better solution?
I dont know where to ask question, so I ask here.
I can not find way to get the sample rate and channel count in the
my_callback
function, so I pass them through user_data, but in this way, the data is sent twice byopenStream
. Do you have better solution?