Update documentation and add support for default buffer sizes and periods.

This commit is contained in:
David Reid
2016-10-21 10:33:13 +10:00
parent 5cbbf0b988
commit 46aaa53f2c
2 changed files with 123 additions and 29 deletions
+4 -7
View File
@@ -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;
}