Skip to content

openrv-web / AudioAPI

Class: AudioAPI

Defined in: api/AudioAPI.ts:10

Constructors

Constructor

new AudioAPI(session): AudioAPI

Defined in: api/AudioAPI.ts:13

Parameters

session

Session

Returns

AudioAPI

Methods

disableAudioScrub()

disableAudioScrub(): void

Defined in: api/AudioAPI.ts:156

Disable audio scrubbing (silent frame stepping/timeline drag).

Returns

void

Example

ts
openrv.audio.disableAudioScrub();

enableAudioScrub()

enableAudioScrub(): void

Defined in: api/AudioAPI.ts:144

Enable audio scrubbing (play audio snippets during frame stepping/timeline drag).

Returns

void

Example

ts
openrv.audio.enableAudioScrub();

getPreservesPitch()

getPreservesPitch(): boolean

Defined in: api/AudioAPI.ts:132

Check if pitch correction is enabled.

Returns

boolean

true if pitch is preserved during speed changes, false otherwise.

Example

ts
const preserved = openrv.audio.getPreservesPitch();

getVolume()

getVolume(): number

Defined in: api/AudioAPI.ts:48

Get the current audio volume level.

Returns

number

The current volume as a number between 0.0 and 1.0.

Example

ts
const vol = openrv.audio.getVolume();

isAudioScrubEnabled()

isAudioScrubEnabled(): boolean

Defined in: api/AudioAPI.ts:170

Check if audio scrubbing is enabled.

Returns

boolean

true if audio scrub is enabled, false otherwise.

Example

ts
const scrubbing = openrv.audio.isAudioScrubEnabled();

isMuted()

isMuted(): boolean

Defined in: api/AudioAPI.ts:86

Check if audio is currently muted.

Returns

boolean

true if muted, false otherwise.

Example

ts
if (openrv.audio.isMuted()) { openrv.audio.unmute(); }

mute()

mute(): void

Defined in: api/AudioAPI.ts:60

Mute audio output.

Returns

void

Example

ts
openrv.audio.mute();

setAudioScrubEnabled()

setAudioScrubEnabled(enabled): void

Defined in: api/AudioAPI.ts:185

Set audio scrubbing enabled state.

Parameters

enabled

boolean

true to enable audio scrub, false to disable.

Returns

void

Throws

If enabled is not a boolean.

Example

ts
openrv.audio.setAudioScrubEnabled(false);

setPreservesPitch()

setPreservesPitch(preserve): void

Defined in: api/AudioAPI.ts:115

Enable or disable pitch correction for non-1x playback speeds. When enabled, audio pitch stays the same regardless of playback speed.

Parameters

preserve

boolean

true to preserve pitch (default behavior), false for natural pitch shift proportional to speed.

Returns

void

Throws

If preserve is not a boolean.

Example

ts
openrv.audio.setPreservesPitch(false); // allow pitch to shift with speed

setVolume()

setVolume(volume): void

Defined in: api/AudioAPI.ts:29

Set the audio volume level.

Parameters

volume

number

A number between 0.0 (mute) and 1.0 (max). Values outside this range are clamped.

Returns

void

Throws

If volume is not a valid number or is NaN.

Example

ts
openrv.audio.setVolume(0.75);

toggleMute()

toggleMute(): void

Defined in: api/AudioAPI.ts:98

Toggle the mute state (mute if unmuted, unmute if muted).

Returns

void

Example

ts
openrv.audio.toggleMute();

unmute()

unmute(): void

Defined in: api/AudioAPI.ts:72

Unmute audio output.

Returns

void

Example

ts
openrv.audio.unmute();

Released under the MIT License.