MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / drmp3_src_init

Function drmp3_src_init

extlibs/soloud/src/audiosource/wav/dr_mp3.h:2227–2245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2225drmp3_uint64 drmp3_src_read_frames_linear(drmp3_src* pSRC, drmp3_uint64 frameCount, void* pFramesOut, drmp3_bool32 flush);
2226
2227drmp3_bool32 drmp3_src_init(const drmp3_src_config* pConfig, drmp3_src_read_proc onRead, void* pUserData, drmp3_src* pSRC)
2228{
2229 if (pSRC == NULL) return DRMP3_FALSE;
2230 drmp3_zero_object(pSRC);
2231
2232 if (pConfig == NULL || onRead == NULL) return DRMP3_FALSE;
2233 if (pConfig->channels == 0 || pConfig->channels > 2) return DRMP3_FALSE;
2234
2235 pSRC->config = *pConfig;
2236 pSRC->onRead = onRead;
2237 pSRC->pUserData = pUserData;
2238
2239 if (pSRC->config.cacheSizeInFrames > DRMP3_SRC_CACHE_SIZE_IN_FRAMES || pSRC->config.cacheSizeInFrames == 0) {
2240 pSRC->config.cacheSizeInFrames = DRMP3_SRC_CACHE_SIZE_IN_FRAMES;
2241 }
2242
2243 drmp3_src_cache_init(pSRC, &pSRC->cache);
2244 return DRMP3_TRUE;
2245}
2246
2247drmp3_bool32 drmp3_src_set_input_sample_rate(drmp3_src* pSRC, drmp3_uint32 sampleRateIn)
2248{

Callers 1

drmp3_init_internalFunction · 0.85

Calls 1

drmp3_src_cache_initFunction · 0.85

Tested by

no test coverage detected