mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 00:34:03 +02:00
Add support for detailed control over data conversion when decoding.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// Audio playback and capture library. Public domain. See "unlicense" statement at the end of this file.
|
// Audio playback and capture library. Public domain. See "unlicense" statement at the end of this file.
|
||||||
// mini_al - v0.8.3 - 2018-07-15
|
// mini_al - v0.8.4-rc - 2018-xx-xx
|
||||||
//
|
//
|
||||||
// David Reid - davidreidsoftware@gmail.com
|
// David Reid - davidreidsoftware@gmail.com
|
||||||
|
|
||||||
@@ -929,6 +929,12 @@ typedef enum
|
|||||||
mal_src_sinc_window_function_default = mal_src_sinc_window_function_hann
|
mal_src_sinc_window_function_default = mal_src_sinc_window_function_hann
|
||||||
} mal_src_sinc_window_function;
|
} mal_src_sinc_window_function;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
mal_src_sinc_window_function windowFunction;
|
||||||
|
mal_uint32 windowWidth;
|
||||||
|
} mal_src_config_sinc;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
mal_uint32 sampleRateIn;
|
mal_uint32 sampleRateIn;
|
||||||
@@ -944,11 +950,7 @@ typedef struct
|
|||||||
void* pUserData;
|
void* pUserData;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct
|
mal_src_config_sinc sinc;
|
||||||
{
|
|
||||||
mal_src_sinc_window_function windowFunction;
|
|
||||||
mal_uint32 windowWidth;
|
|
||||||
} sinc;
|
|
||||||
};
|
};
|
||||||
} mal_src_config;
|
} mal_src_config;
|
||||||
|
|
||||||
@@ -1007,11 +1009,7 @@ typedef struct
|
|||||||
void* pUserData;
|
void* pUserData;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct
|
mal_src_config_sinc sinc;
|
||||||
{
|
|
||||||
mal_src_sinc_window_function windowFunction;
|
|
||||||
mal_uint32 windowWidth;
|
|
||||||
} sinc;
|
|
||||||
};
|
};
|
||||||
} mal_dsp_config;
|
} mal_dsp_config;
|
||||||
|
|
||||||
@@ -2422,6 +2420,13 @@ typedef struct
|
|||||||
mal_uint32 channels; // Set to 0 to use the stream's internal channels.
|
mal_uint32 channels; // Set to 0 to use the stream's internal channels.
|
||||||
mal_uint32 sampleRate; // Set to 0 to use the stream's internal sample rate.
|
mal_uint32 sampleRate; // Set to 0 to use the stream's internal sample rate.
|
||||||
mal_channel channelMap[MAL_MAX_CHANNELS];
|
mal_channel channelMap[MAL_MAX_CHANNELS];
|
||||||
|
mal_channel_mix_mode channelMixMode;
|
||||||
|
mal_dither_mode ditherMode;
|
||||||
|
mal_src_algorithm srcAlgorithm;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
mal_src_config_sinc sinc;
|
||||||
|
} src;
|
||||||
} mal_decoder_config;
|
} mal_decoder_config;
|
||||||
|
|
||||||
struct mal_decoder
|
struct mal_decoder
|
||||||
@@ -24273,6 +24278,11 @@ mal_result mal_decoder__init_dsp(mal_decoder* pDecoder, const mal_decoder_config
|
|||||||
pDecoder->internalFormat, pDecoder->internalChannels, pDecoder->internalSampleRate, pDecoder->internalChannelMap,
|
pDecoder->internalFormat, pDecoder->internalChannels, pDecoder->internalSampleRate, pDecoder->internalChannelMap,
|
||||||
pDecoder->outputFormat, pDecoder->outputChannels, pDecoder->outputSampleRate, pDecoder->outputChannelMap,
|
pDecoder->outputFormat, pDecoder->outputChannels, pDecoder->outputSampleRate, pDecoder->outputChannelMap,
|
||||||
onRead, pDecoder);
|
onRead, pDecoder);
|
||||||
|
dspConfig.channelMixMode = pConfig->channelMixMode;
|
||||||
|
dspConfig.ditherMode = pConfig->ditherMode;
|
||||||
|
dspConfig.srcAlgorithm = pConfig->srcAlgorithm;
|
||||||
|
dspConfig.sinc = pConfig->src.sinc;
|
||||||
|
|
||||||
return mal_dsp_init(&dspConfig, &pDecoder->dsp);
|
return mal_dsp_init(&dspConfig, &pDecoder->dsp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user