Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
fdc43c4c
Commit
fdc43c4c
authored
Dec 18, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor updates to examples.
parent
80ca8c83
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
examples/engine_advanced.c
examples/engine_advanced.c
+8
-6
examples/node_graph.c
examples/node_graph.c
+1
-1
No files found.
examples/engine_advanced.c
View file @
fdc43c4c
...
@@ -8,10 +8,11 @@ The following features are demonstrated:
...
@@ -8,10 +8,11 @@ The following features are demonstrated:
* Multiple engines with a shared resource manager.
* Multiple engines with a shared resource manager.
* Creation and management of `ma_sound` objects.
* 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
Using a shared resource manager, as we do in this example, is useful for when you want to user
initializing one `ma_engine` object for each listener, each of which share a single self-managed resource manager.
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
#define MINIAUDIO_IMPLEMENTATION
#include "../miniaudio.h"
#include "../miniaudio.h"
...
@@ -24,9 +25,10 @@ void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uin
...
@@ -24,9 +25,10 @@ void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uin
(
void
)
pInput
;
(
void
)
pInput
;
/*
/*
Since we're managing the underlying device ourselves, we need to manually call the engine's data handler. To do
Since we're managing the underlying device ourselves, we need to read from the engine directly.
this we need access to the `ma_engine` object which we passed in to the user data. The advantage of this is that
To do this we need access to the `ma_engine` object which we passed in to the user data. One
you could do your own audio processing in addition to the engine's standard processing.
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
);
ma_engine_read_pcm_frames
((
ma_engine
*
)
pDevice
->
pUserData
,
pOutput
,
frameCount
,
NULL
);
}
}
...
...
examples/node_graph.c
View file @
fdc43c4c
...
@@ -137,7 +137,7 @@ int main(int argc, char** argv)
...
@@ -137,7 +137,7 @@ int main(int argc, char** argv)
return
-
1
;
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
);
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. */
/* Set the volume of the delay filter to make it more of less impactful. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment