Constructor
new MpegAudio()
- Source:
- See:
-
Members
BITRATES_MAP_ :Array<number>
Type:
- Source:
BYTES_IN_SLOT_ :Array<number>
Type:
- Source:
MP4_CODEC_MPEG1 :string
The codec strings of MPEG-1 and MPEG-2 audio in MP4, which are the
objectTypeIndication in hexadecimal (ISO/IEC 14496-1, table 5).
Type:
- Source:
MP4_CODEC_MPEG2 :string
Type:
- Source:
MPEG1_MIN_SAMPLE_RATE_ :number
MPEG-1 audio has the sample rates 32000, 44100 and 48000 Hz; the lower ones
belong to MPEG-2 (and 2.5).
Type:
- Source:
MPEG_AUDIO_SAMPLE_PER_FRAME :number
Type:
- Source:
OBJECT_TYPE_MPEG1_AUDIO_ :number
objectTypeIndication of MPEG-1 audio (0x6B) and MPEG-2 audio (0x69).
Type:
- Source:
OBJECT_TYPE_MPEG2_AUDIO_ :number
@const
Type:
- Source:
SAMPLES_COEFFICIENTS_ :Array<!Array<number>>
Type:
- Source:
SAMPLING_RATE_MAP_ :Array<number>
Type:
- Source:
Methods
buildEsds(sampleRate) → {Uint8Array}
Builds the payload of the esds box of MPEG audio in MP4.
Parameters:
| Name |
Type |
Description |
sampleRate |
number
|
|
- Source:
Returns:
-
Type
-
Uint8Array
getMp4Codec(sampleRate) → {string}
Gets the RFC 6381 codec string with which MP4 carries MPEG audio: the
objectTypeIndication of MPEG-1 audio (MP3) or MPEG-2 audio (the lower
sample rates). Some platforms (e.g. Chromecast) take MP3 in MP4 only
with these strings, and not with "mp3".
Parameters:
| Name |
Type |
Description |
sampleRate |
number
|
|
- Source:
Returns:
-
Type
-
string
Parameters:
| Name |
Type |
Description |
data |
Uint8Array
|
|
offset |
number
|
|
- Source:
Returns:
-
Type
-
boolean
Parameters:
| Name |
Type |
Description |
data |
Uint8Array
|
|
offset |
number
|
|
- Source:
Returns:
-
Type
-
boolean
Parameters:
| Name |
Type |
Description |
data |
Uint8Array
|
|
offset |
number
|
|
- Source:
Returns:
-
Type
-
?{sampleRate: number, channelCount: number, frameLength: number, samplesPerFrame: number}
probe(datanon-null, offsetnon-null) → {boolean}
Parameters:
| Name |
Type |
Description |
data |
Uint8Array
|
|
offset |
number
|
|
- Source:
Returns:
-
Type
-
boolean