Contents

gain

The individual gain in decibels of the audio playback controller output.

Declaration

@MainActor @preconcurrency var gain: AudioPlaybackController.Decibel { get set }

Discussion

The gain must be zero or negative, where zero is nominal loudness and negative infinity is silent. If the gain is positive, it will be reset to zero.

Use the fade(to:duration:) method to change the gain gradually and create smooth transitions.

See Also

Setting the volume