The volume factor must be between 0 (silence) and 1 (full volume). Use ma_device_set_master_gain_db() to
The volume factor must be between 0 (silence) and 1 (full volume). Use `ma_device_set_master_gain_db()` to use decibel notation, where 0 is full volume and
use decibel notation, where 0 is full volume.
values less than 0 decreases the volume.
This applies the volume factor across all channels.
This does not change the operating system's volume. It only affects the volume for the given ma_device
Parameters
object's audio stream.
----------
pDevice (in)
A pointer to the device whose volume is being set.
volume (in)
The new volume factor. Must be within the range of [0, 1].
Return Value
Return Value
------------
------------
MA_SUCCESS if the volume was set successfully.
MA_SUCCESS if the volume was set successfully.
MA_INVALID_ARGS if pDevice is NULL.
MA_INVALID_ARGS if pDevice is NULL.
MA_INVALID_ARGS if the volume factor is not within the range of [0, 1].
MA_INVALID_ARGS if the volume factor is not within the range of [0, 1].
Thread Safety
-------------
Safe. This just sets a local member of the device object.
Callback Safety
---------------
Safe. If you set the volume in the data callback, that data written to the output buffer will have the new volume applied.
Remarks
-------
This applies the volume factor across all channels.
This does not change the operating system's volume. It only affects the volume for the given `ma_device` object's audio stream.