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
f62e0d3b
Commit
f62e0d3b
authored
Jun 20, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rearrange some code for consistency with other code.
parent
4442f926
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
19 deletions
+18
-19
research/_extras/nodes/ma_vocoder_node/ma_vocoder_node.c
research/_extras/nodes/ma_vocoder_node/ma_vocoder_node.c
+18
-19
No files found.
research/_extras/nodes/ma_vocoder_node/ma_vocoder_node.c
View file @
f62e0d3b
...
@@ -2,6 +2,21 @@
...
@@ -2,6 +2,21 @@
#define VOCLIB_IMPLEMENTATION
#define VOCLIB_IMPLEMENTATION
#include "ma_vocoder_node.h"
#include "ma_vocoder_node.h"
MA_API
ma_vocoder_node_config
ma_vocoder_node_config_init
(
ma_uint32
channels
,
ma_uint32
sampleRate
)
{
ma_vocoder_node_config
config
;
MA_ZERO_OBJECT
(
&
config
);
config
.
nodeConfig
=
ma_node_config_init
();
/* Input and output channels will be set in ma_vocoder_node_init(). */
config
.
channels
=
channels
;
config
.
sampleRate
=
sampleRate
;
config
.
bands
=
16
;
config
.
filtersPerBand
=
6
;
return
config
;
}
static
void
ma_vocoder_node_process_pcm_frames
(
ma_node
*
pNode
,
const
float
**
ppFramesIn
,
ma_uint32
*
pFrameCountIn
,
float
**
ppFramesOut
,
ma_uint32
*
pFrameCountOut
)
static
void
ma_vocoder_node_process_pcm_frames
(
ma_node
*
pNode
,
const
float
**
ppFramesIn
,
ma_uint32
*
pFrameCountIn
,
float
**
ppFramesOut
,
ma_uint32
*
pFrameCountOut
)
{
{
ma_vocoder_node
*
pVocoderNode
=
(
ma_vocoder_node
*
)
pNode
;
ma_vocoder_node
*
pVocoderNode
=
(
ma_vocoder_node
*
)
pNode
;
...
@@ -20,22 +35,6 @@ static ma_node_vtable g_ma_vocoder_node_vtable =
...
@@ -20,22 +35,6 @@ static ma_node_vtable g_ma_vocoder_node_vtable =
0
0
};
};
MA_API
ma_vocoder_node_config
ma_vocoder_node_config_init
(
ma_uint32
channels
,
ma_uint32
sampleRate
)
{
ma_vocoder_node_config
config
;
MA_ZERO_OBJECT
(
&
config
);
config
.
nodeConfig
=
ma_node_config_init
();
/* Input and output channels will be set in ma_vocoder_node_init(). */
config
.
channels
=
channels
;
config
.
sampleRate
=
sampleRate
;
config
.
bands
=
16
;
config
.
filtersPerBand
=
6
;
return
config
;
}
MA_API
ma_result
ma_vocoder_node_init
(
ma_node_graph
*
pNodeGraph
,
const
ma_vocoder_node_config
*
pConfig
,
const
ma_allocation_callbacks
*
pAllocationCallbacks
,
ma_vocoder_node
*
pVocoderNode
)
MA_API
ma_result
ma_vocoder_node_init
(
ma_node_graph
*
pNodeGraph
,
const
ma_vocoder_node_config
*
pConfig
,
const
ma_allocation_callbacks
*
pAllocationCallbacks
,
ma_vocoder_node
*
pVocoderNode
)
{
{
ma_result
result
;
ma_result
result
;
...
@@ -56,9 +55,9 @@ MA_API ma_result ma_vocoder_node_init(ma_node_graph* pNodeGraph, const ma_vocode
...
@@ -56,9 +55,9 @@ MA_API ma_result ma_vocoder_node_init(ma_node_graph* pNodeGraph, const ma_vocode
}
}
baseConfig
=
pConfig
->
nodeConfig
;
baseConfig
=
pConfig
->
nodeConfig
;
baseConfig
.
vtable
=
&
g_ma_vocoder_node_vtable
;
baseConfig
.
vtable
=
&
g_ma_vocoder_node_vtable
;
baseConfig
.
inputChannels
[
0
]
=
pConfig
->
channels
;
/* Source/carrier. */
baseConfig
.
inputChannels
[
0
]
=
pConfig
->
channels
;
/* Source/carrier. */
baseConfig
.
inputChannels
[
1
]
=
1
;
/* Excite/modulator. Must always be single channel. */
baseConfig
.
inputChannels
[
1
]
=
1
;
/* Excite/modulator. Must always be single channel. */
baseConfig
.
outputChannels
[
0
]
=
pConfig
->
channels
;
/* Output channels is always the same as the source/carrier. */
baseConfig
.
outputChannels
[
0
]
=
pConfig
->
channels
;
/* Output channels is always the same as the source/carrier. */
baseConfig
.
outputChannels
[
1
]
=
0
;
/* Unused. */
baseConfig
.
outputChannels
[
1
]
=
0
;
/* Unused. */
...
...
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