Skip to main content
To learn more on how to add audio to your Rive file, see Audio Events.
This feature is currently only supported in the Legacy Runtime.

Embedded Assets

Embedded assets require no additional work to play audio.

Referenced Assets

Referenced assets require a little bit more work to play audio. Audio will still automatically play, but the audio file(s) must be loaded when a Rive runtime attempts to play audio. For more information, see Loading Assets.

Audio Settings

On iOS, playing audio will respect your AVAudioSession shared instance settings. For more information, see Apple’s documentation on AVAudioSession. Using this, you can choose to mix audio, duck audio, and more. You can update your shared instance early in your app lifecycle if you would like to ensure all Rive audio plays with the correct settings.
IOS
// Example: Ignore the silent switch, and mix with other audio
let category: AVAudioSession.Category = .playback
let options: AVAudioSession.CategoryOptions = [.mixWithOthers]
AVAudioSession.sharedInstance().setCategory(category, options: options)

Setting Volume

An artboard is capable of setting its volume. A parent artboard will set the volume of all component instances; however, setting a component’s volume will not update the parent’s volume.
IOS
// Set the current artboard's volume to 50%
let viewModel = RiveViewModel(fileName: "my_rive_file")
viewModel.riveModel?.volume = 0.5