Skip to content
Type

MediaStreamAudioTrackSourceOptions

Options for MediaStreamAudioTrackSource.

ts
type MediaStreamAudioTrackSourceOptions = {
	timestampBase?: 'synced-zero' | 'zero' | 'unix';
};

Used by

Properties

timestampBase

ts
timestampBase?: 'synced-zero' | 'zero' | 'unix';

Controls the basis (zero point) for audio sample timestamps.

When set to 'synced-zero', timestamps will be relative to the first chunk of media from a MediaStreamTrack added to the Output.

When set to 'zero', timestamps will be relative to the first audio sample emitted by this source.

When set to 'unix', timestamps will be relative to the Unix epoch, so clearly associated with a distinct point in time. Here, pausing via MediaStreamAudioTrackSource.pause will also create gaps in timestamps. Be sure to pair this mode with BaseTrackMetadata.isRelativeToUnixEpoch.

Defaults to 'synced-zero'.

Released under the Mozilla Public License 2.0.