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
47b17ad5
Commit
47b17ad5
authored
Apr 04, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update extras.
parent
45724880
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3531 additions
and
1555 deletions
+3531
-1555
extras/dr_flac.h
extras/dr_flac.h
+1222
-262
extras/dr_mp3.h
extras/dr_mp3.h
+1097
-762
extras/dr_wav.h
extras/dr_wav.h
+1199
-516
miniaudio.h
miniaudio.h
+13
-15
No files found.
extras/dr_flac.h
View file @
47b17ad5
This diff is collapsed.
Click to expand it.
extras/dr_mp3.h
View file @
47b17ad5
This diff is collapsed.
Click to expand it.
extras/dr_wav.h
View file @
47b17ad5
This diff is collapsed.
Click to expand it.
miniaudio.h
View file @
47b17ad5
...
@@ -39870,12 +39870,17 @@ static ma_uint64 ma_decoder_internal_on_read_pcm_frames__mp3(ma_decoder* pDecode
...
@@ -39870,12 +39870,17 @@ static ma_uint64 ma_decoder_internal_on_read_pcm_frames__mp3(ma_decoder* pDecode
MA_ASSERT(pDecoder != NULL);
MA_ASSERT(pDecoder != NULL);
MA_ASSERT(pFramesOut != NULL);
MA_ASSERT(pFramesOut != NULL);
MA_ASSERT(pDecoder->internalFormat == ma_format_f32);
pMP3 = (drmp3*)pDecoder->pInternalDecoder;
pMP3 = (drmp3*)pDecoder->pInternalDecoder;
MA_ASSERT(pMP3 != NULL);
MA_ASSERT(pMP3 != NULL);
#if defined(DR_MP3_FLOAT_OUTPUT)
MA_ASSERT(pDecoder->internalFormat == ma_format_f32);
return drmp3_read_pcm_frames_f32(pMP3, frameCount, (float*)pFramesOut);
return drmp3_read_pcm_frames_f32(pMP3, frameCount, (float*)pFramesOut);
#else
MA_ASSERT(pDecoder->internalFormat == ma_format_s16);
return drmp3_read_pcm_frames_s16(pMP3, frameCount, (drmp3_int16*)pFramesOut);
#endif
}
}
static ma_result ma_decoder_internal_on_seek_to_pcm_frame__mp3(ma_decoder* pDecoder, ma_uint64 frameIndex)
static ma_result ma_decoder_internal_on_seek_to_pcm_frame__mp3(ma_decoder* pDecoder, ma_uint64 frameIndex)
...
@@ -39909,7 +39914,6 @@ static ma_uint64 ma_decoder_internal_on_get_length_in_pcm_frames__mp3(ma_decoder
...
@@ -39909,7 +39914,6 @@ static ma_uint64 ma_decoder_internal_on_get_length_in_pcm_frames__mp3(ma_decoder
static ma_result ma_decoder_init_mp3__internal(const ma_decoder_config* pConfig, ma_decoder* pDecoder)
static ma_result ma_decoder_init_mp3__internal(const ma_decoder_config* pConfig, ma_decoder* pDecoder)
{
{
drmp3* pMP3;
drmp3* pMP3;
drmp3_config mp3Config;
drmp3_allocation_callbacks allocationCallbacks;
drmp3_allocation_callbacks allocationCallbacks;
MA_ASSERT(pConfig != NULL);
MA_ASSERT(pConfig != NULL);
...
@@ -39926,20 +39930,10 @@ static ma_result ma_decoder_init_mp3__internal(const ma_decoder_config* pConfig,
...
@@ -39926,20 +39930,10 @@ static ma_result ma_decoder_init_mp3__internal(const ma_decoder_config* pConfig,
allocationCallbacks.onFree = pDecoder->allocationCallbacks.onFree;
allocationCallbacks.onFree = pDecoder->allocationCallbacks.onFree;
/*
/*
Try opening the decoder first. MP3 can have variable sample rates (it's per frame/packet). We therefore need
Try opening the decoder first. We always use whatever dr_mp3 reports for channel count and sample rate. The format is determined by
to use some smarts to determine the most appropriate internal sample rate. These are the rules we're going
the presence of DR_MP3_FLOAT_OUTPUT.
to use:
Sample Rates
1) If an output sample rate is specified in pConfig we just use that. Otherwise;
2) Fall back to 44100.
The internal channel count is always stereo, and the internal format is always f32.
*/
*/
MA_ZERO_OBJECT(&mp3Config);
if (!drmp3_init(pMP3, ma_decoder_internal_on_read__mp3, ma_decoder_internal_on_seek__mp3, pDecoder, &allocationCallbacks)) {
mp3Config.outputChannels = 2;
mp3Config.outputSampleRate = (pConfig->sampleRate != 0) ? pConfig->sampleRate : 44100;
if (!drmp3_init(pMP3, ma_decoder_internal_on_read__mp3, ma_decoder_internal_on_seek__mp3, pDecoder, &mp3Config, &allocationCallbacks)) {
ma__free_from_callbacks(pMP3, &pDecoder->allocationCallbacks);
ma__free_from_callbacks(pMP3, &pDecoder->allocationCallbacks);
return MA_ERROR;
return MA_ERROR;
}
}
...
@@ -39952,7 +39946,11 @@ static ma_result ma_decoder_init_mp3__internal(const ma_decoder_config* pConfig,
...
@@ -39952,7 +39946,11 @@ static ma_result ma_decoder_init_mp3__internal(const ma_decoder_config* pConfig,
pDecoder->pInternalDecoder = pMP3;
pDecoder->pInternalDecoder = pMP3;
/* Internal format. */
/* Internal format. */
#if defined(DR_MP3_FLOAT_OUTPUT)
pDecoder->internalFormat = ma_format_f32;
pDecoder->internalFormat = ma_format_f32;
#else
pDecoder->internalFormat = ma_format_s16;
#endif
pDecoder->internalChannels = pMP3->channels;
pDecoder->internalChannels = pMP3->channels;
pDecoder->internalSampleRate = pMP3->sampleRate;
pDecoder->internalSampleRate = pMP3->sampleRate;
ma_get_standard_channel_map(ma_standard_channel_map_default, pDecoder->internalChannels, pDecoder->internalChannelMap);
ma_get_standard_channel_map(ma_standard_channel_map_default, pDecoder->internalChannels, pDecoder->internalChannelMap);
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