-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Direct access to audio_stream
samples
#71
Comments
There currently is no way to do it. Take note that But look at it this way. |
I initially used Portaudio in my project directly and I'm in the middle of migrating it to Q. There were no fancy buffer types, just an array of floats so accessing sample data was trivial.
The waveform's size is equal to the current buffer size and refreshes every time a buffer finishes processing. |
In that case, you can access the contents of the buffer just fine. The mulli_buffer is just a wrapper over the buffer that Portaudio provides. See https://cycfi.github.io/q/q/v1.0_beta/reference/support/multi_buffer.html |
Alternatively, we can provide access to the data in the form of |
Yes, that's exactly it. I'm willing to open a PR for this. |
Portaudio doesn't allow you to read from a callback-based stream outside of the callback. Since |
Yes, that is expected. It's a real-time system. All real-time audio systems have similar interfaces. You have to go through the callback. |
So from what I understand the only way to access sample data outside of the callback would be to copy the buffer somewhere else every time the callback is run, right? |
Correct. Just make sure you synchronize access to your buffer from multiple threads. |
In short, I have an
audio_stream
doing some processing and I want to display a waveform in my GUI. Without copying the entire buffer somewhere else during eachprocess()
call, is there a way to read the current buffer of a running audio stream?The text was updated successfully, but these errors were encountered: