On February 24, after more than a year of development, version 0.11.22 of the cross-platform audio capture and playback library was released. miniaudio, written in C and released as public domain.
miniaudio works on all major desktop and mobile platforms, including Windows, macOS, Linux, BSD, iOS, Android, and Web (via Emscripten) without any external dependencies.
The library features a simple, flexible, and modular API with built-in decoders (WAV, MP3, and FLAC), advanced mixing and effects processing (including 3D), resource management, filters, data conversion, and much more.
Key Changes:
- Starting from version 0.12, miniaudio will switch to a separate pair of .c/.h files, moving away from a single header file. To prepare for this, the file miniaudio.c has been added to the repository. Currently, it is just a 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 compilation. It is recommended to start transitioning from using MINIAUDIO_IMPLEMENTATION to using miniaudio.c. If you want to continue building your project as a single compilation unit, you can do #include "miniaudio.c". This method will be supported in version 0.12 and beyond.
- The files miniaudio_libvorbis.h and miniaudio_libopus.h in the extras directory are now deprecated. They are now split into separate .c and .h files in the extras/decoders directory. The old files still exist for compatibility, but you will need to switch to the new versions. The transition should be trivial.
- The options MA_SOUND_FLAG_LOOPING and MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_LOOPING have been added. They can be used for initializing sounds and managed resource data sources for default looping. This is the recommended way to enable looping for streams. The configuration options isLooping in ma_sound_config and ma_resource_manager_data_source_config have been deprecated. If you are using them, you should switch to the new options, otherwise, you will encounter compiler errors when upgrading to future versions.
- 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 the circular buffer does not have a concept of 'end', which made the result code unclear. Furthermore, these functions can return something other than MA_SUCCESS, even if the operation was successful, which added additional confusion. The correct way to check if there is still space in the circular buffer is to look at the frame counter returned by the rb_acquire_read/write() functions.
- The implementation of the data source ma_pcm_rb has been changed so that the output is filled with silence if there is insufficient data in the circular buffer to fulfill the request. This means that ma_data_source_read_pcm_frames() for ma_pcm_rb should no longer return a number of frames less than requested, and therefore will never return MA_AT_END, which makes no sense for a circular buffer as it has no concept of an end. This change should significantly simplify the use of the circular buffer as a data source for ma_sound.
- A small change has been made to the function ma_calculate_buffer_size_in_milliseconds_from_frames(), resulting in it returning a value rounded to the nearest integer.
- In the event of a failed decoder initialization, the first encountered error code is now returned instead of MA_NO_BACKEND regardless of the error as was previously the case.
- The function ma_device_id_equal() has been added to compare device identifiers.
- Support for MA_NO_RUNTIME_LINKING has been added in the AAudio backend.
- Documentation updated.
- Detected bugs have been fixed.
Source: linux.org.ru
