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
383797c4
Commit
383797c4
authored
Apr 08, 2018
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-arrange some code.
parent
8d54bde0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
40 deletions
+43
-40
mini_al.h
mini_al.h
+43
-40
No files found.
mini_al.h
View file @
383797c4
...
@@ -1988,6 +1988,12 @@ mal_uint64 mal_dsp_read(mal_dsp* pDSP, mal_uint64 frameCount, void* pFramesOut,
...
@@ -1988,6 +1988,12 @@ mal_uint64 mal_dsp_read(mal_dsp* pDSP, mal_uint64 frameCount, void* pFramesOut,
// See documentation for mal_src_read_frames_ex() for an explanation on flushing.
// See documentation for mal_src_read_frames_ex() for an explanation on flushing.
mal_uint64
mal_dsp_read_ex
(
mal_dsp
*
pDSP
,
mal_uint64
frameCount
,
void
*
pFramesOut
,
mal_bool32
flush
,
void
*
pUserData
);
mal_uint64
mal_dsp_read_ex
(
mal_dsp
*
pDSP
,
mal_uint64
frameCount
,
void
*
pFramesOut
,
mal_bool32
flush
,
void
*
pUserData
);
// Helper for initializing a mal_dsp_config object.
mal_dsp_config
mal_dsp_config_init_new
();
mal_dsp_config
mal_dsp_config_init
(
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
mal_dsp_read_proc
onRead
,
void
*
pUserData
);
mal_dsp_config
mal_dsp_config_init_ex
(
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_channel
channelMapIn
[
MAL_MAX_CHANNELS
],
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
mal_channel
channelMapOut
[
MAL_MAX_CHANNELS
],
mal_dsp_read_proc
onRead
,
void
*
pUserData
);
// High-level helper for doing a full format conversion in one go. Returns the number of output frames. Call this with pOut set to NULL to
// High-level helper for doing a full format conversion in one go. Returns the number of output frames. Call this with pOut set to NULL to
// determine the required size of the output buffer.
// determine the required size of the output buffer.
//
//
...
@@ -1997,11 +2003,6 @@ mal_uint64 mal_dsp_read_ex(mal_dsp* pDSP, mal_uint64 frameCount, void* pFramesOu
...
@@ -1997,11 +2003,6 @@ mal_uint64 mal_dsp_read_ex(mal_dsp* pDSP, mal_uint64 frameCount, void* pFramesOu
mal_uint64
mal_convert_frames
(
void
*
pOut
,
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
const
void
*
pIn
,
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_uint64
frameCountIn
);
mal_uint64
mal_convert_frames
(
void
*
pOut
,
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
const
void
*
pIn
,
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_uint64
frameCountIn
);
mal_uint64
mal_convert_frames_ex
(
void
*
pOut
,
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
mal_channel
channelMapOut
[
MAL_MAX_CHANNELS
],
const
void
*
pIn
,
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_channel
channelMapIn
[
MAL_MAX_CHANNELS
],
mal_uint64
frameCountIn
);
mal_uint64
mal_convert_frames_ex
(
void
*
pOut
,
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
mal_channel
channelMapOut
[
MAL_MAX_CHANNELS
],
const
void
*
pIn
,
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_channel
channelMapIn
[
MAL_MAX_CHANNELS
],
mal_uint64
frameCountIn
);
// Helper for initializing a mal_dsp_config object.
mal_dsp_config
mal_dsp_config_init_new
();
mal_dsp_config
mal_dsp_config_init
(
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
mal_dsp_read_proc
onRead
,
void
*
pUserData
);
mal_dsp_config
mal_dsp_config_init_ex
(
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_channel
channelMapIn
[
MAL_MAX_CHANNELS
],
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
mal_channel
channelMapOut
[
MAL_MAX_CHANNELS
],
mal_dsp_read_proc
onRead
,
void
*
pUserData
);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
@@ -18486,6 +18487,43 @@ mal_uint32 mal_convert_frames__on_read(mal_dsp* pDSP, mal_uint32 frameCount, voi
...
@@ -18486,6 +18487,43 @@ mal_uint32 mal_convert_frames__on_read(mal_dsp* pDSP, mal_uint32 frameCount, voi
return
framesToRead
;
return
framesToRead
;
}
}
mal_dsp_config
mal_dsp_config_init_new
()
{
mal_dsp_config
config
;
mal_zero_object
(
&
config
);
return
config
;
}
mal_dsp_config
mal_dsp_config_init
(
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
mal_dsp_read_proc
onRead
,
void
*
pUserData
)
{
return
mal_dsp_config_init_ex
(
formatIn
,
channelsIn
,
sampleRateIn
,
NULL
,
formatOut
,
channelsOut
,
sampleRateOut
,
NULL
,
onRead
,
pUserData
);
}
mal_dsp_config
mal_dsp_config_init_ex
(
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_channel
channelMapIn
[
MAL_MAX_CHANNELS
],
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
mal_channel
channelMapOut
[
MAL_MAX_CHANNELS
],
mal_dsp_read_proc
onRead
,
void
*
pUserData
)
{
mal_dsp_config
config
;
mal_zero_object
(
&
config
);
config
.
formatIn
=
formatIn
;
config
.
channelsIn
=
channelsIn
;
config
.
sampleRateIn
=
sampleRateIn
;
config
.
formatOut
=
formatOut
;
config
.
channelsOut
=
channelsOut
;
config
.
sampleRateOut
=
sampleRateOut
;
if
(
channelMapIn
!=
NULL
)
{
mal_copy_memory
(
config
.
channelMapIn
,
channelMapIn
,
sizeof
(
config
.
channelMapIn
));
}
if
(
channelMapOut
!=
NULL
)
{
mal_copy_memory
(
config
.
channelMapOut
,
channelMapOut
,
sizeof
(
config
.
channelMapOut
));
}
config
.
onRead
=
onRead
;
config
.
pUserData
=
pUserData
;
return
config
;
}
mal_uint64
mal_convert_frames
(
void
*
pOut
,
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
const
void
*
pIn
,
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_uint64
frameCountIn
)
mal_uint64
mal_convert_frames
(
void
*
pOut
,
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
const
void
*
pIn
,
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_uint64
frameCountIn
)
{
{
mal_channel
channelMapOut
[
MAL_MAX_CHANNELS
];
mal_channel
channelMapOut
[
MAL_MAX_CHANNELS
];
...
@@ -18547,41 +18585,6 @@ mal_uint64 mal_convert_frames_ex(void* pOut, mal_format formatOut, mal_uint32 ch
...
@@ -18547,41 +18585,6 @@ mal_uint64 mal_convert_frames_ex(void* pOut, mal_format formatOut, mal_uint32 ch
return
mal_dsp_read_ex
(
&
dsp
,
frameCountOut
,
pOut
,
MAL_TRUE
,
dsp
.
pUserData
);
return
mal_dsp_read_ex
(
&
dsp
,
frameCountOut
,
pOut
,
MAL_TRUE
,
dsp
.
pUserData
);
}
}
mal_dsp_config
mal_dsp_config_init_new
()
{
mal_dsp_config
config
;
mal_zero_object
(
&
config
);
return
config
;
}
mal_dsp_config
mal_dsp_config_init
(
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
mal_dsp_read_proc
onRead
,
void
*
pUserData
)
{
return
mal_dsp_config_init_ex
(
formatIn
,
channelsIn
,
sampleRateIn
,
NULL
,
formatOut
,
channelsOut
,
sampleRateOut
,
NULL
,
onRead
,
pUserData
);
}
mal_dsp_config
mal_dsp_config_init_ex
(
mal_format
formatIn
,
mal_uint32
channelsIn
,
mal_uint32
sampleRateIn
,
mal_channel
channelMapIn
[
MAL_MAX_CHANNELS
],
mal_format
formatOut
,
mal_uint32
channelsOut
,
mal_uint32
sampleRateOut
,
mal_channel
channelMapOut
[
MAL_MAX_CHANNELS
],
mal_dsp_read_proc
onRead
,
void
*
pUserData
)
{
mal_dsp_config
config
;
mal_zero_object
(
&
config
);
config
.
formatIn
=
formatIn
;
config
.
channelsIn
=
channelsIn
;
config
.
sampleRateIn
=
sampleRateIn
;
config
.
formatOut
=
formatOut
;
config
.
channelsOut
=
channelsOut
;
config
.
sampleRateOut
=
sampleRateOut
;
if
(
channelMapIn
!=
NULL
)
{
mal_copy_memory
(
config
.
channelMapIn
,
channelMapIn
,
sizeof
(
config
.
channelMapIn
));
}
if
(
channelMapOut
!=
NULL
)
{
mal_copy_memory
(
config
.
channelMapOut
,
channelMapOut
,
sizeof
(
config
.
channelMapOut
));
}
config
.
onRead
=
onRead
;
config
.
pUserData
=
pUserData
;
return
config
;
}
...
...
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