AudioTrack

AudioTrack

The `AudioTrack` class represents an extended `Track` that targets an audio stream in the source the track points to.

Constructor

# new AudioTrack()

Extends

Members

# (static) DEFAULT_STREAM_INDEX :Number

The default stream index for 'audio'.
Type:
  • Number

# (static) STREAM_TYPE :String

The name of the stream type for this audio tracks.
Type:
  • String

# (nullable) channelLayout :String

The channel layout of the track's source stream.
Type:
  • String

# (nullable) channels :Number

The number of channels in the track's source stream.
Type:
  • Number

# duration :Number

The duration in seconds of the track's source stream.
Type:
  • Number
Inherited From:

# isPrimary :Boolean

This property will be `true` if the track is the primary track in the source container.
Type:
  • Boolean
Inherited From:

# language :String

The language code for the track's source.
Type:
  • String
Inherited From:

# streamIndex :Number

The stream index for this track.
Type:
  • Number
Inherited From:

# (nullable) tags :Object

An object of known tags found in the track's source container format and stream.
Type:
  • Object
Inherited From:

# type :String

The track's source media type represented as a string (audio, video, subtitle, etc). The static class property `STREAM_TYPE` on the instance's class constructor is used to determine the track type falling back to the class name, lower cased, with the string `/track/i` removed.
Type:
  • String
Inherited From:

Methods

# (protected) _close(callback)

Implements the abstract `_close()` method for `nanoresource` Closes the resets internal state.
Parameters:
Name Type Description
callback function
Inherited From:

# (protected) _open(callback)

Implements the abstract `_open()` method for `nanoresource` Opens the internal source stream, probes for stream information, and initializes track state based on the stream index.
Parameters:
Name Type Description
callback function
Inherited From:

# (abstract, protected) _validate(callback)

Default abstract method implementation for `_validate()` that does nothing but call `callback` on the next tick.
Parameters:
Name Type Description
callback function
Inherited From:

# ready(callback)

Wait for track and track source to be ready (opened) calling `callback()` when it is.
Parameters:
Name Type Description
callback function
Inherited From:

# validate(callback)

Validates the track state properties calling `_validate(callback)` for extending validation. Successful validation should not throw an error.
Parameters:
Name Type Description
callback function
Inherited From: