mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-21 15:56:58 +02:00
Update documentation and add support for default buffer sizes and periods.
This commit is contained in:
@@ -19,10 +19,7 @@ Features
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
Asynchonous API
|
||||
---------------
|
||||
In asynchronous mode, mini_al will request and deliver audio data through callbacks.
|
||||
mini_al will request and deliver audio data through callbacks.
|
||||
|
||||
```
|
||||
mal_uint32 on_send_audio_data(mal_device* pDevice, mal_uint32 sampleCount, void* pSamples)
|
||||
@@ -34,11 +31,11 @@ int main()
|
||||
{
|
||||
mal_uint32 channels = 2;
|
||||
mal_uint32 sampleRate = 44100;
|
||||
mal_uint32 fragmentSizeInFrames = 512;
|
||||
mal_uint32 fragmentCount = 2;
|
||||
mal_uint32 bufferSizeInFrames = 512;
|
||||
mal_uint32 periods = 2;
|
||||
|
||||
mal_device playbackDevice;
|
||||
if (mal_device_init(&playbackDevice, mal_device_type_playback, NULL, mal_format_f32, channels, sampleRate, fragmentSizeInFrames, fragmentCount) != MAL_SUCCESS) {
|
||||
if (mal_device_init(&playbackDevice, mal_device_type_playback, NULL, mal_format_f32, channels, sampleRate, bufferSizeInFrames, periods) != MAL_SUCCESS) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user