From 2a928678c0455483cc626bdfdc5d0983656adcc8 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 24 May 2023 09:05:27 +1000 Subject: [PATCH] Update website. --- docs/examples/custom_backend.html | 22 +- docs/examples/custom_decoder.html | 2 +- docs/examples/custom_decoder_engine.html | 2 +- docs/examples/data_source_chaining.html | 2 +- docs/examples/duplex_effect.html | 2 +- docs/examples/engine_advanced.html | 2 +- docs/examples/engine_effects.html | 2 +- docs/examples/engine_hello_world.html | 2 +- docs/examples/engine_sdl.html | 2 +- docs/examples/engine_steamaudio.html | 2 +- docs/examples/hilo_interop.html | 423 +++++++++++++++++++ docs/examples/index.html | 4 +- docs/examples/node_graph.html | 2 +- docs/examples/resource_manager.html | 2 +- docs/examples/resource_manager_advanced.html | 2 +- docs/examples/simple_capture.html | 2 +- docs/examples/simple_duplex.html | 2 +- docs/examples/simple_enumeration.html | 2 +- docs/examples/simple_loopback.html | 2 +- docs/examples/simple_looping.html | 2 +- docs/examples/simple_mixing.html | 2 +- docs/examples/simple_playback.html | 2 +- docs/examples/simple_playback_sine.html | 2 +- docs/manual/index.html | 98 +---- 24 files changed, 478 insertions(+), 109 deletions(-) create mode 100644 docs/examples/hilo_interop.html diff --git a/docs/examples/custom_backend.html b/docs/examples/custom_backend.html index ed05ba7f..849d0221 100644 --- a/docs/examples/custom_backend.html +++ b/docs/examples/custom_backend.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Custom Backend

This example show how a custom backend can be implemented.

@@ -780,7 +780,7 @@ ma_format ma_format_from_sdl(MA_SDL_AudioFormat format) ((MA_PFN_SDL_QuitSubSystem)pContextEx->sdl.SDL_QuitSubSystem)(MA_SDL_INIT_AUDIO); /* Close the handle to the SDL shared object last. */ - ma_dlclose(pContext, pContextEx->sdl.hSDL); + ma_dlclose(ma_context_get_log(pContext), pContextEx->sdl.hSDL); pContextEx->sdl.hSDL = NULL; return MA_SUCCESS; @@ -810,7 +810,7 @@ ma_format ma_format_from_sdl(MA_SDL_AudioFormat format) /* Check if we have SDL2 installed somewhere. If not it's not usable and we need to abort. */ for (iName = 0; iName < ma_countof(pSDLNames); iName += 1) { - pContextEx->sdl.hSDL = ma_dlopen(pContext, pSDLNames[iName]); + pContextEx->sdl.hSDL = ma_dlopen(ma_context_get_log(pContext), pSDLNames[iName]); if (pContextEx->sdl.hSDL != NULL) { break; } @@ -821,13 +821,13 @@ ma_format ma_format_from_sdl(MA_SDL_AudioFormat format) } /* Now that we have the handle to the shared object we can go ahead and load some function pointers. */ - pContextEx->sdl.SDL_InitSubSystem = ma_dlsym(pContext, pContextEx->sdl.hSDL, "SDL_InitSubSystem"); - pContextEx->sdl.SDL_QuitSubSystem = ma_dlsym(pContext, pContextEx->sdl.hSDL, "SDL_QuitSubSystem"); - pContextEx->sdl.SDL_GetNumAudioDevices = ma_dlsym(pContext, pContextEx->sdl.hSDL, "SDL_GetNumAudioDevices"); - pContextEx->sdl.SDL_GetAudioDeviceName = ma_dlsym(pContext, pContextEx->sdl.hSDL, "SDL_GetAudioDeviceName"); - pContextEx->sdl.SDL_CloseAudioDevice = ma_dlsym(pContext, pContextEx->sdl.hSDL, "SDL_CloseAudioDevice"); - pContextEx->sdl.SDL_OpenAudioDevice = ma_dlsym(pContext, pContextEx->sdl.hSDL, "SDL_OpenAudioDevice"); - pContextEx->sdl.SDL_PauseAudioDevice = ma_dlsym(pContext, pContextEx->sdl.hSDL, "SDL_PauseAudioDevice"); + pContextEx->sdl.SDL_InitSubSystem = ma_dlsym(ma_context_get_log(pContext), pContextEx->sdl.hSDL, "SDL_InitSubSystem"); + pContextEx->sdl.SDL_QuitSubSystem = ma_dlsym(ma_context_get_log(pContext), pContextEx->sdl.hSDL, "SDL_QuitSubSystem"); + pContextEx->sdl.SDL_GetNumAudioDevices = ma_dlsym(ma_context_get_log(pContext), pContextEx->sdl.hSDL, "SDL_GetNumAudioDevices"); + pContextEx->sdl.SDL_GetAudioDeviceName = ma_dlsym(ma_context_get_log(pContext), pContextEx->sdl.hSDL, "SDL_GetAudioDeviceName"); + pContextEx->sdl.SDL_CloseAudioDevice = ma_dlsym(ma_context_get_log(pContext), pContextEx->sdl.hSDL, "SDL_CloseAudioDevice"); + pContextEx->sdl.SDL_OpenAudioDevice = ma_dlsym(ma_context_get_log(pContext), pContextEx->sdl.hSDL, "SDL_OpenAudioDevice"); + pContextEx->sdl.SDL_PauseAudioDevice = ma_dlsym(ma_context_get_log(pContext), pContextEx->sdl.hSDL, "SDL_PauseAudioDevice"); #else pContextEx->sdl.SDL_InitSubSystem = (ma_proc)SDL_InitSubSystem; pContextEx->sdl.SDL_QuitSubSystem = (ma_proc)SDL_QuitSubSystem; @@ -840,7 +840,7 @@ ma_format ma_format_from_sdl(MA_SDL_AudioFormat format) resultSDL = ((MA_PFN_SDL_InitSubSystem)pContextEx->sdl.SDL_InitSubSystem)(MA_SDL_INIT_AUDIO); if (resultSDL != 0) { - ma_dlclose(pContext, pContextEx->sdl.hSDL); + ma_dlclose(ma_context_get_log(pContext), pContextEx->sdl.hSDL); return MA_ERROR; } diff --git a/docs/examples/custom_decoder.html b/docs/examples/custom_decoder.html index 16e65251..037dddc8 100644 --- a/docs/examples/custom_decoder.html +++ b/docs/examples/custom_decoder.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Custom Decoder

Demonstrates how to implement a custom decoder.

diff --git a/docs/examples/custom_decoder_engine.html b/docs/examples/custom_decoder_engine.html index 9956af54..b80f69c7 100644 --- a/docs/examples/custom_decoder_engine.html +++ b/docs/examples/custom_decoder_engine.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Custom Decoder Engine

Demonstrates how to implement a custom decoder and use it with the high level API.

diff --git a/docs/examples/data_source_chaining.html b/docs/examples/data_source_chaining.html index f6457cf1..d6602115 100644 --- a/docs/examples/data_source_chaining.html +++ b/docs/examples/data_source_chaining.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Data Source Chaining

Demonstrates one way to chain together a number of data sources so they play back seamlessly without gaps. diff --git a/docs/examples/duplex_effect.html b/docs/examples/duplex_effect.html index ebb7a5c8..46b29a1d 100644 --- a/docs/examples/duplex_effect.html +++ b/docs/examples/duplex_effect.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {

+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Duplex Effect

Demonstrates how to apply an effect to a duplex stream using the node graph system.

diff --git a/docs/examples/engine_advanced.html b/docs/examples/engine_advanced.html index 83985987..9bb6a47b 100644 --- a/docs/examples/engine_advanced.html +++ b/docs/examples/engine_advanced.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Engine Advanced

This example demonstrates some of the advanced features of the high level engine API.

diff --git a/docs/examples/engine_effects.html b/docs/examples/engine_effects.html index cb2a0f3a..08a71d90 100644 --- a/docs/examples/engine_effects.html +++ b/docs/examples/engine_effects.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Engine Effects

Demonstrates how to apply an effect to sounds using the high level engine API.

diff --git a/docs/examples/engine_hello_world.html b/docs/examples/engine_hello_world.html index 0de07cf2..d7f1b35b 100644 --- a/docs/examples/engine_hello_world.html +++ b/docs/examples/engine_hello_world.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Engine Hello World

This example demonstrates how to initialize an audio engine and play a sound.

diff --git a/docs/examples/engine_sdl.html b/docs/examples/engine_sdl.html index 4e7e1a37..c381af14 100644 --- a/docs/examples/engine_sdl.html +++ b/docs/examples/engine_sdl.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Engine Sdl

Shows how to use the high level engine API with SDL.

diff --git a/docs/examples/engine_steamaudio.html b/docs/examples/engine_steamaudio.html index d73638c4..43f9183a 100644 --- a/docs/examples/engine_steamaudio.html +++ b/docs/examples/engine_steamaudio.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Engine Steamaudio

Demonstrates integration of Steam Audio with miniaudio's engine API.

diff --git a/docs/examples/hilo_interop.html b/docs/examples/hilo_interop.html new file mode 100644 index 00000000..b13ffa2b --- /dev/null +++ b/docs/examples/hilo_interop.html @@ -0,0 +1,423 @@ + + + + miniaudio - A single file audio playback and capture library. + + + + + + + + + + + + +
+
+ + + + + + + + + + +
+
+
+ + +
+

Hilo Interop

+Demonstrates interop between the high-level and the low-level API. +

+

+ +In this example we are using ma_device (the low-level API) to capture data from the microphone +which we then play back through the engine as a sound. We use a ring buffer to act as the data +source for the sound. +

+

+ +This is just a very basic example to show the general idea on how this might be achieved. In +this example a ring buffer is being used as the intermediary data source, but you can use anything +that works best for your situation. So long as the data is captured from the microphone, and then +delivered to the sound (via a data source), you should be good to go. +

+

+ +A more robust example would probably not want to use a ring buffer directly as the data source. +Instead you would probably want to do a custom data source that handles underruns and overruns of +the ring buffer and deals with desyncs between capture and playback. In the future this example +may be updated to make use of a more advanced data source that handles all of this.

+
+#define MINIAUDIO_IMPLEMENTATION
+#include "../miniaudio.h"
+
+static ma_pcm_rb rb;
+static ma_device device;
+static ma_engine engine;
+static ma_sound sound;  /* The sound will be the playback of the capture side. */
+
+void capture_data_callback(ma_device* pDevice, void* pFramesOut, const void* pFramesIn, ma_uint32 frameCount)
+{
+    ma_result result;
+    ma_uint32 framesWritten;
+
+    /* We need to write to the ring buffer. Need to do this in a loop. */
+    framesWritten = 0;
+    while (framesWritten < frameCount) {
+        void* pMappedBuffer;
+        ma_uint32 framesToWrite = frameCount - framesWritten;
+
+        result = ma_pcm_rb_acquire_write(&rb, &framesToWrite, &pMappedBuffer);
+        if (result != MA_SUCCESS) {
+            break;
+        }
+
+        if (framesToWrite == 0) {
+            break;
+        }
+
+        /* Copy the data from the capture buffer to the ring buffer. */
+        ma_copy_pcm_frames(pMappedBuffer, ma_offset_pcm_frames_const_ptr_f32(pFramesIn, framesWritten, pDevice->capture.channels), framesToWrite, pDevice->capture.format, pDevice->capture.channels);
+
+        result = ma_pcm_rb_commit_write(&rb, framesToWrite);
+        if (result != MA_SUCCESS) {
+            break;
+        }
+
+        framesWritten += framesToWrite;
+    }
+}
+
+int main(int argc, char** argv)
+{
+    ma_result result;
+    ma_device_config deviceConfig;
+
+    /*
+    The first thing we'll do is set up the capture side. There are two parts to this. The first is
+    the device itself, and the other is the ring buffer. It doesn't matter what order we initialize
+    these in, so long as the ring buffer is created before the device is started so that the
+    callback can be guaranteed to have a valid destination. We'll initialize the device first, and
+    then use the format, channels and sample rate to initialize the ring buffer.
+
+    It's important that the sample format of the device is set to f32 because that's what the engine
+    uses internally.
+    */
+
+    /* Initialize the capture device. */
+    deviceConfig = ma_device_config_init(ma_device_type_capture);
+    deviceConfig.capture.format = ma_format_f32;
+    deviceConfig.dataCallback = capture_data_callback;
+
+    result = ma_device_init(NULL, &deviceConfig, &device);
+    if (result != MA_SUCCESS) {
+        printf("Failed to initialize capture device.");
+        return -1;
+    }
+
+    /* Initialize the ring buffer. */
+    result = ma_pcm_rb_init(device.capture.format, device.capture.channels, device.capture.internalPeriodSizeInFrames * 5, NULL, NULL, &rb);
+    if (result != MA_SUCCESS) {
+        printf("Failed to initialize the ring buffer.");
+        return -1;
+    }
+
+    /*
+    Ring buffers don't require a sample rate for their normal operation, but we can associate it
+    with a sample rate. We'll want to do this so the engine can resample if necessary.
+    */
+    ma_pcm_rb_set_sample_rate(&rb, device.sampleRate);
+
+
+
+    /*
+    At this point the capture side is set up and we can now set up the playback side. Here we are
+    using ma_engine and linking the captured data to a sound so it can be manipulated just like
+    any other sound in the world.
+
+    Note that we have not yet started the capture device. Since the captured data is tied to a
+    sound, we'll link the starting and stopping of the capture device to the starting and stopping
+    of the sound.
+    */
+
+    /* We'll get the engine up and running before we start the capture device. */
+    result = ma_engine_init(NULL, &engine);
+    if (result != MA_SUCCESS) {
+        printf("Failed to initialize the engine.");
+        return -1;
+    }
+
+    /*
+    We can now create our sound. This is created from a data source, which in this example is a
+    ring buffer. The capture side will be writing data into the ring buffer, whereas the sound
+    will be reading from it.
+    */
+    result = ma_sound_init_from_data_source(&engine, &rb, 0, NULL, &sound);
+    if (result != MA_SUCCESS) {
+        printf("Failed to initialize the sound.");
+        return -1;
+    }
+
+    /* Make sure the sound is set to looping or else it'll stop if the ring buffer runs out of data. */
+    ma_sound_set_looping(&sound, MA_TRUE);
+
+    /* Link the starting of the device and sound together. */
+    ma_device_start(&device);
+    ma_sound_start(&sound);
+
+
+    printf("Press Enter to quit...\n");
+    getchar();
+
+    ma_sound_uninit(&sound);
+    ma_engine_uninit(&engine);
+    ma_device_uninit(&device);
+    ma_pcm_rb_uninit(&rb);
+
+
+    (void)argc;
+    (void)argv;
+    return 0;
+}
+
+
+ + + + + + + +
+ +
+ Copyright © 2023 David Reid
+ Developed by David Reid - mackron@gmail.com +
+ + diff --git a/docs/examples/index.html b/docs/examples/index.html index 1968163a..3fc12ac5 100644 --- a/docs/examples/index.html +++ b/docs/examples/index.html @@ -248,10 +248,10 @@ a.doc-navigation-l4 {
+without gaps.
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference
Custom BackendThis example show how a custom backend can be implemented.
Custom DecoderDemonstrates how to implement a custom decoder.
Custom Decoder EngineDemonstrates how to implement a custom decoder and use it with the high level API.
Data Source ChainingDemonstrates one way to chain together a number of data sources so they play back seamlessly -without gaps.
Duplex EffectDemonstrates how to apply an effect to a duplex stream using the node graph system.
Engine AdvancedThis example demonstrates some of the advanced features of the high level engine API.
Engine EffectsDemonstrates how to apply an effect to sounds using the high level engine API.
Engine Hello WorldThis example demonstrates how to initialize an audio engine and play a sound.
Engine SdlShows how to use the high level engine API with SDL.
Engine SteamaudioDemonstrates integration of Steam Audio with miniaudio's engine API.
Node GraphThis example shows how to use the node graph system.
Resource ManagerDemonstrates how you can use the resource manager to manage loaded sounds.
Resource Manager AdvancedDemonstrates how you can use the resource manager to manage loaded sounds.
Simple CaptureDemonstrates how to capture data from a microphone using the low-level API.
Simple DuplexDemonstrates duplex mode which is where data is captured from a microphone and then output to a speaker device.
Simple EnumerationDemonstrates how to enumerate over devices.
Simple LoopbackDemonstrates how to implement loopback recording.
Simple LoopingShows one way to handle looping of a sound.
Simple MixingDemonstrates one way to load multiple files and play them all back at the same time.
Simple PlaybackDemonstrates how to load a sound file and play it back using the low-level API.
Simple Playback SineDemonstrates playback of a sine wave.
Simple Playback SineDemonstrates playback of a sine wave.
Duplex EffectDemonstrates how to apply an effect to a duplex stream using the node graph system.
Engine AdvancedThis example demonstrates some of the advanced features of the high level engine API.
Engine EffectsDemonstrates how to apply an effect to sounds using the high level engine API.
Engine Hello WorldThis example demonstrates how to initialize an audio engine and play a sound.
Engine SdlShows how to use the high level engine API with SDL.
Engine SteamaudioDemonstrates integration of Steam Audio with miniaudio's engine API.
Hilo InteropDemonstrates interop between the high-level and the low-level API.
Node GraphThis example shows how to use the node graph system.
Resource ManagerDemonstrates how you can use the resource manager to manage loaded sounds.
Resource Manager AdvancedDemonstrates how you can use the resource manager to manage loaded sounds.
Simple CaptureDemonstrates how to capture data from a microphone using the low-level API.
Simple DuplexDemonstrates duplex mode which is where data is captured from a microphone and then output to a speaker device.
Simple EnumerationDemonstrates how to enumerate over devices.
Simple LoopbackDemonstrates how to implement loopback recording.
Simple LoopingShows one way to handle looping of a sound.
Simple MixingDemonstrates one way to load multiple files and play them all back at the same time.
Simple PlaybackDemonstrates how to load a sound file and play it back using the low-level API.
Simple Playback SineDemonstrates playback of a sine wave.
Simple Playback SineDemonstrates playback of a sine wave.
diff --git a/docs/examples/node_graph.html b/docs/examples/node_graph.html index 371e874c..5c32c561 100644 --- a/docs/examples/node_graph.html +++ b/docs/examples/node_graph.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Node Graph

This example shows how to use the node graph system.

diff --git a/docs/examples/resource_manager.html b/docs/examples/resource_manager.html index f863a3b1..adedcb92 100644 --- a/docs/examples/resource_manager.html +++ b/docs/examples/resource_manager.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Resource Manager

Demonstrates how you can use the resource manager to manage loaded sounds.

diff --git a/docs/examples/resource_manager_advanced.html b/docs/examples/resource_manager_advanced.html index bb25b1dd..06bc0f85 100644 --- a/docs/examples/resource_manager_advanced.html +++ b/docs/examples/resource_manager_advanced.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Resource Manager Advanced

Demonstrates how you can use the resource manager to manage loaded sounds.

diff --git a/docs/examples/simple_capture.html b/docs/examples/simple_capture.html index 98b1af96..3b6c7653 100644 --- a/docs/examples/simple_capture.html +++ b/docs/examples/simple_capture.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Simple Capture

Demonstrates how to capture data from a microphone using the low-level API.

diff --git a/docs/examples/simple_duplex.html b/docs/examples/simple_duplex.html index 5feabdfd..5d5d1804 100644 --- a/docs/examples/simple_duplex.html +++ b/docs/examples/simple_duplex.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Simple Duplex

Demonstrates duplex mode which is where data is captured from a microphone and then output to a speaker device.

diff --git a/docs/examples/simple_enumeration.html b/docs/examples/simple_enumeration.html index d4c1ec78..1ba2b756 100644 --- a/docs/examples/simple_enumeration.html +++ b/docs/examples/simple_enumeration.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Simple Enumeration

Demonstrates how to enumerate over devices.

diff --git a/docs/examples/simple_loopback.html b/docs/examples/simple_loopback.html index c9fbc077..06ecbbc4 100644 --- a/docs/examples/simple_loopback.html +++ b/docs/examples/simple_loopback.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Simple Loopback

Demonstrates how to implement loopback recording.

diff --git a/docs/examples/simple_looping.html b/docs/examples/simple_looping.html index 323b3357..f86d8363 100644 --- a/docs/examples/simple_looping.html +++ b/docs/examples/simple_looping.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Simple Looping

Shows one way to handle looping of a sound.

diff --git a/docs/examples/simple_mixing.html b/docs/examples/simple_mixing.html index a9e927cb..8758e368 100644 --- a/docs/examples/simple_mixing.html +++ b/docs/examples/simple_mixing.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Simple Mixing

Demonstrates one way to load multiple files and play them all back at the same time.

diff --git a/docs/examples/simple_playback.html b/docs/examples/simple_playback.html index 511c2aa5..ff825935 100644 --- a/docs/examples/simple_playback.html +++ b/docs/examples/simple_playback.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Simple Playback

Demonstrates how to load a sound file and play it back using the low-level API.

diff --git a/docs/examples/simple_playback_sine.html b/docs/examples/simple_playback_sine.html index bf57ded0..9edcb8c5 100644 --- a/docs/examples/simple_playback_sine.html +++ b/docs/examples/simple_playback_sine.html @@ -248,7 +248,7 @@ a.doc-navigation-l4 {
- - - - - - - - - - - - -
+Documentation HomeProgramming ManualExamplesCustom BackendCustom DecoderCustom Decoder EngineData Source ChainingDuplex EffectEngine AdvancedEngine EffectsEngine Hello WorldEngine SdlEngine SteamaudioHilo InteropNode GraphResource ManagerResource Manager AdvancedSimple CaptureSimple DuplexSimple EnumerationSimple LoopbackSimple LoopingSimple MixingSimple PlaybackSimple Playback SineSimple Playback SineAPI Reference

Simple Playback Sine

Demonstrates playback of a sine wave.

diff --git a/docs/manual/index.html b/docs/manual/index.html index b9c2922e..4fe4971d 100644 --- a/docs/manual/index.html +++ b/docs/manual/index.html @@ -836,16 +836,16 @@ 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 ma_engine_get_time(). -The engine's global time can be changed with ma_engine_set_time() for synchronization purposes if -required. Note that scheduling a start time still requires an explicit call to ma_sound_start() -before anything will play: +engine. The current global time time in PCM frames can be retrieved with +ma_engine_get_time_in_pcm_frames(). The engine's global time can be changed with +ma_engine_set_time_in_pcm_frames() for synchronization purposes if required. Note that scheduling +a start time still requires an explicit call to ma_sound_start() before anything will play:

-ma_sound_set_start_time_in_pcm_frames(&sound, ma_engine_get_time(&engine) + (ma_engine_get_sample_rate(&engine) * 2);
+ma_sound_set_start_time_in_pcm_frames(&sound, ma_engine_get_time_in_pcm_frames(&engine) + (ma_engine_get_sample_rate(&engine) * 2);
 ma_sound_start(&sound);
 

@@ -934,6 +934,11 @@ Note that GCC and Clang require -msse2

+If you get errors about undefined references to __sync_val_compare_and_swap_8, __atomic_load_8, +etc. you need to link with -latomic. +

+

+

@@ -1965,7 +1970,7 @@ base object (ma_data_source_base): // Retrieve the length in PCM frames here. Return MA_NOT_IMPLEMENTED and set *pLength to 0 if there is no notion of a length or if the length is unknown. } -static g_my_data_source_vtable = +static ma_data_source_vtable g_my_data_source_vtable = { my_data_source_read, my_data_source_seek, @@ -2617,10 +2622,10 @@ can be useful to schedule a sound to start or stop:

 // Start the sound in 1 second from now.
-ma_sound_set_start_time_in_pcm_frames(&sound, ma_engine_get_time(&engine) + (ma_engine_get_sample_rate(&engine) * 1));
+ma_sound_set_start_time_in_pcm_frames(&sound, ma_engine_get_time_in_pcm_frames(&engine) + (ma_engine_get_sample_rate(&engine) * 1));
 
 // Stop the sound in 2 seconds from now.
-ma_sound_set_stop_time_in_pcm_frames(&sound, ma_engine_get_time(&engine) + (ma_engine_get_sample_rate(&engine) * 2));
+ma_sound_set_stop_time_in_pcm_frames(&sound, ma_engine_get_time_in_pcm_frames(&engine) + (ma_engine_get_sample_rate(&engine) * 2));
 

Note that scheduling a start time still requires an explicit call to ma_sound_start() before @@ -2629,9 +2634,9 @@ anything will play.

The time is specified in global time which is controlled by the engine. You can get the engine's -current time with ma_engine_get_time(). The engine's global time is incremented automatically as -audio data is read, but it can be reset with ma_engine_set_time() in case it needs to be -resynchronized for some reason. +current time with ma_engine_get_time_in_pcm_frames(). The engine's global time is incremented +automatically as audio data is read, but it can be reset with ma_engine_set_time_in_pcm_frames() +in case it needs to be resynchronized for some reason.

@@ -4021,7 +4026,7 @@ used. The same general process applies to detachment. See 8. Decoding

The ma_decoder API is used for reading audio files. Decoders are completely decoupled from -devices and can be used independently. The following formats are supported: +devices and can be used independently. Built-in support is included for the following formats:

@@ -4030,83 +4035,25 @@ devices and can be used independently. The following formats are supported:

Format

-Decoding Backend

-

-Built-In

-

WAV

-dr_wav

-

-Yes

-

MP3

-dr_mp3

-

-Yes

-

FLAC

-dr_flac

-

-Yes

-

-Vorbis

-

-stb_vorbis

-

-No

-

-Vorbis is supported via stb_vorbis which can be enabled by including the header section before the -implementation of miniaudio, like the following: -

-

- -

-
-#define STB_VORBIS_HEADER_ONLY
-#include "extras/stb_vorbis.c"    // Enables Vorbis decoding.
-
-#define MINIAUDIO_IMPLEMENTATION
-#include "miniaudio.h"
-
-// The stb_vorbis implementation must come after the implementation of miniaudio.
-#undef STB_VORBIS_HEADER_ONLY
-#include "extras/stb_vorbis.c"
-

- -A copy of stb_vorbis is included in the "extras" folder in the miniaudio repository (https://github.com/mackron/miniaudio). -

-

- -Built-in decoders are amalgamated into the implementation section of miniaudio. You can disable the -built-in decoders by specifying one or more of the following options before the miniaudio -implementation: +You can disable the built-in decoders by specifying one or more of the following options before the +miniaudio implementation:

@@ -4117,8 +4064,8 @@ implementation: #define MA_NO_FLAC

-Disabling built-in decoding libraries is useful if you use these libraries independently of the -ma_decoder API. +miniaudio supports the ability to plug in custom decoders. See the section below for details on how +to use custom decoders.

@@ -4315,8 +4262,7 @@ opportunity to clean up and internal data.

9. Encoding

-The ma_encoding API is used for writing audio files. The only supported output format is WAV -which is achieved via dr_wav which is amalgamated into the implementation section of miniaudio. +The ma_encoding API is used for writing audio files. The only supported output format is WAV. This can be disabled by specifying the following option before the implementation of miniaudio: