Skip to content

Releases: mackron/miniaudio

Version 0.11.22

24 Feb 06:43
Compare
Choose a tag to compare

v0.11.22 - 2025-02-24

  • Starting from version 0.12, miniaudio will be switching to a split .c/h pair, away from a single header. In preparation for this, a file named "miniaudio.c" has been added to repository. Currently this is just a simple wrapper around miniaudio.h and MINIAUDIO_IMPLEMENTATION. Nothing has changed in miniaudio.h, however when version 0.12 is released you will need to use miniaudio.c for the implementation. It's recommended you start the transition away from MINIAUDIO_IMPLEMENTATION and towards miniaudio.c. If you want to keep building your project as a single translation unit, you can do #include "miniaudio.c" which will continue to be supported with version 0.12 and beyond.
  • In the extras folder, the miniaudio_libvorbis.h and miniaudio_libopus.h files have been deprecated. They have been replaced with versions in the extras/decoders folder. They are now split into a separate .c and .h files. The old files still exist for compatibility, but you need to transition over to the new versions. The transition should be trivial. Compile the .c files like a normal source file, and include the .h file like a normal header.
  • Add MA_SOUND_FLAG_LOOPING and MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_LOOPING flags. These can be used to initialize sounds and resource managed data sources to loop by default. This is the recommended way to enable looping for streams. The isLooping config option in ma_sound_config and ma_resource_manager_data_source_config has been deprecated. If you are using those, you should switch to the new flag or else you'll get compiler errors when upgrading to a future version.
  • ma_rb_commit_read(), ma_rb_commit_write(), ma_pcm_rb_commit_read() and ma_pcm_rb_commit_write() no longer return MA_AT_END. The reason for this change is that there's no real notion of an "end" in a ring buffer which makes this result code confusing. In addition, it's possible for these functions to return something other than MA_SUCCESS even when the operation completed successfully which adds to the confusion. The correct way to check if there is any more room in the ring buffer is to look at the frame count returned by *rb_acquire_read/write().
  • The ma_pcm_rb data source implementation has been modified to pad output data with silence if there is not enough data in the ring buffer to fill the request. What this means is for an ma_pcm_rb, ma_data_source_read_pcm_frames() should no longer return a frame count of less than what you requested, and will therefore never return MA_AT_END which does not make sense for a ring buffer since it does not have the notion of an end. This change should make it much easier to use a ring buffer as the data source for a ma_sound.
  • There has been a minor change to ma_calculate_buffer_size_in_milliseconds_from_frames() to have it return a value rounded up to the nearest integer.
  • When initialization of a decoder fails, it will now return the first error code encountered rather than always returning MA_NO_BACKEND regardless of the error.
  • Add ma_device_id_equal() for comparing device IDs.
  • Add support for MA_NO_RUNTIME_LINKING to the AAudio backend.
  • Fix a buffer overrun bug with ma_sound processing.
  • Fix a bug relating to node detachment.
  • Fix a bug where amplification with ma_device_set_master_volume() does not work.
  • Fix a bug where sounds loaded with MA_SOUND_FLAG_DECODE do not loop.
  • Fix a bug with initialization of the band pass biquad filter.
  • Fix a bug where a device would output distorted audio if initialized without a data callback.
  • Fix various compiler and static analysis warnings.
  • Various documentation updates.
  • WASAPI: Fix an error when stopping the device. The "Failed to reset internal playback device." error should be significantly reduced in frequency.
  • WASAPI: Fix an error when stopping the device where it was possible miniaudio would not wait for the device to be drained due to an error with the wait time calculation.
  • WASAPI: Fix a COM related crash with device rerouting.
  • DirectSound: Add support for specifying an explicit window handle for SetCooperativeLevel().
  • ALSA: Fix a bug where a playback device can fail to start.
  • ALSA: Fix some warnings relating to unhandled return value of read().
  • Web: Fix ScriptProcessorNode path when compiling with --closure=1. Note that the Audio Worklets path is not currently working due to the callback specified in emscripten_create_wasm_audio_worklet_processor_async never getting fired.
  • Web: Fix an error with the unlocked notification when compiling as C++.
  • Web: Fix a JavaScript error when initializing and then uninitializing a context before any interactivity.
  • Web: miniaudio will now enable threading when the -pthread command line flag is used.
  • Web: Infrastructure has been added to support configurable buffer sizes. In practice this is still restricted to 128 frames, but once Emscripten adds full support for configuration of the buffer size, it will be trivial to add support to miniaudio.
  • AAudio: Fix some crashes relating to stream rerouting.
  • AAudio: Fix an error where the device is silenced after rerouting. With this change, miniaudio will no longer give AAudio a hint to use your supplied period size which will therefore result in AAudio using its default latency configuration. If you want AAudio to try to use the period size you supply in the device config, which is the old behaviour, set aaudio.allowSetBufferCapacity to true in the device config. Note, however, if you do this you may end up with errors when rerouting between devices.
  • AAudio: The default minimum SDK version has been increased from 26 to 27 when enabling AAudio. If you need to support version 26, you can use #define MA_AAUDIO_MIN_ANDROID_SDK_VERSION 26.
  • AAudio: Fix ma_device_get_info() implementation.
  • AAudio: Fix an error when an assertion can trigger due to AAudio reporting a frame count of 0.
  • PulseAudio: Add a configuration option to control the PulseAudio-defined channel map to use.
  • PulseAudio: Fix an extremely unlikely race condition with device initialization.
  • PulseAudio: Fix a bug with the miniaudio-generated stream name. Previously this would create names like "miniaudi0" when it was supposed to be "miniaudio:0".
  • iOS: Fix an error when trying to capture audio from the simulator with iOS version 16 and newer.
  • sndio: Fix a crash with device uninitialization.