UNPKG
is-m4a
Version:
latest (1.0.2)
1.1.0
1.0.2
1.0.0
0.3.0
0.2.0
0.1.2
0.1.1
0.1.0
Check if a Buffer/Uint8Array is a m4a file.
github.com/hemanth/is-m4a
hemanth/is-m4a
is-m4a
/
index.js
17 lines
(15 loc)
•
288 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'use strict'
;
module
.
exports
=
function
(
buf
) {
if
(!buf || buf.
length
<
8
) {
return
false
; }
return
(buf[
4
] ===
102
&& buf[
5
] ===
116
&& buf[
6
] ===
121
&& buf[
7
] ===
112
) || ( buf[
0
] ===
77
&& buf[
1
] ===
52
&& buf[
2
] ===
65
&& buf[
3
] ===
32
); };