mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Update documentation.
This commit is contained in:
+13
-1
@@ -838,10 +838,17 @@ ma_sound_set_stop_time_in_milliseconds()
|
||||
The start/stop time needs to be specified based on the absolute timer which is controlled by the
|
||||
engine. The current global time time in PCM frames can be retrieved with <span style="font-family:monospace;">ma_engine_get_time()</span>.
|
||||
The engine's global time can be changed with <span style="font-family:monospace;">ma_engine_set_time()</span> for synchronization purposes if
|
||||
required.
|
||||
required. Note that scheduling a start time still requires an explicit call to <span style="font-family:monospace;">ma_sound_start()</span>
|
||||
before anything will play:
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</p>
|
||||
<div style="font-family:monospace; border:solid 1px #003800; border-left:solid 0.5em #003800; margin:1em 0em; width:100%;"><pre style="margin:0.5em 1em; padding:0; line-height:125%; overflow-x:auto;">
|
||||
ma_sound_set_start_time_in_pcm_frames(&sound, ma_engine_get_time(&engine) + (ma_engine_get_sample_rate(&engine) * 2);
|
||||
ma_sound_start(&sound);
|
||||
</pre></div><p>
|
||||
|
||||
The third parameter of <span style="font-family:monospace;">ma_sound_init_from_file()</span> is a set of flags that control how the sound be
|
||||
loaded and a few options on which features should be enabled for that sound. By default, the sound
|
||||
is synchronously loaded fully into memory straight from the file system without any kind of
|
||||
@@ -2533,6 +2540,11 @@ ma_sound_set_start_time_in_pcm_frames(&sound, ma_engine_get_time(&engine
|
||||
ma_sound_set_stop_time_in_pcm_frames(&sound, ma_engine_get_time(&engine) + (ma_engine_get_sample_rate(&engine) * 2));
|
||||
</pre></div><p>
|
||||
|
||||
Note that scheduling a start time still requires an explicit call to <span style="font-family:monospace;">ma_sound_start()</span> before
|
||||
anything will play.
|
||||
</p>
|
||||
<p>
|
||||
|
||||
The time is specified in global time which is controlled by the engine. You can get the engine's
|
||||
current time with <span style="font-family:monospace;">ma_engine_get_time()</span>. The engine's global time is incremented automatically as
|
||||
audio data is read, but it can be reset with <span style="font-family:monospace;">ma_engine_set_time()</span> in case it needs to be
|
||||
|
||||
Reference in New Issue
Block a user