Skip to main content

blockly > WorkspaceAudio

WorkspaceAudio class

Class for loading, storing, and playing audio for a workspace.

Signature:

export declare class WorkspaceAudio

Constructors

Constructor

Modifiers

Description

(constructor)(parentWorkspace)

Constructs a new instance of the WorkspaceAudio class

Methods

Method

Modifiers

Description

beep(tone, duration)

Plays a beep at the given frequency.

getMuted()

load(filenames, name)

Load an audio file. Cache it, ready for instantaneous playing.

play(name, opt_volume)

Play a named sound at specified volume. If volume is not specified, use full volume (1).

playErrorBeep()

Plays a standard error beep.

setMuted(muted)