How to "peek" the frames at a specific graph node during playback? #674
-
Hello! I am impressed by your library, seriously, I am totally blown away. ma_data_source_read_pcm_frames( Is there a simpler way? In any case, all is good, I can manipulate graphics using this raw data and the current ma_sound cursor position. ma_node_read_pcm_frames() but It doesn't even compile (is it an internal thing?), and I think this is supposed to be called on the audio thread by the engine anyways. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The Don't call In the next big release of miniaudio (version 0.12) you'll be able to plug in a callback to inspect the data. There's no timeframe on this yet. |
Beta Was this translation helpful? Give feedback.
Your understanding is correct for the node thing. Imagine the most simple of setups - you have 1 sound and that is, by default, connected to the endpoint:
You can plug in a node in the middle to do your processing:
When you implement a custom node, you implement a callback to do your processing. That callback takes a buffer to both the input data and output data. You would take the input data and do something with it, and then simply copy the data over to the output buffer. But even better, when you set up your custom node, you can set the
MA_NODE_FLAG_PASSTHROUGH
flag in your node's vtable which tells miniaudio the input …