Commit Graph

193 Commits

Author SHA1 Message Date
David Reid 3541d1b8cc Merge branch 'dev' into dev-0.12 2025-02-22 12:06:45 +10:00
David Reid c13504629e Minor update to custom_backend example. 2025-02-22 09:35:16 +10:00
David Reid 562b3483d1 Merge branch 'dev' into dev-0.12 2025-02-21 20:21:02 +10:00
David Reid e3151f2df1 Silence an unreachable code warning with MSVC. 2025-02-19 12:32:12 +10:00
David Reid 0ea924ae7a Merge branch 'dev' into dev-0.12 2025-02-19 12:09:13 +10:00
David Reid 8ad250ccf6 Updates to custom decoders. 2025-02-19 12:02:37 +10:00
David Reid eee86a0ae1 Fix the C++ build for some examples. 2025-02-19 08:28:01 +10:00
David Reid 724dac6af1 Fix compilation errors. 2025-02-18 18:26:07 +10:00
David Reid 391cca6e79 Merge branch 'dev' into dev-0.12 2025-02-18 18:03:01 +10:00
David Reid 46788d59a8 Rework the libvorbis and libopus custom decoders.
These decoders have been moved into their own subfolders under the
extras/decoders folder:

  extras/decoders/libvorbis
  extras/decoders/libopus

In addition to being relocated, they have also been split into separate
.c/h pairs. They now work like a more conventional library. The
implementation of these libraries have also been decoupled from the
miniaudio implementation which means they depend only on the header
section of miniaudio.h now.

With this change the custom_decoder and custom_decoder_engine examples
have been updated. To compile these you now need to link in the
miniaudio_libvorbis.c and miniaudio_libopus.c files via your build
tool. For your own code, you can still include the .c files directly
into your code if you want to compile as a single translation unit.
2025-02-17 16:57:47 +10:00
David Reid 01d6297bec Fix some warnings with some more examples. 2025-02-17 16:52:54 +10:00
David Reid de5f370d09 Fix some warnings with examples. 2025-02-17 16:01:19 +10:00
David Reid ca3ecd9086 Merge branch 'dev' into dev-0.12 2025-02-08 07:21:38 +10:00
David Reid fc905ec97f Add simple_spatialization example. 2025-01-11 18:42:34 +10:00
David Reid 33499941ae Merge branch 'dev' into dev-0.12 2025-01-11 17:03:23 +10:00
David Reid fcddfe6204 Update ma_pcm_rb data source implementation.
The data source implementation of a ma_pcm_rb could possibly return a
frame count of 0 which would in turn result in
ma_data_source_read_pcm_frames() returning MA_AT_END which does not
make sense for a ring buffer since it has no notion of an end.
2025-01-11 16:30:15 +10:00
David Reid f581a23f30 Fix a comment. 2024-03-01 09:35:01 +10:00
David Reid 5a0d1ad433 Merge branch 'dev' into dev-0.12 2024-03-01 08:37:16 +10:00
RainRat 030b9554c2 fix typos 2024-03-01 08:35:45 +10:00
David Reid f07c4cd3a1 Update engine_custom_decoder example. 2024-03-01 07:55:41 +10:00
David Reid d10a287f23 Rename custom_decoder_engine example to engine_custom_decoder.
This just makes it easier to find engine related examples in the
example list.
2024-03-01 07:30:08 +10:00
David Reid 61ec4b17c6 Update docs and add support for backend-specific userdata for decoders. 2024-03-01 07:06:54 +10:00
David Reid 8c2398b1ef Update the custom decoder example. 2024-02-29 16:01:27 +10:00
David Reid 9a6eefd4a8 Rename some variables in preparation for changes to decoding backends. 2024-02-29 15:35:37 +10:00
David Reid 5888bfadca Merge branch 'dev' into dev-0.12 2024-02-29 14:35:46 +10:00
David Reid 3bdf611768 Fix an invalid comment. 2024-02-29 14:30:48 +10:00
David Reid feea26496c Update Steam Audio example. 2024-02-28 17:17:13 +10:00
David Reid e3af234720 Silence a warning in the node graph example. 2024-02-28 08:15:13 +10:00
David Reid 5cb0c05675 Update Steam Audio example to work with latest version. 2024-02-28 08:10:34 +10:00
David Reid f01ce432be Merge branch 'dev' into dev-0.12 2024-02-25 09:37:21 +10:00
David Reid 766a155fb3 Stop using MA_ASSERT in examples.
This is useful because MA_ASSERT is only defined in the implementation
section of miniaudio.h which can cause issues when people copy/paste
the code and use it in a file that does not have visibility of the
implementation.

Note that there are still more references to implementation-defined
macros, but these have been moved to the public section in the dev-0.12
branch so I'm not bothering to change those just yet.

Public issue https://github.com/mackron/miniaudio/issues/787
2023-12-17 08:42:19 +10:00
David Reid 7ed8b8c5a5 Merge branch 'master' into dev-0.12 2023-11-04 07:07:28 +10:00
David Reid 537c4ca36c Update the simple_playback_sine example. 2023-09-05 06:48:49 +10:00
David Reid 7e01c6535b More work on custom device backends.
With this commit, custom backends can now be implemented as
self-contained modules that can easily be plugged in and mixed and
matched depending on a programs requirements. The order in which
custom backends are specified in the context config determine their
priority.

This commit updates the custom_backend example by moving the SDL
code out into its own file in "extras/backends/sdl". The example will
now just include the SDL code files like normal. This represents a more
realistic scenario.
2023-08-07 16:14:05 +10:00
David Reid 7266a1a6da Merge branch 'master' into dev-0.12 2023-08-07 11:06:21 +10:00
David Reid 810cdc2380 Improvements to Audio Worklets support for Web Audio.
Public issue https://github.com/mackron/miniaudio/issues/597
2023-08-05 17:02:26 +10:00
David Reid 04ab2a2d7b Merge branch 'dev' into dev-0.12 2023-05-27 15:45:00 +10:00
David Reid a8f3cb857e Fix compilation errors with MA_NO_DEVICE_IO. 2023-05-22 18:09:04 +10:00
David Reid 58166e2267 API CHANGE: Updates to custom backends.
Custom backends must now use the `ma_device_backend_vtable` object to
define their callbacks. All of these functions are largely the same,
except they all now take a `void*` as their first parameter which
represents the user data pointer.

The ma_backend_callbacks parameter has been removed from onContextInit
which means you must now statically define your callbacks in the
ma_device_backend_vtable object that you pass into the context config.

The `custom` member of the context config has been replaced with a new
set of members to support the ability to plug in multiple vtables.
2023-04-01 12:06:52 +10:00
David Reid 4cd066807b Add an example for high- and low-level interop.
This example captures data from the microphone using the low-level API
and then plays back the data through the engine. The intermediary data
source is a ring buffer.
2023-03-25 12:08:11 +10:00
David Reid 1f37940923 Minor improvement to the simple_playback_sine example. 2023-02-28 11:23:24 +10:00
David Reid 25885e4163 WebAudio: Add early experimental support for AudioWorklets.
Public issue https://github.com/mackron/miniaudio/issues/597.
2023-02-25 20:37:26 +10:00
cdigit 6de98570f6 Update duplex_effect.c 2023-01-14 10:33:24 +11:00
David Reid 034cc5f82a Fix engine_advanced example. 2022-10-02 13:20:29 +10:00
David Reid 9589a62f0c Fix example. 2022-01-20 17:20:26 +10:00
David Reid 3a3616e0ee Update Steam Audio example. 2022-01-03 16:37:16 +10:00
David Reid 7ee6d1d792 Add support for configuring the size of input caches in nodes.
This is important for fixed sized processing.
2022-01-01 21:31:06 +10:00
David Reid f3915423b6 Update the Steam Audio example. 2022-01-01 21:20:13 +10:00
David Reid cba36680bd Add support for fixed sized data callbacks.
This is the new default. The size of the buffer will be based on the
periodSizeInFrames and periodSizeInMilliseconds config variable. To go
back to the previous system, where the data callback could specify any
number of frames, set the noFixedSizedCallback config variable to true.
2022-01-01 21:14:22 +10:00
David Reid 2ad40dc7da Minor rewording and fix a typo. 2022-01-01 16:25:36 +10:00