Table of Contents

Class AudioData

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The AudioData interface of the WebCodecs API represents an audio sample.

[Value("AudioData")]
public class AudioData
Inheritance
AudioData
Inherited Members

Remarks

Constructors

AudioData()

public AudioData()

AudioData(AudioDataInit)

The AudioData() constructor creates a new AudioData object which represents an individual audio sample.

public AudioData(AudioDataInit init)

Parameters

init AudioDataInit

Remarks

Properties

Duration

The duration read-only property of the AudioData interface returns the duration in microseconds of this AudioData object.

[Value("duration")]
public ulong Duration { get; }

Property Value

ulong

An integer.

Remarks

Format

The format read-only property of the AudioData interface returns the sample format of the AudioData object.

[Value("format")]
public AudioSampleFormat? Format { get; }

Property Value

AudioSampleFormat?

A string. One of:

Remarks

NumberOfChannels

The numberOfChannels read-only property of the AudioData interface returns the number of channels in the AudioData object.

[Value("numberOfChannels")]
public ulong NumberOfChannels { get; }

Property Value

ulong

An integer.

Remarks

NumberOfFrames

The numberOfFrames read-only property of the AudioData interface returns the number of frames in the AudioData object.

[Value("numberOfFrames")]
public ulong NumberOfFrames { get; }

Property Value

ulong

An integer.

Remarks

SampleRate

The sampleRate read-only property of the AudioData interface returns the sample rate in Hz.

[Value("sampleRate")]
public Number SampleRate { get; }

Property Value

Number

A decimal value.

Remarks

Timestamp

The timestamp read-only property of the AudioData interface returns the timestamp of this AudioData object.

[Value("timestamp")]
public long Timestamp { get; }

Property Value

long

An integer.

Remarks

Methods

AllocationSize(AudioDataCopyToOptions)

The allocationSize() method of the AudioData interface returns the size in bytes required to hold the current sample as filtered by options passed into the method.

[Value("allocationSize")]
public ulong AllocationSize(AudioDataCopyToOptions options)

Parameters

options AudioDataCopyToOptions

Returns

ulong

An integer containing the number of bytes needed to hold the samples described by options.

Remarks

Clone()

The clone() method of the AudioData interface creates a new AudioData object with reference to the same media resource as the original.

[Value("clone")]
public AudioData Clone()

Returns

AudioData

The cloned AudioData object.

Remarks

Close()

The close() method of the AudioData interface clears all states and releases the reference to the media resource.

[Value("close")]
public GlobalObject.Undefined Close()

Returns

GlobalObject.Undefined

Undefined.

Remarks

CopyTo(Union225, AudioDataCopyToOptions)

The copyTo() method of the AudioData interface copies a plane of an AudioData object to a destination buffer.

[Value("copyTo")]
public GlobalObject.Undefined CopyTo(Union225 destination, AudioDataCopyToOptions options)

Parameters

destination Union225
options AudioDataCopyToOptions

Returns

GlobalObject.Undefined

Undefined.

Remarks