Skip to content

Latest commit

 

History

History
333 lines (185 loc) · 8.02 KB

File metadata and controls

333 lines (185 loc) · 8.02 KB

node-taglib-sharp / Exports / MpegAudioHeader

Class: MpegAudioHeader

Provides information about an MPEG audio stream. For more information and definition of the header, see http://www.mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm

Implements

Table of contents

Properties

Accessors

Methods

Properties

UNKNOWN

Static Readonly UNKNOWN: MpegAudioHeader

Static instance of an audio header that has unknown information.

Accessors

audioBitrate

get audioBitrate(): number

Bitrate of the audio in kilobits per second represented by the current instance.

Returns

number

Implementation of

IAudioCodec.audioBitrate


audioChannels

get audioChannels(): number

Number of channels in the audio represented by the current instance.

Returns

number

Implementation of

IAudioCodec.audioChannels


audioFrameLength

get audioFrameLength(): number

Gets the length of the frames in the audio represented by the current instance.

Returns

number


audioLayer

get audioLayer(): number

Gets the MPEG audio layer used to encode the audio represented by the current instance.

Returns

number


audioSampleRate

get audioSampleRate(): number

Sample rate of the audio represented by the current instance.

Returns

number

Implementation of

IAudioCodec.audioSampleRate


channelMode

get channelMode(): MpegAudioChannelMode

Gets the MPEG audio channel mode of the audio represented by the current instance.

Returns

MpegAudioChannelMode


description

get description(): string

Gets a text description of the media represented by the current instance.

Returns

string

Implementation of

IAudioCodec.description


durationMilliseconds

get durationMilliseconds(): number

Duration of the media in milliseconds represented by the current instance.

Returns

number

Implementation of

IAudioCodec.durationMilliseconds


isCopyrighted

get isCopyrighted(): boolean

Whether or not the current audio is copyrighted.

Returns

boolean


isOriginal

get isOriginal(): boolean

Whether or not the current audio is original.

Returns

boolean


isPadded

get isPadded(): boolean

Whether or not the audio represented by the current instance is padded.

Returns

boolean


isProtected

get isProtected(): boolean

Gets whether the audio represented by the current instance is protected by CRC.

Returns

boolean


mediaTypes

get mediaTypes(): MediaTypes

Types of media represented by the current instance, bitwise combined.

Returns

MediaTypes

Implementation of

IAudioCodec.mediaTypes


vbriHeader

get vbriHeader(): MpegVbriHeader

Gets the VBRI header found in the audio. VbriHeader.UNKNOWN is returned if no header was found.

Returns

MpegVbriHeader


version

get version(): MpegVersion

Gets the MPEG version used to encode the audio represented by the current instance.

Returns

MpegVersion


xingHeader

get xingHeader(): MpegXingHeader

Gets the Xing header found in the audio. XingHeader.UNKNOWN is returned if no header was found.

Returns

MpegXingHeader

Methods

find

Static find(file, position, length?): MpegAudioHeader

Searches for an audio header in a file starting at a specified position and searching through a specified number of bytes.

Parameters

Name Type Description
file File File to search
position number Position in file at which to start searching
length? number Maximum number of bytes to search before giving up. Defaults to -1 to have no maximum

Returns

MpegAudioHeader

The header that was found or undefined if a header was not found


fromData

Static fromData(data, file, position): MpegAudioHeader

Constructs and initializes a new instance by reading its contents from a data ByteVector and its Xing header from the appropriate location in the specified file.

Parameters

Name Type Description
data ByteVector The header data to read
file File File to read the Xing/VBRI header from
position number Position into file where the header begins, must be a positive 8-bit integer.

Returns

MpegAudioHeader


fromInfo

Static fromInfo(flags, streamLength, xingHeader, vbriHeader): MpegAudioHeader

Constructs and initializes a new instance by populating it with specified values.

Parameters

Name Type Description
flags number Flags for the new instance
streamLength number Stream length of the new instance
xingHeader MpegXingHeader Xing header associated with the new instance
vbriHeader MpegVbriHeader VBRI header associated with the new instance

Returns

MpegAudioHeader