On February 24, after more than a year of development, 0.11.22 of the cross-platform audio capture and playback library was released miniaudio, written in C and distributed in the public domain.
miniaudio runs on all major desktop and mobile platforms, including Windows, macOS, Linux, BSD, iOS, Android and Web (via Emscripten) without third-party dependencies.
The library has 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.
Major changes:
- Starting with version 0.12, miniaudio will be moving to a separate pair of .c/h files, instead of a single header file. In preparation for this, miniaudio.c has been added to the repository. At the moment, it is just a wrapper around miniaudio.h and MINIAUDIO_IMPLEMENTATION. Nothing has changed in miniaudio.h, however, when version 0.12 comes out, you will need to use miniaudio.c for compilation. It is recommended to start migrating from using MINIAUDIO_IMPLEMENTATION to using miniaudio.c. If you want to continue building your project as a single compilation unit, you can #include "miniaudio.c". This method will be supported in version 0.12 and beyond.
- The miniaudio_libvorbis.h and miniaudio_libopus.h files in the extras directory have been deprecated. They have now been split into separate .c and .h files in the extras/decoders directory. The old files still exist for compatibility, but you will need to migrate to the new versions. The migration should be trivial.
- Added MA_SOUND_FLAG_LOOPING and MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_LOOPING options. 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 configuration options in ma_sound_config and ma_resource_manager_data_source_config have been deprecated. If you use them, you should migrate to the new options or you will 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 is no concept of "end" in the ring buffer, making the result code unclear. Additionally, these functions may return something other than MA_SUCCESS even if the operation succeeded, adding further confusion. The proper way to check if there is still room in the ring buffer is to look at the frame counter returned by rb_acquire_read/write().
- The implementation of the ma_pcm_rb data source has been changed so that the output is filled with silence if there is not enough data in the ring buffer to fulfill the request. This means that ma_data_source_read_pcm_frames() for ma_pcm_rb should no longer return fewer frames than you requested, and will therefore never return MA_AT_END, which makes no sense for a ring buffer since it has no concept of an end. This change should make it much easier to use the ring buffer as a data source for ma_sound.
- A small change was made to the ma_calculate_buffer_size_in_milliseconds_from_frames() function so that it returns a value rounded to the nearest integer.
- If the decoder initialization fails, the first error code encountered is now returned, rather than MA_NO_BACKEND regardless of the error, as was previously the case.
- Added ma_device_id_equal() function for comparing device IDs.
- Added support for MA_NO_RUNTIME_LINKING to AAudio backend.
- Updated documentation.
- The detected errors have been fixed.
Source: linux.org.ru
