Commit Graph

138 Commits

Author SHA1 Message Date
David Reid bb0d5506de Add an example for using effects with the engine. 2021-12-18 13:17:18 +10:00
David Reid fdc43c4c95 Minor updates to examples. 2021-12-18 13:14:57 +10:00
David Reid 0704e1fd24 Add a diagram for the node graph to documentation. 2021-12-15 19:41:55 +10:00
David Reid 13b905ca64 Add node graph example. 2021-12-15 18:10:43 +10:00
David Reid 9598247096 Remove old files and update examples. 2021-12-10 21:13:34 +10:00
David Reid dc912eb123 Fix some examples. 2021-12-10 07:03:25 +10:00
David Reid efa95d998f Remove the loop parameter from ma_data_source_read_pcm_frames(). 2021-10-13 18:51:17 +10:00
David Reid d177cb5e60 Update readme. 2021-08-14 19:18:26 +10:00
David Reid 2671e07560 Add examples for the high level API. 2021-08-14 18:41:26 +10:00
David Reid 369d3b8df7 Fix compilation errors with examples. 2021-07-31 10:22:20 +10:00
David Reid ce86d63181 Update simple_loopback example. 2021-07-28 17:34:54 +10:00
David Reid 33aae652fe API CHANGE: Update ma_get_standard_channel_map().
This adds a capacity parameter for added safety. It also changes the
order of parameters to make it a bit more consistent.
2021-07-04 19:46:00 +10:00
David Reid 3fad6cad86 API CHANGE: Add channel maps to ma_data_source_get_data_format().
This commit also removes the onGetChannelMap callback from the decoding
backend vtable.
2021-07-04 18:21:36 +10:00
David Reid 29ef420ee1 API CHANGE: Update ma_decoder_read_pcm_frames().
This makes ma_decoder_read_pcm_frames() consistent with other data
sources. It now returns a result code and outputs the number of frames
read via an output parameter.
2021-07-04 17:23:53 +10:00
David Reid 82f3b0eb7a API CHANGE: Remove unnecessary parameter from ring buffers.
This removes the `pBufferOut` parameter from the following APIs:

  * ma_rb_commit_read
  * ma_rb_commit_write
  * ma_pcm_rb_commit_read
  * ma_pcm_rb_commit_write
2021-07-04 16:03:52 +10:00
David Reid b1f64fdaf6 Update simple_playback example. 2021-07-01 17:05:31 +10:00
David Reid c54bb96964 Rename some config variables. 2021-07-01 14:58:05 +10:00
David Reid 9f4460797f Fix memory leaks. 2021-07-01 14:36:22 +10:00
David Reid 022b38517e Simplify the custom_decoder example. 2021-07-01 13:46:43 +10:00
David Reid 07fbb6ac6d Update custom_decoder example. 2021-06-30 20:43:05 +10:00
David Reid dad754b745 Add support for custom decoding backends.
Public issue https://github.com/mackron/miniaudio/issues/311
2021-06-27 21:43:31 +10:00
David Reid ea84294d97 Fix the custom_backend example. 2021-06-24 19:23:30 +10:00
David Reid 5551dc67e1 Update wording in example. 2021-06-24 19:07:33 +10:00
David Reid 595ba3f729 Update wording in example. 2021-06-24 18:52:33 +10:00
David Reid 46a033b43a Initial work on custom loop points and chaining for data sources.
This is locked behind the following compile time macro for now since
it'll involve breaking changes to custom data sources. This will be
removed in version 0.11:

  MA_EXPERIMENTAL__DATA_LOOPING_AND_CHAINING

Public issue https://github.com/mackron/miniaudio/issues/290
2021-05-16 15:36:20 +10:00
David Reid c715ead0e8 Minor simplification to the custom backend example. 2021-01-31 10:17:28 +10:00
David Reid 7fd98209ef Migrate the WebAudio backend over to the new callback system.
This changes a few things for custom backends and the calculation of
the size of the buffer. See the custom_backend example.
2020-11-17 20:43:29 +10:00
David Reid db0442fb78 Migrate the WASAPI backend over to the new callback system.
This includes changes to callbacks used by custom backends. It adds a
`pConfig` parameter to both onContextInit and onDeviceInit. This allows
custom backends to specify custom config properties.
2020-11-15 15:41:15 +10:00
David Reid a5bd015936 Explicitly set native data format flags in custom backend example. 2020-11-08 19:15:45 +10:00
David Reid dd8f6c4c66 Fix warnings on the Emscripten build. 2020-11-08 14:37:40 +10:00
David Reid 887bbeeeee Add support for custom backends.
This commit includes a few changes required for better supporting this:

  * Extra members have been added to ma_device_info which are going to
    eventually replace the min and max channels and sample rates. The
    new system is going to provide a list of supported data formats,
    groups by format/channels/rate and some flags. The only flag used
    at the moment is whether or not the format is usable in exclusive
    mode. The custom backend is the only backend currently using these
    new device info properties, and a backwards-compatibility layer has
    been implemented to fill out the old properties. Built-in backends
    will be migrated over to the new system in time.

  * A new set of backend callbacks have been implemented. Only the
    custom backend is using these at the moment. Built-in backends will
    be migrated over to these new backends soon.

  * A new public API called ma_device_get_state() has been added which
    returns the current state of the device (whether or not it's
    started or stopped). This is necessary for some custom backends.

  * A new public API called ma_device_handle_backend_data_callback()
    has been added. This is required for custom backends who use the
    callback paradigm for data delivery.

  * A new type of ring buffer has been created called ma_duplex_rb.
    This is used as an intermediary buffer for duplex devices running
    on backends that use the callback paradigm. It's used internally by
    ma_device_handle_backend_data_callback(). In the future it's
    planned to expand ma_duplex_rb to handle desyncs by dynamically
    resampling to get both sides back in sync. This is not implemented
    as of this commit.

Future work will involve converting existing built-in backends to be
consistent with the new ideas introduced with custom backend support.
2020-11-08 14:25:55 +10:00
David Reid 4f78581a92 Update wording in simple_duplex example. 2020-07-25 15:42:25 +10:00
David Reid 8be8e3bb00 Update examples building readme. 2020-07-16 08:45:15 +10:00
David Reid 3d82237ee2 Update documentation for examples. 2020-07-15 21:29:16 +10:00
David Reid 82a1410ec5 Fix compilation errors with MA_NO_DECODING and MA_NO_ENCODING. 2020-06-25 06:54:28 +10:00
David Reid 6f748942e6 Update examples and tests. 2020-06-24 19:37:46 +10:00
David Reid 4b23beb1f0 Fix example from recent API change. 2020-06-23 20:29:20 +10:00
David Reid e0294ac74c Fix a bug in fixed_sized_callback.
This is uninitializing the ring buffer before the device which results
in a situation where a stray data callback may try touching the buffer
after it's be uninitialized.
2020-06-23 19:55:46 +10:00
David Reid 86181dfac8 Updates to data sources.
* ma_data_source_read_pcm_frames and ma_data_source_seek_pcm_frames
    now return a result code and output the frames read/seeked as an
    output parameter.
  * These return MA_AT_END if the end of the data source has been
    reached. This should never be returned if the loop parameter is set
    to true.
2020-06-10 22:01:55 +10:00
David Reid 803cd284bc Shorten a comment for easier viewing. 2020-05-29 19:51:37 +10:00
David Reid 967174368e Add looping example. 2020-05-29 19:50:04 +10:00
David Reid 169132de39 Fix formatting in examples build readme. 2020-05-21 20:19:22 +10:00
David Reid e438ab0c9c Update loopback example to use the ma_encoder API. 2020-04-23 17:30:49 +10:00
David Reid 3645d9b0fd Update capture example to use the ma_encoder API. 2020-04-23 17:13:34 +10:00
David Reid 63c5cf851e Fix a typo. 2020-04-09 07:53:38 +10:00
David Reid f2dd3159f9 Update build command line examples to be consistent with each other. 2020-03-07 10:20:24 +10:00
David Reid 000180baf4 Silence a warning on the Emscripten build. 2020-03-07 10:16:53 +10:00
David Reid a4faf3daaa Remove unnecessary placeholder file. 2020-03-03 19:17:29 +10:00
David Reid 98a28d3c72 Example build scripts are no longer being maintained.
See the readme for an example build script for GCC and Emscripten.
2020-03-03 19:02:29 +10:00
David Reid f6665cdd73 Move the examples readme into the build folder. 2020-03-03 19:01:36 +10:00