Working with Widgets > 2D > Audio
  
Audio
What Does This Widget Do?
The Audio widget allows you to play audio files within an experience. Supported file formats include:
.wav
.mp3
.mp4
When Should I Use This Widget?
Use an Audio widget when:
You want to include audio in your experience.
An experience requires a user to complete a task using both hands. For example, if a service technician is changing the oil on a generator, they could play audio of the procedure instead of having to read it on the device, or flip through a paper manual.
Are There Any Special Properties, Services, Events, or Actions?
To view a list of common widget properties, services, and events, see Common Widget Properties, Services, and Events.
The following tables list properties, services, and events that are specific to this widget.
Property
JavaScript
Type
Description
Audio Source
audiosrc
string
To include audio, you can do one of the following:
Click next to the field to add a new audio file.
Enter or copy and paste an audio URL directly into the field.
Select an audio file from the drop-down menu.
For information about linking to remote media, see Link to Remote Media.
Show Controls
showcontrols
boolean
Select whether or not to show the controls.
Preload
preload
string
Select what is preloaded:
Content
Metadata Only
None
Playing
isPlaying
boolean
Indicates whether the audio is playing.
Service
JavaScript
Description
Play
play
Bindable service that plays audio.
Pause
pause
Bindable service that pauses the audio.
Event
JavaScript
Description
Play Started
playStarted
Triggered when the audio begins.
Play Paused
playPaused
Triggered when the audio is paused.
Play Ended
playEnded
Triggered when the audio ends.
The Widget in Action
Here’s an example of what your widget might look like!
Minimum Steps Required for Use
What It Looks Like
1. Drag and drop an Audio widget onto the canvas.
2. Select or add an audio resource in the Audio Source field.
* 
For this example, we’ve chosen to show the content immediately upon opening the experience by selecting Content from the Preload drop-down in the DETAILS pane.