SpeechTilesAndamento Docs
Get started
SDK Reference · Method

setAudioPlaybackVolume

Sets the runtime playback volume.

Declaration

public func setAudioPlaybackVolume(
    _ volume: Float,
    fadeMs: Int = 0
) -> STResult

Overview

Sets the runtime playback volume. Check the documented prerequisites, parameters and return value below. For asynchronous operations, use the relevant media events to observe actual completion rather than treating an accepted request as finished.

Parameters

volume

The requested playback volume.

The audio player validates the supported range and returns .audioPlaybackVolumeOutsideRange when the requested value is invalid.

fadeMs

The duration, in milliseconds, over which the volume change is applied.

Default: 0.

Return value

Returns .audioPlayerNotInitialized when the player is unavailable. Otherwise returns the result of applying the requested volume.

Base volume and duck volume

This method changes the playback volume itself. Temporary ducking is controlled separately with setAudioPlaybackDuckVolume(_:fadeMs:), allowing an application to reduce playback temporarily without losing its base playback-volume setting.

See Also