mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Rearrange some code for consistency with other code.
This commit is contained in:
@@ -2,6 +2,21 @@
|
||||
#define VOCLIB_IMPLEMENTATION
|
||||
#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)
|
||||
{
|
||||
ma_vocoder_node* pVocoderNode = (ma_vocoder_node*)pNode;
|
||||
@@ -20,22 +35,6 @@ static ma_node_vtable g_ma_vocoder_node_vtable =
|
||||
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_result result;
|
||||
@@ -56,9 +55,9 @@ MA_API ma_result ma_vocoder_node_init(ma_node_graph* pNodeGraph, const ma_vocode
|
||||
}
|
||||
|
||||
baseConfig = pConfig->nodeConfig;
|
||||
baseConfig.vtable = &g_ma_vocoder_node_vtable;
|
||||
baseConfig.inputChannels[0] = pConfig->channels; /* Source/carrier. */
|
||||
baseConfig.inputChannels[1] = 1; /* Excite/modulator. Must always be single channel. */
|
||||
baseConfig.vtable = &g_ma_vocoder_node_vtable;
|
||||
baseConfig.inputChannels [0] = pConfig->channels; /* Source/carrier. */
|
||||
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[1] = 0; /* Unused. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user