Audio and Video Puzzles
These puzzles are used to load and play back audio and video files.
Loads an audio file using a specified URL. The audio is played via the HTML5 Audio tag or WebAudio API depending on the chosen type: music or sound respectively. This puzzle also adds the loaded audio to a memory cache so that any subsequent uses of this puzzle with the same URL do not load the same sound file again. Using .mp3 format is recommended as it is supported by most web browsers.
"music" vs "sound" audio type
This puzzle allows you to choose which API to use for loading and playing audio files.
- music (default, HTML5 Audio tag) - should be used most of the time; suits better for long audio files, e.g. background music
sound (WebAudio API) - suits better for short audio files, e.g.
small sound effects; it's recommended to use this type only in the
- short looped (see the play puzzle and its loop option) sound effects - "sound" makes looped audio seamless, while with "music" you have a noticeable delay
- sound effects that should be played immediately, e.g. on user interaction, experience a delay on Safari - "sound" fixes this issue
Web Audio API which the sound type utilizes is supported in most modern browsers. However, if you need your audio to work in browsers with no Web Audio support (e.g. Internet Explorer 11) you have to use the music type.
Creates an HTML5 video element and loads a sound file using a specified URL. This puzzle also adds the created video element to a memory cache so that any subsequent uses of this puzzle with the same URL do not load the same sound file again. Using .mp4 format is recommended as it is supported by most web browsers.
The load video puzzle does not create any visible elements on your scene. To make it visible, assign video texture to your materials using the replace texture puzzle.
Starts audio or video playback. The loop checkbox repeats playback if enabled.
Due to browser restrictions (preventing malicious websites from playing noisy sounds and videos) you should not execute this puzzle to play your assets automatically (upon scene loading). Instead, you should do this in some user-generated event. Use when clicked or event to handle such events.
There is one exception to this rule. Browsers allow playing muted videos automatically. See the mute puzzle.
Pauses audio or video playback.
Stops audio or video playback. Using this puzzle is equivalent to using the pause puzzle, followed by the rewind puzzle.
Makes the audio or video element to play from the start.
Sets the sound volume. Input volume is clamped to the 0.0-1.0 range. This puzzle also works for videos with embedded audio track.
Checks if a sound or video is being played back.
Mute a sound or video.
Apart from controlling audio volume, you can use this puzzle to start video playback automatically. This is possible, because web browsers allow playing muted videos without user interaction.
Unmute a sound or video.
Having Troubles with Puzzles?
Seek help on the forums!