[examples] Add audio_stream_callback#5638
Conversation
32cae29 to
f1572fd
Compare
|
@dan-hoang @CrackedPixel I think this example can be redesigned to avoid being mostly a copy of the other one, maybe also renamed to |
…tions Drawing code wasn't tabbed in
I'm not an audio guy, so I don't have any good ideas. For now, I just let the user choose between four different waves (sine, square, triangle, and sawtooth), with each wave generated by a different callback. When the user changes the wave they want, the stream's callback is changed appropriately. I'm thinking that you would do something like this if you have a pipeline of effects set up (like in the stream effects example) and want to swap out the base signal. |
Used if instead of switch to compact code; seemed more readable in this case.
audio_stream_callback
|
@dan-hoang example looks good, thanks for the improvement |
This is a sister pull request to https://github.com/raysan5/raylib/pull/5637#issue-4054960372.
This commit adds
audio_raw_stream_callback.c, which is the same asaudio_raw_stream.cin the pull request above, but uses the new API (i.e.,SetAudioStreamCallback) instead of the old API (i.e.,IsAudioStreamProcessedandUpdateAudioStream).