Class: MpegAudioHeader
November 25, 2024 · View on GitHub
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
Accessors
- audioBitrate
- audioChannels
- audioSampleRate
- channelMode
- description
- durationMilliseconds
- isCopyrighted
- isOriginal
- isProtected
- layer
- mediaTypes
- vbrHeader
- version
Methods
Accessors
audioBitrate
• get audioBitrate(): number
Bitrate of the audio in kilobits per second represented by the current instance.
Returns
number
Implementation of
audioChannels
• get audioChannels(): number
Number of channels in the audio represented by the current instance.
Returns
number
Implementation of
audioSampleRate
• get audioSampleRate(): number
Sample rate of the audio represented by the current instance.
Returns
number
Implementation of
channelMode
• get channelMode(): MpegAudioChannelMode
Gets the MPEG audio channel mode of the audio represented by the current instance.
Returns
description
• get description(): string
Gets a text description of the media represented by the current instance.
Returns
string
Implementation of
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 the current audio is copyrighted.
Returns
boolean
isOriginal
• get isOriginal(): boolean
Whether the current audio is original.
Returns
boolean
isProtected
• get isProtected(): boolean
Gets whether the audio represented by the current instance is protected by CRC.
Returns
boolean
layer
• get layer(): number
Gets the MPEG audio layer used to encode the audio represented by the current instance.
Returns
number
mediaTypes
• get mediaTypes(): MediaTypes
Types of media represented by the current instance, bitwise combined.
Returns
Implementation of
vbrHeader
• get vbrHeader(): default
Gets the variable bitrate header (VBR) if the MPEG audio frame contains one.
Returns
default
version
• get version(): MpegVersion
Gets the MPEG version used to encode the audio represented by the current instance.
Returns
Methods
fromFile
▸ Static fromFile(file, searchStart, searchEnd, streamBytes?): MpegAudioHeader
Constructs an MPEG audio header by searching the provided file for an MPEG sync signature and reading the header that immediately follows.
Parameters
| Name | Type | Description |
|---|---|---|
file | File | File from which to read the audio header |
searchStart | number | Offset into the file to begin searching |
searchEnd | number | Offset into the file to stop searching |
streamBytes? | number | Total number of bytes in the audio stream. Used to calculate duration if a VBR header does not additionally specify it. If VBR header is not present and streamBytes is undefined, then duration will be 0. |
Returns
MpegAudioHeader Header as read from the file, undefined if not found.