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
182ae370
Commit
182ae370
authored
Mar 30, 2022
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the notion of samples rates to audio buffers.
parent
9c338c58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
miniaudio.h
miniaudio.h
+11
-4
No files found.
miniaudio.h
View file @
182ae370
...
...
@@ -9335,6 +9335,7 @@ typedef struct
ma_data_source_base ds;
ma_format format;
ma_uint32 channels;
ma_uint32 sampleRate;
ma_uint64 cursor;
ma_uint64 sizeInFrames;
const void* pData;
...
...
@@ -9358,6 +9359,7 @@ typedef struct
{
ma_format format;
ma_uint32 channels;
ma_uint32 sampleRate;
ma_uint64 sizeInFrames;
const void* pData; /* If set to NULL, will allocate a block of memory for you. */
ma_allocation_callbacks allocationCallbacks;
...
...
@@ -55200,7 +55202,7 @@ static ma_result ma_audio_buffer_ref__data_source_on_get_data_format(ma_data_sou
*pFormat = pAudioBufferRef->format;
*pChannels = pAudioBufferRef->channels;
*pSampleRate =
0; /* There is no notion of a sample rate with audio buffers. */
*pSampleRate =
pAudioBufferRef->sampleRate;
ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, pAudioBufferRef->channels);
return MA_SUCCESS;
...
...
@@ -55256,6 +55258,7 @@ MA_API ma_result ma_audio_buffer_ref_init(ma_format format, ma_uint32 channels,
pAudioBufferRef->format = format;
pAudioBufferRef->channels = channels;
pAudioBufferRef->sampleRate = 0; /* TODO: Version 0.12. Set this to sampleRate. */
pAudioBufferRef->cursor = 0;
pAudioBufferRef->sizeInFrames = sizeInFrames;
pAudioBufferRef->pData = pData;
...
...
@@ -55466,10 +55469,11 @@ MA_API ma_audio_buffer_config ma_audio_buffer_config_init(ma_format format, ma_u
ma_audio_buffer_config config;
MA_ZERO_OBJECT(&config);
config.format = format;
config.channels = channels;
config.format = format;
config.channels = channels;
config.sampleRate = 0; /* TODO: Version 0.12. Set this to sampleRate. */
config.sizeInFrames = sizeInFrames;
config.pData = pData;
config.pData
= pData;
ma_allocation_callbacks_init_copy(&config.allocationCallbacks, pAllocationCallbacks);
return config;
...
...
@@ -55498,6 +55502,9 @@ static ma_result ma_audio_buffer_init_ex(const ma_audio_buffer_config* pConfig,
return result;
}
/* TODO: Version 0.12. Set this in ma_audio_buffer_ref_init() instead of here. */
pAudioBuffer->ref.sampleRate = pConfig->sampleRate;
ma_allocation_callbacks_init_copy(&pAudioBuffer->allocationCallbacks, &pConfig->allocationCallbacks);
if (doCopy) {
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