AudioProvider component, which wraps an AudioSource to mix Rive’s audio output into the Unity audio pipeline.
Audio playback via
AudioProvider is not supported in WebGL builds. On WebGL, Rive automatically falls back to system audio instead of routing through Unity’s AudioSource.How it works
EachRiveWidget that plays a Rive file with audio needs access to an AudioProvider. By default, all widgets share a single global AudioProvider that is created automatically at runtime. No additional setup is required.
If you need more control (for example, to manage volume or audio mixer groups independently per widget), you can assign a custom AudioProvider to individual widgets.
Global Audio Provider
The globalAudioProvider is created automatically the first time a widget with audio needs it. It is shared across all RiveWidget instances that don’t have a custom provider assigned.
This is the recommended setup for most projects, and no additional configuration is required.
Custom Audio Provider
To use a customAudioProvider for a specific widget:
Add an
AudioProvider component to a GameObject in your scene. The AudioProvider component requires an AudioSource on the same GameObject. Unity will add one automatically.CustomAudioProvider to null reverts the widget to using the shared global provider.
Platform Notes
| Platform | Behavior |
|---|---|
| Editor / Standalone | Audio routed through Unity’s AudioSource via AudioProvider |
| iOS / Android | Audio routed through AudioSource; Play() is called automatically on start |
| WebGL | System audio is used; AudioProvider is not supported and will log a warning if added |
AudioProvider component reference
| Property | Description |
|---|---|
AudioSource | The AudioSource component used for audio playback. Required; automatically added with AudioProvider. |