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
324ebe25
Commit
324ebe25
authored
Jan 07, 2023
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update documentation.
parent
e0a9bf1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
miniaudio.h
miniaudio.h
+10
-8
No files found.
miniaudio.h
View file @
324ebe25
...
@@ -845,7 +845,9 @@ read data within a certain range of the underlying data. To do this you can use
...
@@ -845,7 +845,9 @@ read data within a certain range of the underlying data. To do this you can use
```
```
This is useful if you have a sound bank where many sounds are stored in the same file and you want
This is useful if you have a sound bank where many sounds are stored in the same file and you want
the data source to only play one of those sub-sounds.
the data source to only play one of those sub-sounds. Note that once the range is set, everything
that takes a position, such as cursors and loop points, should always be relatvie to the start of
the range. When the range is set, any previously defined loop point will be reset.
Custom loop points can also be used with data sources. By default, data sources will loop after
Custom loop points can also be used with data sources. By default, data sources will loop after
they reach the end of the data source, but if you need to loop at a specific location, you can do
they reach the end of the data source, but if you need to loop at a specific location, you can do
...
@@ -874,7 +876,7 @@ To do this, you can use chaining:
...
@@ -874,7 +876,7 @@ To do this, you can use chaining:
return result; // Failed to set the next data source.
return result; // Failed to set the next data source.
}
}
result = ma_data_source_read_pcm_frames(&decoder1, pFramesOut, frameCount, pFramesRead
, MA_FALSE
);
result = ma_data_source_read_pcm_frames(&decoder1, pFramesOut, frameCount, pFramesRead);
if (result != MA_SUCCESS) {
if (result != MA_SUCCESS) {
return result; // Failed to read from the decoder.
return result; // Failed to read from the decoder.
}
}
...
@@ -885,8 +887,8 @@ the top level data source in the chain. In the example above, `decoder1` is the
...
@@ -885,8 +887,8 @@ the top level data source in the chain. In the example above, `decoder1` is the
source in the chain. When `decoder1` reaches the end, `decoder2` will start seamlessly without any
source in the chain. When `decoder1` reaches the end, `decoder2` will start seamlessly without any
gaps.
gaps.
Note that
the `loop` parameter is set to false in the example above. When this is set to true, only
Note that
when looping is enabled, only the current data source will be looped. You can loop the
the current data source will be looped. You can loop the
entire chain by linking in a loop like so:
entire chain by linking in a loop like so:
```c
```c
ma_data_source_set_next(&decoder1, &decoder2); // decoder1 -> decoder2
ma_data_source_set_next(&decoder1, &decoder2); // decoder1 -> decoder2
...
@@ -897,9 +899,9 @@ Note that setting up chaining is not thread safe, so care needs to be taken if y
...
@@ -897,9 +899,9 @@ Note that setting up chaining is not thread safe, so care needs to be taken if y
changing links while the audio thread is in the middle of reading.
changing links while the audio thread is in the middle of reading.
Do not use `ma_decoder_seek_to_pcm_frame()` as a means to reuse a data source to play multiple
Do not use `ma_decoder_seek_to_pcm_frame()` as a means to reuse a data source to play multiple
instances of the same sound simultaneously.
Instead, initialize multiple data sources for each
instances of the same sound simultaneously.
This can be extremely inefficient depending on the type
instance. This can be extremely inefficient depending on the data source and can result in
of data source and can result in glitching due to subtle changes to the state of internal filters.
glitching due to subtle changes to the state of internal filters
.
Instead, initialize multiple data sources for each instance
.
4.1. Custom Data Sources
4.1. Custom Data Sources
...
@@ -1064,7 +1066,7 @@ Note that when you're not using a device, you must set the channel count and sam
...
@@ -1064,7 +1066,7 @@ Note that when you're not using a device, you must set the channel count and sam
config or else miniaudio won't know what to use (miniaudio will use the device to determine this
config or else miniaudio won't know what to use (miniaudio will use the device to determine this
normally). When not using a device, you need to use `ma_engine_read_pcm_frames()` to process audio
normally). When not using a device, you need to use `ma_engine_read_pcm_frames()` to process audio
data from the engine. This kind of setup is useful if you want to do something like offline
data from the engine. This kind of setup is useful if you want to do something like offline
processing.
processing
or want to use a different audio system for playback such as SDL
.
When a sound is loaded it goes through a resource manager. By default the engine will initialize a
When a sound is loaded it goes through a resource manager. By default the engine will initialize a
resource manager internally, but you can also specify a pre-initialized resource manager:
resource manager internally, but you can also specify a pre-initialized resource manager:
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