Audio and Video Puzzles

These puzzles are used to load and play back audio and video files.

Contents

Puzzles Reference

load sound

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.

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.

load video

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.

play

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.

pause

Pauses audio or video playback.

stop

Stops audio or video playback. Using this puzzle is equivalent to using the pause puzzle, followed by the rewind puzzle.

rewind

Makes the audio or video element to play from the start.

set volume

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.

is playing

Checks if a sound or video is being played back.

mute

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

Unmute a sound or video.

Having Troubles with Puzzles?

Seek help on the forums!