Smoothing is disabled by default. To enable it, you must use
ma_sound_init_ex() and configure it via the volumeSmoothTimeInPCMFrames
member of ma_sound_config.
This commit also fixes a bug where ma_gainer is not properly applying
smoothing.
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.
With this commit, the device IO code is now using the new vtable
system, but each of the stock backends are still using the old
callbacks internally. There exists a compatibility wrapper vtable
which all stock backends are currently using. As stock backends migrate
over to the new system, the compatiblity vtable will be replaced with
the backend-specific vtable.
The new system is in preparation for improving the custom backend
system and making it more modular. The old system does not support
user data which make things a bit less flexible than it should be. In
addition, the old system does not make it easy to plug in multiple
custom backends.
The changes in this commit, and probably the next few, are just
scaffolding so that we don't have to break the build of every platform
as this is worked on.
* The pDoneFence parameter has been removed from ma_sound_init_*()
and replaced with pNotifications which is of the type
ma_sound_notifications. This object is where the pDoneFence is
now located.
* ma_sound_set_end_callback() has been removed. The callback is now
specified in the pNotifications object.
* The endCallback and pEndCallbackUserData members of ma_sound_config
have been removed. You must now specify this in pNotifications.
A node graph should not be considered a node because a node needs to
be owned by a node graph which means a node graph being a node would
create a cyclic dependency.
This adds a `ma_engine*` parameter to the following functions:
* ma_sound_config_init()
* ma_sound_group_config_init()
The following functions have been removed (use the above functions
instead):
* ma_sound_config_init_2()
* ma_sound_group_config_init_2()
The "dry" parameter was equivalent to pre-multiplying the input, and
the "wet" parameter was equivalent to multiplying the output. Do this
if you are needing to replicate the old functionality.
Public issue https://github.com/mackron/miniaudio/issues/548
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.
* ma_engine_get_time_in_pcm_frames() (replaces ma_engine_get_time())
* ma_engine_get_time_in_milliseconds()
* ma_engine_set_time_in_pcm_frames() (replaces ma_engine_set_time())
* ma_engine_set_time_in_milliseconds()
These changes are consistent with the naming of other time based
functions, eliminates ambiguity and just makes it clearer as to what
you're working with.
ma_engine_get_time() and ma_engine_set_time() have been deprecated.
This is not pre-initializing the variable that receives the number of
bytes read to 0 which can result in custom VFS implementations
returning an invalid value if they return early from an error or
whatnot.