Closed Joel-play-lu closed 1 year ago
i cannot possibly comment on whether this is OK (but my gut feeling says that this is pure coincidence; I'm pretty sure that this cannot work in a cross-platform way).
Your actual backend might provide a "monitor" input device (for each output device) that can be used to query whatever is sent to the output, which i think is better solution.
Answering my own question.
After some tests, with the sample Record.cpp in the compiled examples. I managed to record a .raw audio file using the output device as the inputParams for the callback. I used format RTAUDIO_SINT8, 44100hz and 1 channel.
The .raw file created was able to play flawlessly with the raw audio player here : https://www.francogarcia.com/en/tools/raw-audio-player/
So I assume it is supported. It is good enough for my use case anyway.
Hello, I'm trying to use rtAudio with the wasapi api to analyse the audio currently playing on my speaker outputDevice.
I'm not sure if it is possible with rtAudio, the samples seem to all use input from a microphone and output the data, or I didn't understand them.
So far I tried opening the stream as output-only stream by settings the inputParameters to NULL, but the outputBuffer always seems to be empty in the callback, aka it is full of zeros 0.
I also tried to open the stream as input-only stream and settings the inputParameters with an outputDevice. This seems to work. The input buffer is full of value such as 0.00015, but it seems counter intuitive /hackish to put an outputDevice into the inputParams of the callback.
my callback only cast the input or output buffer as float* and output it's content to the console at the moment.
Is using an output device for the inputStream ok, or is it just a coincidence that I see data?