[]
        
(Showing Draft Content)

SoundObject

Class: SoundObject

Represents a sound object, which is a stream containing sample values that define a sound to be played through the computer's speakers.

Extends

Constructors

Constructor

new SoundObject(om): SoundObject;

Creates empty instance of a SoundObject object.

Parameters

om

ObjectManager

ObjectManager that controls the lifetime of the SoundObject.

Returns

SoundObject

Overrides

ObjectBase.constructor

Constructor

new SoundObject(): SoundObject;

Creates empty instance of a SoundObject object.

Returns

SoundObject

Overrides

ObjectBase.constructor

Constructor

new SoundObject(om, properties): SoundObject;

Creates a SoundObject object on the base of properties specified by the SoundObjectProperties.

Parameters

om

ObjectManager

ObjectManager that controls the lifetime of the SoundObject.

properties

SoundObjectProperties

The properties of created object.

Returns

SoundObject

Overrides

ObjectBase.constructor

Constructor

new SoundObject(properties): SoundObject;

Creates a SoundObject object on the base of properties specified by the SoundObjectProperties.

Parameters

properties

SoundObjectProperties

The properties of created object.

Returns

SoundObject

Overrides

ObjectBase.constructor

Constructor

new SoundObject(
   om, 
   audioData, 
   format?): SoundObject;

Creates a SoundObject from audio data of WAF or AIFF format.

Parameters

om

ObjectManager

ObjectManager that controls the lifetime of the SoundObject.

audioData

Uint8Array

The audio data.

format?

AudioFormat

The audio data format, not specified means 'Auto'.

Returns

SoundObject

Overrides

ObjectBase.constructor

Constructor

new SoundObject(audioData, format?): SoundObject;

Creates a SoundObject from audio data of WAF or AIFF format.

Parameters

audioData

Uint8Array

The audio data.

format?

AudioFormat

The audio data format, not specified means 'Auto'.

Returns

SoundObject

Overrides

ObjectBase.constructor

Accessors

bitsPerSample

Get Signature

get bitsPerSample(): number;

Gets or sets the number of bits per sample value per channel.

Returns

number

Set Signature

set bitsPerSample(value): void;

Gets or sets the number of bits per sample value per channel.

Parameters
value

number

Returns

void


encodingFormat

Get Signature

get encodingFormat(): string;

Gets or sets the encoding format for the sample data, one of: "Raw", "Signed", "muLaw" or "ALaw".

Returns

string

Set Signature

set encodingFormat(value): void;

Gets or sets the encoding format for the sample data, one of: "Raw", "Signed", "muLaw" or "ALaw".

Parameters
value

string

Returns

void


id

Get Signature

get id(): number;

Gets the reference to the object.

Returns

number

Inherited from

ObjectBase.id


om

Get Signature

get om(): ObjectManager;

Gets the owner ObjectManager instance.

Returns

ObjectManager

Inherited from

ObjectBase.om


samplingRate

Get Signature

get samplingRate(): number;

Gets or sets the sampling rate, in samples per second.

Returns

number

Set Signature

set samplingRate(value): void;

Gets or sets the sampling rate, in samples per second.

Parameters
value

number

Returns

void


soundChannels

Get Signature

get soundChannels(): number;

Gets or sets the number of sound channels.

Returns

number

Set Signature

set soundChannels(value): void;

Gets or sets the number of sound channels.

Parameters
value

number

Returns

void

Methods

free()

free(): void;

Detaches the object from the ObjectManager and deallocates its memory, if possible.

Returns

void

Inherited from

ObjectBase.free


getAudioData()

getAudioData(): Uint8Array<ArrayBufferLike>;

Gets a Uint8Array object containing the audio data.

Returns

Uint8Array<ArrayBufferLike>


rebind()

rebind(omTo): void;

Rebinds the object from the current ObjectManager to the specified one.

Parameters

omTo

ObjectManager

The new ObjectManager for the object.

Returns

void

Inherited from

ObjectBase.rebind


setAudioData()

setAudioData(data): void;

Sets the audio data.

Parameters

data

Uint8Array<ArrayBufferLike>

Returns

void