From fdc43c4c9548b69fb2469f197c022ce796dcabe3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 18 Dec 2021 13:14:57 +1000 Subject: [PATCH] Minor updates to examples. --- examples/engine_advanced.c | 14 ++++++++------ examples/node_graph.c | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/engine_advanced.c b/examples/engine_advanced.c index 219caa03..6044d992 100644 --- a/examples/engine_advanced.c +++ b/examples/engine_advanced.c @@ -8,10 +8,11 @@ The following features are demonstrated: * Multiple engines with a shared resource manager. * Creation and management of `ma_sound` objects. -This example will play the sound that's passed in the command line. +This example will play the sound that's passed in on the command line. -If you were wanting to support multiple listeners, this example will show you how to do that. You achieve this by -initializing one `ma_engine` object for each listener, each of which share a single self-managed resource manager. +Using a shared resource manager, as we do in this example, is useful for when you want to user +multiple engines so that you can output to multiple playback devices simultaneoulys. An example +might be a local co-op multiplayer game where each player has their own headphones. */ #define MINIAUDIO_IMPLEMENTATION #include "../miniaudio.h" @@ -24,9 +25,10 @@ void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uin (void)pInput; /* - Since we're managing the underlying device ourselves, we need to manually call the engine's data handler. To do - this we need access to the `ma_engine` object which we passed in to the user data. The advantage of this is that - you could do your own audio processing in addition to the engine's standard processing. + Since we're managing the underlying device ourselves, we need to read from the engine directly. + To do this we need access to the `ma_engine` object which we passed in to the user data. One + advantage of this is that you could do your own audio processing in addition to the engine's + standard processing. */ ma_engine_read_pcm_frames((ma_engine*)pDevice->pUserData, pOutput, frameCount, NULL); } diff --git a/examples/node_graph.c b/examples/node_graph.c index 0a47e788..aecccfe7 100644 --- a/examples/node_graph.c +++ b/examples/node_graph.c @@ -137,7 +137,7 @@ int main(int argc, char** argv) return -1; } - /* Connect the output bus fo the delay node to the input bus of the endpoint. */ + /* Connect the output bus of the delay node to the input bus of the endpoint. */ ma_node_attach_output_bus(&g_delayNode, 0, ma_node_graph_get_endpoint(&g_nodeGraph), 0); /* Set the volume of the delay filter to make it more of less impactful. */