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
01d6297b
Commit
01d6297b
authored
Feb 17, 2025
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some warnings with some more examples.
parent
de5f370d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
examples/engine_effects.c
examples/engine_effects.c
+1
-1
examples/engine_sdl.c
examples/engine_sdl.c
+3
-1
examples/engine_steamaudio.c
examples/engine_steamaudio.c
+3
-3
No files found.
examples/engine_effects.c
View file @
01d6297b
...
@@ -101,4 +101,4 @@ int main(int argc, char** argv)
...
@@ -101,4 +101,4 @@ int main(int argc, char** argv)
ma_engine_uninit
(
&
g_engine
);
ma_engine_uninit
(
&
g_engine
);
return
0
;
return
0
;
}
}
\ No newline at end of file
examples/engine_sdl.c
View file @
01d6297b
...
@@ -13,7 +13,7 @@ head.
...
@@ -13,7 +13,7 @@ head.
#include "../miniaudio.h"
#include "../miniaudio.h"
#define SDL_MAIN_HANDLED
#define SDL_MAIN_HANDLED
#include <SDL
.h>
/* Change this to your include location. Might be <SDL2/
SDL.h>. */
#include <SDL
2/SDL.h>
/* Change this to your include location. Might be <
SDL.h>. */
#define CHANNELS 2
/* Must be stereo for this example. */
#define CHANNELS 2
/* Must be stereo for this example. */
#define SAMPLE_RATE 48000
#define SAMPLE_RATE 48000
...
@@ -23,6 +23,8 @@ static ma_sound g_sound; /* This example will play only a single soun
...
@@ -23,6 +23,8 @@ static ma_sound g_sound; /* This example will play only a single soun
void
data_callback
(
void
*
pUserData
,
ma_uint8
*
pBuffer
,
int
bufferSizeInBytes
)
void
data_callback
(
void
*
pUserData
,
ma_uint8
*
pBuffer
,
int
bufferSizeInBytes
)
{
{
(
void
)
pUserData
;
/* Reading is just a matter of reading straight from the engine. */
/* Reading is just a matter of reading straight from the engine. */
ma_uint32
bufferSizeInFrames
=
(
ma_uint32
)
bufferSizeInBytes
/
ma_get_bytes_per_frame
(
ma_format_f32
,
ma_engine_get_channels
(
&
g_engine
));
ma_uint32
bufferSizeInFrames
=
(
ma_uint32
)
bufferSizeInBytes
/
ma_get_bytes_per_frame
(
ma_format_f32
,
ma_engine_get_channels
(
&
g_engine
));
ma_engine_read_pcm_frames
(
&
g_engine
,
pBuffer
,
bufferSizeInFrames
,
NULL
);
ma_engine_read_pcm_frames
(
&
g_engine
,
pBuffer
,
bufferSizeInFrames
,
NULL
);
...
...
examples/engine_steamaudio.c
View file @
01d6297b
...
@@ -118,7 +118,7 @@ static void ma_steamaudio_binaural_node_process_pcm_frames(ma_node* pNode, const
...
@@ -118,7 +118,7 @@ static void ma_steamaudio_binaural_node_process_pcm_frames(ma_node* pNode, const
pBinauralNode
->
ppBuffersIn
[
0
]
=
(
float
*
)
ma_offset_pcm_frames_const_ptr_f32
(
ppFramesIn
[
0
],
totalFramesProcessed
,
1
);
pBinauralNode
->
ppBuffersIn
[
0
]
=
(
float
*
)
ma_offset_pcm_frames_const_ptr_f32
(
ppFramesIn
[
0
],
totalFramesProcessed
,
1
);
}
else
{
}
else
{
/* Slow path. Need to deinterleave the input data. */
/* Slow path. Need to deinterleave the input data. */
ma_deinterleave_pcm_frames
(
ma_format_f32
,
inputBufferDesc
.
numChannels
,
framesToProcessThisIteration
,
ma_offset_pcm_frames_const_ptr_f32
(
ppFramesIn
[
0
],
totalFramesProcessed
,
inputBufferDesc
.
numChannels
),
pBinauralNode
->
ppBuffersIn
);
ma_deinterleave_pcm_frames
(
ma_format_f32
,
inputBufferDesc
.
numChannels
,
framesToProcessThisIteration
,
ma_offset_pcm_frames_const_ptr_f32
(
ppFramesIn
[
0
],
totalFramesProcessed
,
inputBufferDesc
.
numChannels
),
(
void
**
)
&
pBinauralNode
->
ppBuffersIn
[
0
]
);
}
}
inputBufferDesc
.
data
=
pBinauralNode
->
ppBuffersIn
;
inputBufferDesc
.
data
=
pBinauralNode
->
ppBuffersIn
;
...
@@ -128,7 +128,7 @@ static void ma_steamaudio_binaural_node_process_pcm_frames(ma_node* pNode, const
...
@@ -128,7 +128,7 @@ static void ma_steamaudio_binaural_node_process_pcm_frames(ma_node* pNode, const
iplBinauralEffectApply
(
pBinauralNode
->
iplEffect
,
&
binauralParams
,
&
inputBufferDesc
,
&
outputBufferDesc
);
iplBinauralEffectApply
(
pBinauralNode
->
iplEffect
,
&
binauralParams
,
&
inputBufferDesc
,
&
outputBufferDesc
);
/* Interleave straight into the output buffer. */
/* Interleave straight into the output buffer. */
ma_interleave_pcm_frames
(
ma_format_f32
,
2
,
framesToProcessThisIteration
,
pBinauralNode
->
ppBuffersOut
,
ma_offset_pcm_frames_ptr_f32
(
ppFramesOut
[
0
],
totalFramesProcessed
,
2
));
ma_interleave_pcm_frames
(
ma_format_f32
,
2
,
framesToProcessThisIteration
,
(
const
void
**
)
&
pBinauralNode
->
ppBuffersOut
[
0
]
,
ma_offset_pcm_frames_ptr_f32
(
ppFramesOut
[
0
],
totalFramesProcessed
,
2
));
/* Advance. */
/* Advance. */
totalFramesProcessed
+=
framesToProcessThisIteration
;
totalFramesProcessed
+=
framesToProcessThisIteration
;
...
@@ -436,4 +436,4 @@ int main(int argc, char** argv)
...
@@ -436,4 +436,4 @@ int main(int argc, char** argv)
ma_engine_uninit
(
&
g_engine
);
ma_engine_uninit
(
&
g_engine
);
return
0
;
return
0
;
}
}
\ No newline at end of file
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