@dragon708/docmind-markdown 1.2.5 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/node_modules/music-metadata/LICENSE.txt +3 -3
  2. package/node_modules/music-metadata/README.md +246 -690
  3. package/node_modules/music-metadata/lib/ParserFactory.d.ts +31 -27
  4. package/node_modules/music-metadata/lib/ParserFactory.js +219 -108
  5. package/node_modules/music-metadata/lib/aiff/AiffParser.d.ts +2 -2
  6. package/node_modules/music-metadata/lib/aiff/AiffParser.js +38 -34
  7. package/node_modules/music-metadata/lib/aiff/AiffTagMap.d.ts +1 -1
  8. package/node_modules/music-metadata/lib/aiff/AiffTagMap.js +7 -2
  9. package/node_modules/music-metadata/lib/aiff/AiffToken.d.ts +6 -32
  10. package/node_modules/music-metadata/lib/aiff/AiffToken.js +17 -27
  11. package/node_modules/music-metadata/lib/apev2/APEv2Parser.d.ts +8 -24
  12. package/node_modules/music-metadata/lib/apev2/APEv2Parser.js +66 -78
  13. package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.d.ts +1 -1
  14. package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.js +8 -4
  15. package/node_modules/music-metadata/lib/apev2/APEv2Token.d.ts +11 -10
  16. package/node_modules/music-metadata/lib/apev2/APEv2Token.js +27 -16
  17. package/node_modules/music-metadata/lib/asf/AsfObject.d.ts +53 -59
  18. package/node_modules/music-metadata/lib/asf/AsfObject.js +131 -97
  19. package/node_modules/music-metadata/lib/asf/AsfParser.d.ts +1 -1
  20. package/node_modules/music-metadata/lib/asf/AsfParser.js +43 -42
  21. package/node_modules/music-metadata/lib/asf/AsfTagMapper.d.ts +2 -2
  22. package/node_modules/music-metadata/lib/asf/AsfTagMapper.js +10 -6
  23. package/node_modules/music-metadata/lib/asf/AsfUtil.d.ts +13 -4
  24. package/node_modules/music-metadata/lib/asf/AsfUtil.js +36 -30
  25. package/node_modules/music-metadata/lib/asf/GUID.d.ts +84 -0
  26. package/node_modules/music-metadata/lib/asf/GUID.js +121 -0
  27. package/node_modules/music-metadata/lib/common/BasicParser.d.ts +9 -9
  28. package/node_modules/music-metadata/lib/common/BasicParser.js +7 -2
  29. package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.d.ts +3 -3
  30. package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.js +7 -2
  31. package/node_modules/music-metadata/lib/common/CombinedTagMapper.d.ts +5 -5
  32. package/node_modules/music-metadata/lib/common/CombinedTagMapper.js +28 -24
  33. package/node_modules/music-metadata/lib/common/FourCC.d.ts +1 -1
  34. package/node_modules/music-metadata/lib/common/FourCC.js +11 -10
  35. package/node_modules/music-metadata/lib/common/GenericTagMapper.d.ts +13 -13
  36. package/node_modules/music-metadata/lib/common/GenericTagMapper.js +12 -7
  37. package/node_modules/music-metadata/lib/common/GenericTagTypes.d.ts +6 -7
  38. package/node_modules/music-metadata/lib/common/GenericTagTypes.js +85 -86
  39. package/node_modules/music-metadata/lib/common/MetadataCollector.d.ts +10 -20
  40. package/node_modules/music-metadata/lib/common/MetadataCollector.js +69 -100
  41. package/node_modules/music-metadata/lib/common/RandomFileReader.d.ts +22 -0
  42. package/node_modules/music-metadata/lib/common/RandomFileReader.js +34 -0
  43. package/node_modules/music-metadata/lib/common/RandomUint8ArrayReader.d.ts +18 -0
  44. package/node_modules/music-metadata/lib/common/RandomUint8ArrayReader.js +25 -0
  45. package/node_modules/music-metadata/lib/common/Util.d.ts +12 -11
  46. package/node_modules/music-metadata/lib/common/Util.js +53 -47
  47. package/node_modules/music-metadata/lib/core.d.ts +15 -42
  48. package/node_modules/music-metadata/lib/core.js +38 -74
  49. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.d.ts +1 -16
  50. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js +44 -55
  51. package/node_modules/music-metadata/lib/dsdiff/DsdiffToken.d.ts +3 -3
  52. package/node_modules/music-metadata/lib/dsdiff/DsdiffToken.js +7 -4
  53. package/node_modules/music-metadata/lib/dsf/DsfChunk.d.ts +10 -11
  54. package/node_modules/music-metadata/lib/dsf/DsfChunk.js +19 -15
  55. package/node_modules/music-metadata/lib/dsf/DsfParser.d.ts +1 -16
  56. package/node_modules/music-metadata/lib/dsf/DsfParser.js +20 -21
  57. package/node_modules/music-metadata/lib/flac/FlacParser.d.ts +15 -16
  58. package/node_modules/music-metadata/lib/flac/FlacParser.js +119 -69
  59. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.d.ts +3 -7
  60. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +36 -39
  61. package/node_modules/music-metadata/lib/id3v1/ID3v1TagMap.d.ts +1 -1
  62. package/node_modules/music-metadata/lib/id3v1/ID3v1TagMap.js +7 -2
  63. package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.d.ts +2 -2
  64. package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js +19 -15
  65. package/node_modules/music-metadata/lib/id3v2/FrameParser.d.ts +3 -64
  66. package/node_modules/music-metadata/lib/id3v2/FrameParser.js +103 -244
  67. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.d.ts +2 -2
  68. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js +16 -6
  69. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.d.ts +5 -5
  70. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js +35 -36
  71. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.d.ts +6 -11
  72. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.js +104 -91
  73. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.d.ts +29 -67
  74. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +36 -76
  75. package/node_modules/music-metadata/lib/iff/index.d.ts +1 -1
  76. package/node_modules/music-metadata/lib/iff/index.js +7 -4
  77. package/node_modules/music-metadata/lib/index.d.ts +31 -8
  78. package/node_modules/music-metadata/lib/index.js +53 -32
  79. package/node_modules/music-metadata/lib/lyrics3/Lyrics3.d.ts +2 -2
  80. package/node_modules/music-metadata/lib/lyrics3/Lyrics3.js +13 -13
  81. package/node_modules/music-metadata/lib/matroska/MatroskaDtd.d.ts +2 -2
  82. package/node_modules/music-metadata/lib/matroska/MatroskaDtd.js +242 -246
  83. package/node_modules/music-metadata/lib/matroska/MatroskaParser.d.ts +24 -6
  84. package/node_modules/music-metadata/lib/matroska/MatroskaParser.js +218 -124
  85. package/node_modules/music-metadata/lib/matroska/MatroskaTagMapper.d.ts +1 -1
  86. package/node_modules/music-metadata/lib/matroska/MatroskaTagMapper.js +7 -3
  87. package/node_modules/music-metadata/lib/matroska/types.d.ts +76 -43
  88. package/node_modules/music-metadata/lib/matroska/types.js +33 -27
  89. package/node_modules/music-metadata/lib/mp4/Atom.d.ts +7 -7
  90. package/node_modules/music-metadata/lib/mp4/Atom.js +22 -15
  91. package/node_modules/music-metadata/lib/mp4/AtomToken.d.ts +18 -110
  92. package/node_modules/music-metadata/lib/mp4/AtomToken.js +66 -184
  93. package/node_modules/music-metadata/lib/mp4/MP4Parser.d.ts +4 -6
  94. package/node_modules/music-metadata/lib/mp4/MP4Parser.js +128 -255
  95. package/node_modules/music-metadata/lib/mp4/MP4TagMapper.d.ts +4 -4
  96. package/node_modules/music-metadata/lib/mp4/MP4TagMapper.js +12 -8
  97. package/node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.d.ts +5 -5
  98. package/node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.js +10 -7
  99. package/node_modules/music-metadata/lib/mpeg/MpegParser.d.ts +4 -17
  100. package/node_modules/music-metadata/lib/mpeg/MpegParser.js +131 -176
  101. package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.d.ts +14 -16
  102. package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.js +19 -14
  103. package/node_modules/music-metadata/lib/mpeg/XingTag.d.ts +7 -6
  104. package/node_modules/music-metadata/lib/mpeg/XingTag.js +18 -14
  105. package/node_modules/music-metadata/lib/musepack/index.d.ts +5 -0
  106. package/node_modules/music-metadata/lib/musepack/index.js +32 -0
  107. package/node_modules/music-metadata/lib/musepack/sv7/BitReader.d.ts +2 -2
  108. package/node_modules/music-metadata/lib/musepack/sv7/BitReader.js +24 -16
  109. package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.d.ts +1 -1
  110. package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.js +15 -16
  111. package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.d.ts +1 -1
  112. package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.js +7 -5
  113. package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.d.ts +1 -1
  114. package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.js +17 -18
  115. package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.d.ts +3 -5
  116. package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js +12 -14
  117. package/node_modules/music-metadata/lib/ogg/{OggToken.d.ts → Ogg.d.ts} +6 -17
  118. package/node_modules/music-metadata/lib/ogg/Ogg.js +2 -0
  119. package/node_modules/music-metadata/lib/ogg/OggParser.d.ts +12 -16
  120. package/node_modules/music-metadata/lib/ogg/OggParser.js +102 -101
  121. package/node_modules/music-metadata/lib/ogg/opus/Opus.d.ts +2 -17
  122. package/node_modules/music-metadata/lib/ogg/opus/Opus.js +14 -13
  123. package/node_modules/music-metadata/lib/ogg/opus/OpusParser.d.ts +25 -0
  124. package/node_modules/music-metadata/lib/ogg/opus/{OpusStream.js → OpusParser.js} +18 -18
  125. package/node_modules/music-metadata/lib/ogg/speex/Speex.d.ts +1 -1
  126. package/node_modules/music-metadata/lib/ogg/speex/Speex.js +19 -16
  127. package/node_modules/music-metadata/lib/ogg/speex/SpeexParser.d.ts +22 -0
  128. package/node_modules/music-metadata/lib/ogg/speex/{SpeexStream.js → SpeexParser.js} +13 -9
  129. package/node_modules/music-metadata/lib/ogg/theora/Theora.d.ts +1 -1
  130. package/node_modules/music-metadata/lib/ogg/theora/Theora.js +11 -8
  131. package/node_modules/music-metadata/lib/ogg/theora/TheoraParser.d.ts +28 -0
  132. package/node_modules/music-metadata/lib/ogg/theora/TheoraParser.js +44 -0
  133. package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.d.ts +7 -6
  134. package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.js +29 -34
  135. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.d.ts +1 -1
  136. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js +9 -6
  137. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.d.ts +36 -0
  138. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.js +128 -0
  139. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.d.ts +3 -3
  140. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js +9 -5
  141. package/node_modules/music-metadata/lib/riff/RiffChunk.d.ts +5 -5
  142. package/node_modules/music-metadata/lib/riff/RiffChunk.js +9 -5
  143. package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.d.ts +2 -2
  144. package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.js +25 -20
  145. package/node_modules/music-metadata/lib/type.d.ts +52 -121
  146. package/node_modules/music-metadata/lib/type.js +6 -2
  147. package/node_modules/music-metadata/lib/wav/BwfChunk.d.ts +1 -1
  148. package/node_modules/music-metadata/lib/wav/BwfChunk.js +11 -8
  149. package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +20 -50
  150. package/node_modules/music-metadata/lib/wav/WaveChunk.js +32 -45
  151. package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +2 -2
  152. package/node_modules/music-metadata/lib/wav/WaveParser.js +39 -46
  153. package/node_modules/music-metadata/lib/wavpack/WavPackParser.d.ts +2 -18
  154. package/node_modules/music-metadata/lib/wavpack/WavPackParser.js +32 -42
  155. package/node_modules/music-metadata/lib/wavpack/WavPackToken.d.ts +18 -14
  156. package/node_modules/music-metadata/lib/wavpack/WavPackToken.js +30 -24
  157. package/node_modules/music-metadata/package.json +74 -81
  158. package/package.json +1 -5
  159. package/node_modules/@borewit/text-codec/LICENSE.txt +0 -9
  160. package/node_modules/@borewit/text-codec/README.md +0 -87
  161. package/node_modules/@borewit/text-codec/lib/index.d.ts +0 -6
  162. package/node_modules/@borewit/text-codec/lib/index.js +0 -380
  163. package/node_modules/@borewit/text-codec/package.json +0 -70
  164. package/node_modules/music-metadata/lib/ParseError.d.ts +0 -87
  165. package/node_modules/music-metadata/lib/ParseError.js +0 -38
  166. package/node_modules/music-metadata/lib/aiff/AiffLoader.d.ts +0 -2
  167. package/node_modules/music-metadata/lib/aiff/AiffLoader.js +0 -8
  168. package/node_modules/music-metadata/lib/apev2/Apev2Loader.d.ts +0 -2
  169. package/node_modules/music-metadata/lib/apev2/Apev2Loader.js +0 -8
  170. package/node_modules/music-metadata/lib/asf/AsfGuid.d.ts +0 -83
  171. package/node_modules/music-metadata/lib/asf/AsfGuid.js +0 -109
  172. package/node_modules/music-metadata/lib/asf/AsfLoader.d.ts +0 -2
  173. package/node_modules/music-metadata/lib/asf/AsfLoader.js +0 -8
  174. package/node_modules/music-metadata/lib/dsdiff/DsdiffLoader.d.ts +0 -2
  175. package/node_modules/music-metadata/lib/dsdiff/DsdiffLoader.js +0 -8
  176. package/node_modules/music-metadata/lib/dsf/DsfLoader.d.ts +0 -2
  177. package/node_modules/music-metadata/lib/dsf/DsfLoader.js +0 -8
  178. package/node_modules/music-metadata/lib/ebml/EbmlIterator.d.ts +0 -67
  179. package/node_modules/music-metadata/lib/ebml/EbmlIterator.js +0 -218
  180. package/node_modules/music-metadata/lib/ebml/types.d.ts +0 -37
  181. package/node_modules/music-metadata/lib/ebml/types.js +0 -8
  182. package/node_modules/music-metadata/lib/flac/FlacLoader.d.ts +0 -2
  183. package/node_modules/music-metadata/lib/flac/FlacLoader.js +0 -8
  184. package/node_modules/music-metadata/lib/flac/FlacToken.d.ts +0 -45
  185. package/node_modules/music-metadata/lib/flac/FlacToken.js +0 -63
  186. package/node_modules/music-metadata/lib/id3v2/FrameHeader.d.ts +0 -31
  187. package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +0 -73
  188. package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.d.ts +0 -11
  189. package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.js +0 -17
  190. package/node_modules/music-metadata/lib/lrc/LyricsParser.d.ts +0 -9
  191. package/node_modules/music-metadata/lib/lrc/LyricsParser.js +0 -45
  192. package/node_modules/music-metadata/lib/matroska/MatroskaLoader.d.ts +0 -2
  193. package/node_modules/music-metadata/lib/matroska/MatroskaLoader.js +0 -8
  194. package/node_modules/music-metadata/lib/mp4/Mp4Loader.d.ts +0 -2
  195. package/node_modules/music-metadata/lib/mp4/Mp4Loader.js +0 -8
  196. package/node_modules/music-metadata/lib/mpeg/MpegLoader.d.ts +0 -2
  197. package/node_modules/music-metadata/lib/mpeg/MpegLoader.js +0 -8
  198. package/node_modules/music-metadata/lib/musepack/MusepackConentError.d.ts +0 -15
  199. package/node_modules/music-metadata/lib/musepack/MusepackConentError.js +0 -3
  200. package/node_modules/music-metadata/lib/musepack/MusepackLoader.d.ts +0 -2
  201. package/node_modules/music-metadata/lib/musepack/MusepackLoader.js +0 -8
  202. package/node_modules/music-metadata/lib/musepack/MusepackParser.d.ts +0 -4
  203. package/node_modules/music-metadata/lib/musepack/MusepackParser.js +0 -30
  204. package/node_modules/music-metadata/lib/ogg/OggLoader.d.ts +0 -2
  205. package/node_modules/music-metadata/lib/ogg/OggLoader.js +0 -8
  206. package/node_modules/music-metadata/lib/ogg/OggToken.js +0 -41
  207. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.d.ts +0 -29
  208. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.js +0 -74
  209. package/node_modules/music-metadata/lib/ogg/opus/OpusStream.d.ts +0 -24
  210. package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.d.ts +0 -20
  211. package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.d.ts +0 -25
  212. package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.js +0 -39
  213. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.d.ts +0 -53
  214. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.js +0 -136
  215. package/node_modules/music-metadata/lib/wav/WaveLoader.d.ts +0 -2
  216. package/node_modules/music-metadata/lib/wav/WaveLoader.js +0 -8
  217. package/node_modules/music-metadata/lib/wavpack/WavPackLoader.d.ts +0 -2
  218. package/node_modules/music-metadata/lib/wavpack/WavPackLoader.js +0 -8
  219. package/node_modules/music-metadata/node_modules/file-type/core.d.ts +0 -253
  220. package/node_modules/music-metadata/node_modules/file-type/core.js +0 -2899
  221. package/node_modules/music-metadata/node_modules/file-type/index.d.ts +0 -98
  222. package/node_modules/music-metadata/node_modules/file-type/index.js +0 -163
  223. package/node_modules/music-metadata/node_modules/file-type/license +0 -9
  224. package/node_modules/music-metadata/node_modules/file-type/package.json +0 -290
  225. package/node_modules/music-metadata/node_modules/file-type/readme.md +0 -667
  226. package/node_modules/music-metadata/node_modules/file-type/supported.js +0 -360
  227. package/node_modules/music-metadata/node_modules/file-type/util.js +0 -60
  228. package/node_modules/music-metadata/node_modules/strtok3/LICENSE.txt +0 -21
  229. package/node_modules/music-metadata/node_modules/strtok3/README.md +0 -399
  230. package/node_modules/music-metadata/node_modules/strtok3/lib/AbstractTokenizer.d.ts +0 -76
  231. package/node_modules/music-metadata/node_modules/strtok3/lib/AbstractTokenizer.js +0 -111
  232. package/node_modules/music-metadata/node_modules/strtok3/lib/BlobTokenizer.d.ts +0 -29
  233. package/node_modules/music-metadata/node_modules/strtok3/lib/BlobTokenizer.js +0 -53
  234. package/node_modules/music-metadata/node_modules/strtok3/lib/BufferTokenizer.d.ts +0 -29
  235. package/node_modules/music-metadata/node_modules/strtok3/lib/BufferTokenizer.js +0 -52
  236. package/node_modules/music-metadata/node_modules/strtok3/lib/FileTokenizer.d.ts +0 -37
  237. package/node_modules/music-metadata/node_modules/strtok3/lib/FileTokenizer.js +0 -61
  238. package/node_modules/music-metadata/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +0 -34
  239. package/node_modules/music-metadata/node_modules/strtok3/lib/ReadStreamTokenizer.js +0 -107
  240. package/node_modules/music-metadata/node_modules/strtok3/lib/core.d.ts +0 -40
  241. package/node_modules/music-metadata/node_modules/strtok3/lib/core.js +0 -62
  242. package/node_modules/music-metadata/node_modules/strtok3/lib/index.d.ts +0 -16
  243. package/node_modules/music-metadata/node_modules/strtok3/lib/index.js +0 -22
  244. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +0 -54
  245. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/AbstractStreamReader.js +0 -71
  246. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Deferred.d.ts +0 -6
  247. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Deferred.js +0 -10
  248. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Errors.d.ts +0 -10
  249. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Errors.js +0 -16
  250. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/StreamReader.d.ts +0 -29
  251. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/StreamReader.js +0 -83
  252. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +0 -14
  253. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamByobReader.js +0 -27
  254. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +0 -19
  255. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +0 -62
  256. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +0 -14
  257. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReader.js +0 -13
  258. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +0 -5
  259. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +0 -19
  260. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/index.d.ts +0 -6
  261. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/index.js +0 -5
  262. package/node_modules/music-metadata/node_modules/strtok3/lib/types.d.ts +0 -139
  263. package/node_modules/music-metadata/node_modules/strtok3/lib/types.js +0 -1
  264. package/node_modules/music-metadata/node_modules/strtok3/package.json +0 -94
  265. package/node_modules/music-metadata/node_modules/token-types/LICENSE.txt +0 -9
  266. package/node_modules/music-metadata/node_modules/token-types/README.md +0 -120
  267. package/node_modules/music-metadata/node_modules/token-types/lib/index.d.ts +0 -135
  268. package/node_modules/music-metadata/node_modules/token-types/lib/index.js +0 -401
  269. package/node_modules/music-metadata/node_modules/token-types/package.json +0 -81
  270. package/node_modules/sprintf-js/.npmignore +0 -1
  271. package/node_modules/sprintf-js/LICENSE +0 -24
  272. package/node_modules/sprintf-js/README.md +0 -88
  273. package/node_modules/sprintf-js/bower.json +0 -14
  274. package/node_modules/sprintf-js/demo/angular.html +0 -20
  275. package/node_modules/sprintf-js/dist/angular-sprintf.min.js +0 -4
  276. package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +0 -1
  277. package/node_modules/sprintf-js/dist/angular-sprintf.min.map +0 -1
  278. package/node_modules/sprintf-js/dist/sprintf.min.js +0 -4
  279. package/node_modules/sprintf-js/dist/sprintf.min.js.map +0 -1
  280. package/node_modules/sprintf-js/dist/sprintf.min.map +0 -1
  281. package/node_modules/sprintf-js/gruntfile.js +0 -36
  282. package/node_modules/sprintf-js/package.json +0 -22
  283. package/node_modules/sprintf-js/src/angular-sprintf.js +0 -18
  284. package/node_modules/sprintf-js/src/sprintf.js +0 -208
  285. package/node_modules/sprintf-js/test/test.js +0 -82
  286. package/node_modules/uint8array-extras/index.d.ts +0 -331
  287. package/node_modules/uint8array-extras/index.js +0 -318
  288. package/node_modules/uint8array-extras/license +0 -9
  289. package/node_modules/uint8array-extras/package.json +0 -54
  290. package/node_modules/uint8array-extras/readme.md +0 -318
  291. package/node_modules/win-guid/LICENSE.txt +0 -9
  292. package/node_modules/win-guid/README.md +0 -113
  293. package/node_modules/win-guid/lib/guid.d.ts +0 -20
  294. package/node_modules/win-guid/lib/guid.js +0 -107
  295. package/node_modules/win-guid/package.json +0 -55
  296. /package/node_modules/{argparse → mammoth/node_modules/argparse}/LICENSE +0 -0
  297. /package/node_modules/{argparse → mammoth/node_modules/argparse}/README.md +0 -0
  298. /package/node_modules/{argparse → mammoth/node_modules/argparse}/index.js +0 -0
  299. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/append/constant.js +0 -0
  300. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/append.js +0 -0
  301. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/count.js +0 -0
  302. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/help.js +0 -0
  303. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store/constant.js +0 -0
  304. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store/false.js +0 -0
  305. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store/true.js +0 -0
  306. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store.js +0 -0
  307. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/subparsers.js +0 -0
  308. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/version.js +0 -0
  309. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action.js +0 -0
  310. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action_container.js +0 -0
  311. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argparse.js +0 -0
  312. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument/error.js +0 -0
  313. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument/exclusive.js +0 -0
  314. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument/group.js +0 -0
  315. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument_parser.js +0 -0
  316. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/const.js +0 -0
  317. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/help/added_formatters.js +0 -0
  318. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/help/formatter.js +0 -0
  319. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/namespace.js +0 -0
  320. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/utils.js +0 -0
  321. /package/node_modules/{argparse → mammoth/node_modules/argparse}/package.json +0 -0
@@ -1,90 +1,62 @@
1
- [![CI](https://github.com/Borewit/music-metadata/actions/workflows/ci.yml/badge.svg)](https://github.com/Borewit/music-metadata/actions/workflows/ci.yml)
1
+ ![Node.js CI](https://github.com/Borewit/music-metadata/workflows/Node.js%20CI/badge.svg)
2
+ [![Build status](https://ci.appveyor.com/api/projects/status/tgtqynlon8t99qq5/branch/commonjs?svg=true)](https://ci.appveyor.com/project/Borewit/music-metadata/branch/commonjs)
2
3
  [![NPM version](https://img.shields.io/npm/v/music-metadata.svg)](https://npmjs.org/package/music-metadata)
3
- [![npm downloads](http://img.shields.io/npm/dm/music-metadata.svg)](https://npmcharts.com/compare/music-metadata?start=600&interval=7)
4
- [![Coverage Status](https://coveralls.io/repos/github/Borewit/music-metadata/badge.svg?branch=master)](https://coveralls.io/github/Borewit/music-metadata?branch=master)
4
+ [![npm downloads](http://img.shields.io/npm/dm/music-metadata.svg)](https://npmcharts.com/compare/music-metadata,jsmediatags,musicmetadata,node-id3,mp3-parser,id3-parser,wav-file-info?start=600)
5
+ [![Coverage Status](https://coveralls.io/repos/github/Borewit/music-metadata/badge.svg?branch=commonjs)](https://coveralls.io/github/Borewit/music-metadata?branch=commonjs)
5
6
  [![Codacy Badge](https://api.codacy.com/project/badge/Grade/57d731b05c9e41889a2a17cb4b0384d7)](https://app.codacy.com/app/Borewit/music-metadata?utm_source=github.com&utm_medium=referral&utm_content=Borewit/music-metadata&utm_campaign=Badge_Grade_Dashboard)
6
- [![CodeQL](https://github.com/Borewit/music-metadata/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/Borewit/music-metadata/actions/workflows/codeql-analysis.yml)
7
+ [![CodeQL](https://github.com/Borewit/music-metadata/actions/workflows/codeql-analysis.yml/badge.svg?branch=commonjs)](https://github.com/Borewit/music-metadata/actions/workflows/codeql-analysis.yml)
7
8
  [![DeepScan grade](https://deepscan.io/api/teams/5165/projects/6938/branches/61821/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=5165&pid=6938&bid=61821)
8
9
  [![Known Vulnerabilities](https://snyk.io/test/github/Borewit/music-metadata/badge.svg?targetFile=package.json)](https://snyk.io/test/github/Borewit/music-metadata?targetFile=package.json)
10
+ [![Discord](https://img.shields.io/discord/460524735235883049.svg)](https://discord.gg/KyBr6sb)
9
11
 
10
12
  # music-metadata
11
13
 
12
- <img src="image/logo-music-metadata.jpg" width="60%" style="display: block; margin: auto;" alt="logo">
13
-
14
- Key features:
15
- - **Comprehensive Format Support**: Supports popular audio formats like MP3, MP4, FLAC, Ogg, WAV, AIFF, and more.
16
- - **Extensive Metadata Extraction**: Extracts detailed metadata, including ID3v1, ID3v2, APE, Vorbis, and iTunes/MP4 tags.
17
- - **Streaming Support**: Efficiently handles large audio files by reading metadata from streams, making it suitable for server-side and browser-based applications.
18
- - **Promise-Based API**: Provides a modern, promise-based API for easy integration into asynchronous workflows.
19
- - **Cross-Platform**: Works in both [Node.js](https://nodejs.org/) and browser environments with the help of bundlers like [Webpack](https://webpack.js.org/) or [Rollup](https://rollupjs.org/introduction/).
20
-
21
- The [`music-metadata`](https://github.com/Borewit/music-metadata) module is ideal for developers working on media applications, music players, or any project that requires access to detailed audio file metadata.
22
-
23
- ## Compatibility
24
-
25
- Module: version 8 migrated from [CommonJS](https://en.wikipedia.org/wiki/CommonJS) to [pure ECMAScript Module (ESM)](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
26
- The distributed JavaScript codebase is compliant with the [ECMAScript 2020 (11th Edition)](https://en.wikipedia.org/wiki/ECMAScript_version_history#11th_Edition_%E2%80%93_ECMAScript_2020) standard.
27
-
28
- > [!NOTE]
29
- > See also [CommonJS backward Compatibility](#commonjs-backward-compatibility)
30
-
31
- This module requires a [Node.js ≥ 18](https://nodejs.org/en/about/previous-releases) engine.
32
- It can also be used in a browser environment when bundled with a module bundler.
33
-
34
- ## Support the Project
35
- If you find this project useful and would like to support its development, consider sponsoring or contributing:
36
-
37
- - [Become a sponsor to Borewit](https://github.com/sponsors/Borewit)
38
-
39
- - Buy me a coffee:
40
-
41
- <a href="https://www.buymeacoffee.com/borewit" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy me A coffee" height="41" width="174"></a>
14
+ Stream and file based music metadata parser for [node.js](https://nodejs.org/).
15
+ Supports any common audio and tagging format.
16
+ [TypeScript](https://www.typescriptlang.org/) definitions are included.
42
17
 
43
18
  ## Features
44
19
 
45
20
  ### Support for audio file types
46
21
 
47
- | Audio format | Description | Logo |
48
- |---------------------------------------------------------------------------|-----------------------------------------------------------|--------------------------------------------------------------------------------------------------|
49
- | [AIFF / AIFF-C](https://wikipedia.org/wiki/Audio_Interchange_File_Format) | Audio Interchange File Format | <img src="./image/logo-Apple_Computer_Logo_rainbow.svg" width="40" alt="Apple rainbow logo"> |
50
- | [AAC](https://en.wikipedia.org/wiki/Advanced_Audio_Coding) | ADTS / Advanced Audio Coding | <img src="./image/logo-AAC_original.svg" width="40" alt="AAC logo"> |
51
- | [APE](https://wikipedia.org/wiki/Monkey's_Audio) | Monkey's Audio | <img src="./image/logo-APE-AI.svg" width="40" alt="Monkey's Audio logo"> |
52
- | [ASF](https://wikipedia.org/wiki/Advanced_Systems_Format) | Advanced Systems Format | |
53
- | [BWF](https://en.wikipedia.org/wiki/Broadcast_Wave_Format) | Extended WAV format for broadcast and archiving | |
54
- | [DSDIFF](https://wikipedia.org/wiki/Direct_Stream_Digital) | Philips DSDIFF | <img src="./image/logo-DSD.svg" width="80" alt="DSD logo"> |
55
- | [DSF](https://wikipedia.org/wiki/Direct_Stream_Digital) | Sony's DSD Stream File | <img src="./image/logo-DSD.svg" width="80" alt="DSD logo"> |
56
- | [FLAC](https://wikipedia.org/wiki/FLAC) | Free Lossless Audio Codec | <img src="./image/logo-FLAC.svg" width="80" alt="FLAC logo"> |
57
- | [MP2](https://wikipedia.org/wiki/MPEG-1_Audio_Layer_II) | MPEG-1 Audio Layer II (predecessor to MP3) | |
58
- | [Matroska](https://wikipedia.org/wiki/Matroska) | Matroska (EBML), mka, mkv | <img src="./image/logo-Matroska_2010.svg" width="80" alt="Matroska logo"> |
59
- | [MP3](https://wikipedia.org/wiki/MP3) | MPEG-1 / MPEG-2 Audio Layer III | <img src="./image/logo-Mp3.svg" width="80" alt="MP3 logo"> |
60
- | [MPC](https://wikipedia.org/wiki/Musepack) | Musepack SV7 | <img src="./image/logo-Musepack.svg" width="80" alt="musepack logo"> |
61
- | [MPEG 4](https://wikipedia.org/wiki/MPEG-4) | mp4, m4a, m4v | <img src="./image/logo-MPEG4-350581.svg" width="80" alt="mpeg 4 logo"> |
62
- | [Ogg](https://en.wikipedia.org/wiki/Ogg) | Open container format | <img src="./image/logo-Ogg.svg" width="80" alt="Ogg logo"> |
63
- | [Opus](https://wikipedia.org/wiki/Opus_(audio_format)) | Low-latency, high-quality codec for speech and music | <img src="./image/logo-Opus.svg" width="80" alt="Opus logo"> |
64
- | [Speex](https://wikipedia.org/wiki/Speex) | Open-source speech codec optimized for VoIP | <img src="./image/logo-Speex_2006.svg" width="80" alt="Speex logo"> |
65
- | [Theora](https://en.wikipedia.org/wiki/Theora) | Open video compression format (typically paired with Ogg) | <img src="./image/logo-Theora_2007.svg" width="70" alt="Theora logo"> |
66
- | [Vorbis](https://wikipedia.org/wiki/Ogg_Vorbis) | Vorbis audio compression | <img src="./image/logo-Vorbis_many_fish_2005.svg" width="70" alt="Vorbis logo"> |
67
- | [WAV](https://wikipedia.org/wiki/WAV) | Uncompressed PCM audio in RIFF container | |
68
- | [WebM](https://wikipedia.org/wiki/WebM) | WebM | <img src="./image/logo-WebM.svg" width="80" alt="Matroska logo"> |
69
- | [WV](https://wikipedia.org/wiki/WavPack) | WavPack | <img src="./image/logo-wavpack.svg" width="60" alt="WavPack logo"> |
70
- | [WMA](https://wikipedia.org/wiki/Windows_Media_Audio) | Windows Media Audio | <img src="./image/logo-Windows_Media_Player_simplified.svg" width="40" alt="Windows Media logo"> |
22
+ | Audio format | Description | Wiki | |
23
+ | ------------- |---------------------------------| -------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------:|
24
+ | AIFF / AIFF-C | Audio Interchange File Format | [:link:](https://wikipedia.org/wiki/Audio_Interchange_File_Format) | <img src="https://upload.wikimedia.org/wikipedia/commons/8/84/Apple_Computer_Logo_rainbow.svg" width="40" alt="Apple rainbow logo"> |
25
+ | AAC | ADTS / Advanced Audio Coding | [:link:](https://en.wikipedia.org/wiki/Advanced_Audio_Coding) | <img src="https://svgshare.com/i/UT8.svg" width="40" alt="AAC logo"> |
26
+ | APE | Monkey's Audio | [:link:](https://wikipedia.org/wiki/Monkey's_Audio) | <img src="https://foreverhits.files.wordpress.com/2015/05/ape_audio.jpg" width="40" alt="Monkey's Audio logo"> |
27
+ | ASF | Advanced Systems Format | [:link:](https://wikipedia.org/wiki/Advanced_Systems_Format) | |
28
+ | BWF | Broadcast Wave Format | [:link:](https://en.wikipedia.org/wiki/Broadcast_Wave_Format) | |
29
+ | DSDIFF | Philips DSDIFF | [:link:](https://wikipedia.org/wiki/Direct_Stream_Digital) | <img src="https://upload.wikimedia.org/wikipedia/commons/b/bc/DSDlogo.svg" width="80" alt="DSD logo"> |
30
+ | DSF | Sony's DSD Stream File | [:link:](https://wikipedia.org/wiki/Direct_Stream_Digital) | <img src="https://upload.wikimedia.org/wikipedia/commons/b/bc/DSDlogo.svg" width="80" alt="DSD logo"> |
31
+ | FLAC | Free Lossless Audio Codec | [:link:](https://wikipedia.org/wiki/FLAC) | <img src="https://upload.wikimedia.org/wikipedia/commons/a/a2/FLAC_logo_vector.svg" width="80" alt="FLAC logo"> |
32
+ | MP2 | MPEG-1 Audio Layer II | [:link:](https://wikipedia.org/wiki/MPEG-1_Audio_Layer_II) | |
33
+ | Matroska | Matroska (EBML), mka, mkv | [:link:](https://wikipedia.org/wiki/Matroska) | <img src="https://upload.wikimedia.org/wikipedia/commons/1/1a/Matroska_2010.svg" width="80" alt="Matroska logo"> |
34
+ | MP3 | MPEG-1 / MPEG-2 Audio Layer III | [:link:](https://wikipedia.org/wiki/MP3) | <img src="https://upload.wikimedia.org/wikipedia/commons/e/ea/Mp3.svg" width="80" alt="MP3 logo"> |
35
+ | MPC | Musepack SV7 | [:link:](https://wikipedia.org/wiki/Musepack) | <img src="https://www.musepack.net/pictures/musepack_logo.png" width="80" alt="musepack logo"> |
36
+ | MPEG 4 | mp4, m4a, m4v | [:link:](https://wikipedia.org/wiki/MPEG-4) | <img src="https://svgshare.com/i/UU3.svg" width="80" alt="mpeg 4 logo"> |
37
+ | Ogg | Open container format | [:link:](https://en.wikipedia.org/wiki/Ogg) | <img src="https://upload.wikimedia.org/wikipedia/commons/a/a1/Ogg_Logo.svg" width="80" alt="Ogg logo"> |
38
+ | Opus | | [:link:](https://wikipedia.org/wiki/Opus_(audio_format)) | <img src="https://upload.wikimedia.org/wikipedia/commons/0/02/Opus_logo2.svg" width="80" alt="Opus logo"> |
39
+ | Speex | | [:link:](https://wikipedia.org/wiki/Speex) | <img src="https://upload.wikimedia.org/wikipedia/commons/b/b5/Speex_logo_2006.svg" width="80" alt="Speex logo"> |
40
+ | Theora | | [:link:](https://en.wikipedia.org/wiki/Theora) | <img src="https://upload.wikimedia.org/wikipedia/commons/5/57/Theora_logo_2007.svg" width="70" alt="Theora logo"> |
41
+ | Vorbis | Vorbis audio compression | [:link:](https://wikipedia.org/wiki/Ogg_Vorbis) | <img src="https://upload.wikimedia.org/wikipedia/commons/8/8d/Xiph.Org_logo_square.svg" width="70" alt="Vorbis logo"> |
42
+ | WAV | RIFF WAVE | [:link:](https://wikipedia.org/wiki/WAV) | |
43
+ | WebM | webm | [:link:](https://wikipedia.org/wiki/WebM) | <img src="https://upload.wikimedia.org/wikipedia/commons/3/34/WebM_logo.svg" width="80" alt="Matroska logo"> |
44
+ | WV | WavPack | [:link:](https://wikipedia.org/wiki/WavPack) | <img src="http://www.wavpack.com/wavpacklogo.svg" width="60" alt="WavPack logo"> |
45
+ | WMA | Windows Media Audio | [:link:](https://wikipedia.org/wiki/Windows_Media_Audio) | <img src="https://upload.wikimedia.org/wikipedia/commons/7/76/Windows_Media_Player_simplified_logo.svg" width="40" alt="Windows Media logo"> |
71
46
 
72
47
  ### Supported tag headers
73
48
 
74
49
  Following tag header formats are supported:
75
- - [APE](https://wikipedia.org/wiki/APE_tag)
76
- - [ASF](https://wikipedia.org/wiki/Advanced_Systems_Format)
77
- - EXIF 2.3
78
- - [ID3](https://wikipedia.org/wiki/ID3): ID3v1, ID3v1.1, ID3v2.2, [ID3v2.3](http://id3.org/id3v2.3.0), [ID3v2.4](http://id3.org/id3v2.4.0-frames) and [ID3v2 Chapters 1.0](https://mutagen-specs.readthedocs.io/en/latest/id3/id3v2-chapters-1.0.html)
79
- - [iTunes](https://github.com/sergiomb2/libmp4v2/wiki/iTunesMetadata)
80
- - [RIFF](https://wikipedia.org/wiki/Resource_Interchange_File_Format)/INFO
81
- - [Vorbis comment](https://wikipedia.org/wiki/Vorbis_comment)
82
- - [AIFF](https://wikipedia.org/wiki/Audio_Interchange_File_Format)
83
-
84
- Following lyric formats are supported:
85
- - [LRC](https://en.wikipedia.org/wiki/LRC_(file_format))
86
- - Synchronized lyrics (SYLT)
87
- - Unsynchronized lyrics (USULT)
50
+ * [APE](https://wikipedia.org/wiki/APE_tag)
51
+ * [ASF](https://wikipedia.org/wiki/Advanced_Systems_Format)
52
+ * EXIF 2.3
53
+ * [ID3](https://wikipedia.org/wiki/ID3): ID3v1, ID3v1.1, ID3v2.2, [ID3v2.3](http://id3.org/id3v2.3.0) & [ID3v2.4](http://id3.org/id3v2.4.0-frames)
54
+ * [iTunes](https://github.com/sergiomb2/libmp4v2/wiki/iTunesMetadata)
55
+ * [RIFF](https://wikipedia.org/wiki/Resource_Interchange_File_Format)/INFO
56
+ * [Vorbis comment](https://wikipedia.org/wiki/Vorbis_comment)
57
+ * [AIFF](https://wikipedia.org/wiki/Audio_Interchange_File_Format)
58
+
59
+ It allows many tags to be accessed in audio format, and tag format independent way.
88
60
 
89
61
  Support for [MusicBrainz](https://musicbrainz.org/) tags as written by [Picard](https://picard.musicbrainz.org/).
90
62
  [ReplayGain](https://wiki.hydrogenaud.io/index.php?title=ReplayGain) tags are supported.
@@ -92,17 +64,40 @@ Support for [MusicBrainz](https://musicbrainz.org/) tags as written by [Picard](
92
64
  ### Audio format & encoding details
93
65
 
94
66
  Support for encoding / format details:
95
- - [Bit rate](https://wikipedia.org/wiki/Bit_rate)
96
- - [Audio bit depth](https://wikipedia.org/wiki/Audio_bit_depth)
97
- - Duration
98
- - Encoding profile (e.g. [CBR](https://en.wikipedia.org/wiki/Constant_bitrate), V0, V2)
99
-
67
+ * [Bit rate](https://wikipedia.org/wiki/Bit_rate)
68
+ * [Audio bit depth](https://wikipedia.org/wiki/Audio_bit_depth)
69
+ * Duration
70
+ * Encoding profile (e.g. [CBR](https://en.wikipedia.org/wiki/Constant_bitrate), V0, V2)
71
+
100
72
 
101
73
  ## Online demo's
102
- - [<img src="https://raw.githubusercontent.com/Borewit/audio-tag-analyzer/master/src/assets/icon/audio-tag-analyzer.svg" width="40">Audio Tag Analyzer](https://audio-tag-analyzer.netlify.app/)
103
- - [<img src="https://cdn.sanity.io/images/3do82whm/next/ba8c847f13a5fa39d88f8bc9b7846b7886531b18-2500x2500.svg" width="40"> Webamp](https://webamp.org/)
104
- - [ICY Radio Stream Player](https://icy-radio-stream-player.netlify.app/)
105
- - Expected to be released soon: [Overtone](https://overtone.pro/) by [Johannes Schickling](https://github.com/schickling)
74
+ * [<img src="https://raw.githubusercontent.com/Borewit/audio-tag-analyzer/master/src/assets/icon/audio-tag-analyzer.svg" width="40">Audio Tag Analyzer](https://audio-tag-analyzer.netlify.com/)
75
+ * [<img src="https://cdn.sanity.io/images/3do82whm/next/ba8c847f13a5fa39d88f8bc9b7846b7886531b18-2500x2500.svg" width="40"> Webamp](https://webamp.org/)
76
+
77
+
78
+ ## Compatibility
79
+
80
+ The JavaScript in runtime is compliant with [ECMAScript 2017 (ES8)](https://en.wikipedia.org/wiki/ECMAScript#8th_Edition_-_ECMAScript_2017).
81
+ Requires [Node.js®](https://nodejs.org/) version 6 or higher.
82
+
83
+ ### Browser Support
84
+
85
+ Although music-metadata is designed to run the node.js. [music-metadata-browser](https://github.com/Borewit/music-metadata-browser) can be used on the browser side.
86
+
87
+ To avoid Node `fs` dependency inclusion, you may use a sub-module inclusion:
88
+ ```js
89
+ import * as mm from 'music-metadata/lib/core';
90
+ ```
91
+
92
+ | function | `music-metadata` | `music-metadata/lib/core` |
93
+ |------------------------------------------------------| ---------------------------|----------------------------|
94
+ | [`parseBuffer`](#parsebuffer-function) | ✓ | ✓ |
95
+ | [`parseStream`](#parsestream-function) * | ✓ | ✓ |
96
+ | [`parseFromTokenizer`](#parsefromtokenizer-function) | ✓ | ✓ |
97
+ | [`parseFile`](#parsefile-function) | ✓ | |
98
+
99
+ ### Sponsor
100
+ [Become a sponsor to Borewit](https://github.com/sponsors/Borewit)
106
101
 
107
102
  ## Usage
108
103
 
@@ -117,433 +112,102 @@ or using [yarn](https://yarnpkg.com/):
117
112
  yarn add music-metadata
118
113
  ```
119
114
 
120
- ## API Documentation
121
-
122
- ### Overview
123
-
124
- **Node.js specific** functions to read an audio file or stream:
125
- 1. **File Parsing**: Parse audio files directly from the filesystem using the [parseFile function](#parsefile-function)
126
- 1. **Stream Parsing**: Parse audio metadata from a Node.js [Readable stream](https://nodejs.org/api/stream.html#class-streamreadable) using the [parseStream function](#parsewebstream-function).
127
-
128
- **Cross-platform** functions available to read an audio file or stream:
129
-
130
- There are multiple ways to parse (read) audio tracks:
131
- 1. **Web Stream Parsing**: Parse audio data from a web-compatible [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream) using the [parseWebStream function](#parsewebstream-function).
132
- 1. **Blob Parsing**: Parse audio metadata from a (Web API) [Blob](https://developer.mozilla.org/docs/Web/API/Blob) or [File](https://developer.mozilla.org/docs/Web/API/File) using the [parseBlob function](#parseblob-function).
133
- 1. **Buffer Parsing**: Parse audio metadata from a [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) or [Buffer](https://nodejs.org/api/buffer.html) using the [parseBuffer function](#parsebuffer-function).
134
- 1. **Tokenizer Parsing:** Use a custom or third-party [strtok3](https://github.com/Borewit/strtok3) `ITokenizer` to parse using the [parseFromTokenizer function](#parsefromtokenizer-function).
135
-
136
- > [!NOTE]
137
- > Direct file access in Node.js is generally faster because it can 'jump' to various parts of the file without reading intermediate data.
138
-
139
- ### Node.js specific function
140
- These functions are tailored for Node.js environments and leverage Node.js-specific APIs,
141
- making them incompatible with browser-based JavaScript engines.
115
+ ### Import music-metadata
142
116
 
143
- #### `parseFile` function
144
-
145
- The `parseFile` function is intended for extracting metadata from audio files on the local filesystem in a Node.js environment.
146
- It reads the specified file, parses its audio metadata, and returns a promise that resolves with this information.
147
-
148
- ##### Syntax
149
- ```ts
150
- parseFile(filePath: string, options?: IOptions): Promise<IAudioMetadata>
151
- ```
152
-
153
- ##### Parameters
154
-
155
- - `filePath`: `string`
156
-
157
- The path to the media file from which metadata should be extracted.
158
- This should be a valid path to an audio file on the local filesystem.
159
-
160
- - `options`: [IOptions](#ioptions-interface) (optional)
161
-
162
- An optional configuration object that allows customization of the parsing process.
163
- These options can include whether to calculate the file's duration, skip embedded cover art,
164
- or other parsing behaviors.
165
-
166
- ##### Returns
167
-
168
- - `Promise<IAudioMetadata>`:
169
-
170
- A promise that resolves to an IAudioMetadata object containing metadata about the audio file.
171
- The metadata includes details such as the file format, codec, duration, bit rate, and any embedded tags like album, artist, or track information.
172
-
173
- ##### Usage Notes
174
-
175
- - This function is **Node.js-only** and relies on Node.js-specific APIs to access the filesystem.
176
-
177
- - For browser environments, consider using the [parseBlob](#parseblob-function) to parse [File object](https://developer.mozilla.org/en-US/docs/Web/API/File) objects.
178
-
179
- ##### Example:
180
-
181
- The following example demonstrates how to use the parseFile function to read metadata from an audio file:
182
- ```js
183
- import { parseFile } from 'music-metadata';
184
- import { inspect } from 'node:util';
185
-
186
- (async () => {
187
- try {
188
- const filePath = 'test/samples/MusicBrainz - Beth Hart - Sinner\'s Prayer [id3v2.3].V2.mp3';
189
- const metadata = await parseFile(filePath);
190
-
191
- // Output the parsed metadata to the console in a readable format
192
- console.log(inspect(metadata, { showHidden: false, depth: null }));
193
- } catch (error) {
194
- console.error('Error parsing metadata:', error.message);
195
- }
196
- })();
117
+ Import music-metadata in JavaScript:
118
+ ```JavaScript
119
+ const mm = require('music-metadata');
197
120
  ```
198
121
 
199
- #### `parseStream` function
200
-
201
- The parseStream function is used to parse metadata from an audio track provided as a Node.js [`Readable`](https://nodejs.org/api/stream.html#class-streamreadable) stream.
202
- This is particularly useful for processing audio data that is being streamed or piped from another source, such as a web server or file system.
203
-
204
- ##### Syntax:
122
+ This is how it's done in TypeScript:
205
123
  ```ts
206
- parseStream(stream: Readable, fileInfo?: IFileInfo | string, options?: IOptions): Promise<IAudioMetadata>
124
+ import * as mm from 'music-metadata';
207
125
  ```
208
126
 
209
- ##### Parameters:
127
+ ### Module Functions
210
128
 
211
- - `stream`: `Readable`:
212
-
213
- The Node.js [Readable](https://nodejs.org/api/stream.html#class-streamreadable) stream from which the audio data is read.
214
- This stream should provide the raw audio data to be analyzed.
129
+ There are two ways to parse (read) audio tracks:
130
+ 1) Audio (music) files can be parsed using direct file access using the [parseFile function](#parsefile)
131
+ 2) Using [Node.js streams](https://nodejs.org/api/stream.html) using the [parseStream function](#parseStream).
215
132
 
216
- - `fileInfo`: `IFileInfo` (optional)
133
+ Direct file access tends to be a little faster, because it can 'jump' to various parts in the file without being obliged to read intermediate data.
217
134
 
218
- An object containing file-related information or a string representing the MIME-type of the audio stream.
219
- The fileInfo parameter can help the parser to correctly identify the audio format and may include:
135
+ #### parseFile function
220
136
 
221
- - `mimeType`: A string representing the [MIME-type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) (e.g., `audio/mpeg`).
222
-
223
- If provided, it is assumed the streamed file content is to be the MIME-type.
224
- If not provided, the parser will attempt to determine the format based on the content of the stream.
225
-
226
- - `size`: The total size of the audio stream in bytes (useful for streams with a known length).
227
-
228
- - `path`: A string representing the file path or filename, which can also assist in determining the format.
229
-
230
- - `options`: `IOptions` (optional)
231
-
232
- An optional object containing additional parsing options.
233
- These options allow you to customize the parsing process,
234
- such as whether to calculate the duration or skip cover art extraction.
235
-
236
- ##### Returns
237
-
238
- - `Promise<IAudioMetadata>`:
239
-
240
- A promise that resolves to an `IAudioMetadata` object containing detailed metadata about the audio stream.
241
- This metadata includes information about the format, codec, duration, bitrate, and any embedded tags such as artist, album, or track information.
242
-
243
- ##### Usage Notes
244
- - This function is only available in Node.js environments, as it relies on the [Node.js stream API](https://nodejs.org/api/stream.html).
245
-
246
- ##### Example:
247
-
248
- The following example demonstrates how to use the `parseStream` function to read metadata from an audio stream:
249
- ```js
250
- import { parseStream } from 'music-metadata';
251
- import { createReadStream } from 'fs';
252
-
253
- (async () => {
254
- try {
255
- // Create a readable stream from a file
256
- const audioStream = createReadStream('path/to/audio/file.mp3');
257
-
258
- // Parse the metadata from the stream
259
- const metadata = await parseStream(audioStream, { mimeType: 'audio/mpeg'});
260
-
261
- // Log the parsed metadata
262
- console.log(metadata);
263
- } catch (error) {
264
- console.error('Error parsing metadata:', error.message);
265
- }
266
- })();
137
+ Parses the specified file (`filePath`) and returns a promise with the metadata result (`IAudioMetadata`).
267
138
 
268
139
  ```
269
-
270
- ### Cross-platform functions
271
- These functions are designed to be cross-platform,
272
- meaning it can be used in both Node.js and web browsers.
273
-
274
- #### `parseWebStream` function
275
-
276
- The parseWebStream function is used to extract metadata from an audio track provided as a web-compatible ReadableStream.
277
- This function is ideal for applications running in web environments, such as browsers,
278
- where audio data is streamed over the network or read from other web-based sources.
279
-
280
-
281
- ##### Syntax
282
- ```ts
283
- parseWebStream(webStream: ReadableStream<Uint8Array>, fileInfo?: IFileInfo | string, options?: IOptions): Promise<IAudioMetadata>
140
+ parseFile(filePath: string, opts: IOptions = {}): Promise<IAudioMetadata>`
284
141
  ```
285
142
 
286
- ##### Parameters
287
-
288
- - `webStream`: `ReadableStream<Uint8Array>`
289
-
290
- A [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream) that provides the audio data to be parsed.
291
- This stream should emit Uint8Array chunks, representing the raw audio data.
292
-
293
- - `fileInfo`: `IFileInfo` (optional)
294
-
295
- An object containing file-related information or a string representing the MIME-type of the audio stream.
296
- The fileInfo parameter can help the parser to correctly identify the audio format and may include:
297
-
298
- - `mimeType`: A string representing the [MIME-type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) (e.g., `audio/mpeg`).
299
-
300
- If provided, it is assumed the streamed file content is to be the MIME-type.
301
- If not provided, the parser will attempt to determine the format based on the content of the stream.
302
-
303
- - `size`: The total size of the audio stream in bytes (useful for streams with a known length).
304
-
305
- - `path`: A string representing the file path or filename, which can also assist in determining the format.
306
-
307
- - `options`: `IOptions` (optional)
308
-
309
- An optional object containing additional parsing options.
310
- These options allow you to customize the parsing process,
311
- such as whether to calculate the duration or skip cover art extraction.
312
-
313
- ##### Returns
314
-
315
- - `Promise<IAudioMetadata>`:
316
-
317
- A promise that resolves to an `IAudioMetadata` object containing detailed metadata about the audio stream.
318
- This metadata includes information about the format, codec, duration, bitrate, and any embedded tags such as artist, album, or track information.
319
-
320
- ##### Example
321
- Here’s an example of how to use the `parseWebStream` function to extract metadata from an audio stream in a web application:
322
-
143
+ Example:
323
144
  ```js
324
- import { parseWebStream } from 'music-metadata';
145
+ const mm = require('music-metadata');
146
+ const util = require('util');
325
147
 
326
148
  (async () => {
327
149
  try {
328
- // Fetch the audio file
329
- const response = await fetch('https://github.com/Borewit/test-audio/raw/refs/heads/master/Various%20Artists%20-%202008%20-%20netBloc%20Vol%2013%20-%20Color%20in%20a%20World%20of%20Monochrome%20%5BAAC-40%5D/1.02.%20Solid%20Ground.m4a');
330
-
331
- // Extract the Content-Length header and convert it to a number
332
- const contentLength = response.headers.get('Content-Length');
333
- const size = contentLength ? parseInt(contentLength, 10) : undefined;
334
-
335
- // Parse the metadata from the web stream
336
- const metadata = await parseWebStream(response.body, {
337
- mimeType: response.headers.get('Content-Type'),
338
- size // Important to pass the content-length
339
- });
340
-
341
- console.log(metadata);
150
+ const metadata = await mm.parseFile('../music-metadata/test/samples/MusicBrainz - Beth Hart - Sinner\'s Prayer [id3v2.3].V2.mp3');
151
+ console.log(util.inspect(metadata, { showHidden: false, depth: null }));
342
152
  } catch (error) {
343
- console.error('Error parsing metadata:', error.message);
153
+ console.error(error.message);
344
154
  }
345
155
  })();
346
156
  ```
347
157
 
348
- The example uses the [`fetch` API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to retrieve an audio file from a URL.
349
- The `response.body` provides a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream) that is then passed to `parseWebStream`.
350
-
351
- #### `parseBlob` function
158
+ #### parseStream function
352
159
 
353
- Parses metadata from an audio file represented as a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob).
354
- This function is suitable for use in environments that support the ReadableStreamBYOBReader, which is **available in Node.js 20** and above.
160
+ Parses the provided audio stream for metadata.
161
+ It is recommended to provide the corresponding [MIME-type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types).
162
+ An extension (e.g.: `.mp3`), filename or path will also work.
163
+ If the MIME-type or filename (via `fileInfo.path`) is not provided, or not understood, music-metadata will try to derive the type from the content.
355
164
 
356
- ##### Syntax
357
165
  ```ts
358
- parseBlob(blob: Blob, options?: IOptions = {}): Promise<IAudioMetadata>
166
+ parseStream(stream: Stream.Readable, fileInfo?: IFileInfo | string, opts?: IOptions = {}): Promise<IAudioMetadata>`
359
167
  ```
360
168
 
361
- ##### Parameters
362
-
363
- - `blob`: [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
364
-
365
- The Blob object containing the audio data to be parsed.
366
- This can be a file or any binary data. If the Blob is an instance of File, its name will be used as the file path in the metadata.
367
-
368
- - `options`: [IOptions](#ioptions-interface) (optional)
369
-
370
- An optional configuration object that specifies parsing options.
371
-
372
- ##### Returns
373
-
374
- - `Promise<IAudioMetadata>`:
375
-
376
- A promise that resolves to the metadata of the audio file.
377
-
378
- ##### Example
379
-
169
+ Example:
380
170
  ```js
381
- import { parseBlob } from 'music-metadata';
171
+ const mm = require('music-metadata');
382
172
 
383
173
  (async () => {
384
- const fileInput = document.querySelector('input[type="file"]');
385
- const file = fileInput.files[0];
386
-
387
174
  try {
388
- const metadata = await parseBlob(file);
175
+ const metadata = await mm.parseStream(someReadStream, {mimeType: 'audio/mpeg', size: 26838});
389
176
  console.log(metadata);
390
177
  } catch (error) {
391
- console.error('Error parsing metadata:', error.message);
178
+ console.error(error.message);
392
179
  }
393
180
  })();
394
181
  ```
395
182
 
396
- #### `parseBuffer` function
183
+ #### parseBuffer function
397
184
 
398
- Parses metadata from an audio file where the audio data is held in a [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) or [Buffer](https://nodejs.org/api/buffer.html).
399
- This function is particularly useful when you already have audio data in memory.
185
+ Parse metadata from an audio file, where the audio file is held in a [Buffer](https://nodejs.org/api/buffer.html).
400
186
 
401
- ##### Syntax
402
187
  ```ts
403
- parseBuffer(buffer: Uint8Array, fileInfo?: IFileInfo | string, opts?: IOptions = {}): Promise<IAudioMetadata>
188
+ parseBuffer(buffer: Buffer, fileInfo?: IFileInfo | string, opts?: IOptions = {}): Promise<IAudioMetadata>
404
189
  ```
405
190
 
406
- ##### Parameters
407
- - `uint8Array`: [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)
408
-
409
- A [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) containing the audio data to be parsed.
410
-
411
- - `fileInfo`: `IFileInfo` | `string` (optional)
412
-
413
- An object containing file information such as mimeType and size.
414
- Alternatively, you can pass a MIME-type string directly.
415
- This helps the parser understand the format of the audio data.
416
-
417
- - `options`: [IOptions](#ioptions-interface) (optional)
418
-
419
- An optional configuration object that specifies parsing options.
420
-
421
- ##### Returns
422
- - `Promise<IAudioMetadata>`:
423
-
424
- A promise that resolves to the metadata of the audio file.
425
-
426
-
427
- ##### Example
428
-
191
+ Example:
429
192
  ```js
430
- import { parseBuffer } from 'music-metadata';
431
- import fs from 'fs';
432
-
433
193
  (async () => {
434
- const buffer = fs.readFileSync('path/to/audio/file.mp3');
435
-
436
194
  try {
437
- const metadata = await parseBuffer(buffer, { mimeType: 'audio/mpeg' });
195
+ const metadata = mm.parseBuffer(someBuffer, 'audio/mpeg');
438
196
  console.log(metadata);
439
197
  } catch (error) {
440
- console.error('Error parsing metadata:', error.message);
198
+ console.error(error.message);
441
199
  }
442
200
  })();
443
201
  ```
444
202
 
445
- #### `parseFromTokenizer` function
446
- Parses metadata from an audio source that implements the [strtok3](https://github.com/Borewit/strtok3) ITokenizer interface.
447
- This is a low-level function that provides flexibility for advanced use cases,
448
- such as parsing metadata from streaming audio or custom data sources.
203
+ #### parseFromTokenizer function
204
+ This is a low level function, reading from a [strtok3](https://github.com/Borewit/strtok3) ITokenizer interface.
205
+ [music-metadata-browser](https://github.com/Borewit/music-metadata-browser) is depended on this function.
449
206
 
450
207
  This also enables special read modules like:
451
- - [streaming-http-token-reader](https://github.com/Borewit/streaming-http-token-reader) for chunked HTTP(S) reading, using [HTTP range requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests).
452
-
453
- ##### Syntax
454
- ```ts
455
- parseFromTokenizer(tokenizer: ITokenizer, options?: IOptions): Promise<IAudioMetadata>
456
- ```
457
-
458
- ##### Parameters
459
- - `tokenizer: ITokenizer`
460
-
461
- An instance of an ITokenizer that provides access to the audio data.
462
- The tokenizer abstracts the reading process, enabling support for various types of sources, including streams, buffers, or custom data readers.
463
-
464
- - `options`: [IOptions](#ioptions-interface) (optional)
465
-
466
- An optional configuration object that specifies parsing options.
467
-
468
- ##### Returns
469
- - `Promise<IAudioMetadata>`:
470
-
471
- A promise that resolves to the metadata of the audio source, including information like the title, artist, album, and more.
472
-
473
-
474
- ##### Example
475
- ````js
476
- import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
477
- import { S3Client } from '@aws-sdk/client-s3';
478
- import { makeTokenizer } from '@tokenizer/s3';
479
- import { parseFromTokenizer as mmParseFromTokenizer } from 'music-metadata';
480
-
481
- // Configure the S3 client
482
- const s3 = new S3Client({
483
- region: 'eu-west-2',
484
- credentials: fromNodeProviderChain(),
485
- });
486
-
487
- // Helper function to create a tokenizer for S3 objects
488
- async function makeS3TestDataTokenizer(key, options) {
489
- return await makeTokenizer(s3, {
490
- Bucket: 'music-metadata',
491
- Key: key,
492
- }, options);
493
- }
494
-
495
- // Function to read and log metadata from an S3 object
496
- async function readMetadata() {
497
- try {
498
- // Create a tokenizer for the specified S3 object
499
- const tokenizer = await makeS3TestDataTokenizer('path/to/audio/file.mp3', { disableChunked: false });
500
-
501
- // Parse the metadata from the tokenizer
502
- const metadata = await mmParseFromTokenizer(tokenizer);
503
-
504
- // Log the retrieved metadata
505
- console.log(metadata);
506
- } catch (error) {
507
- console.error('Error parsing metadata:', error.message);
508
- }
509
- }
510
-
511
- // Execute the metadata reading function
512
- readMetadata();
513
- ````
514
- ##### Additional Resources
515
- - [strtok3](https://github.com/Borewit/strtok3) - Learn more about the `ITokenizer` interface and how to implement it for various use cases.
516
- - [AWS SDK for JavaScript](https://aws.amazon.com/sdk-for-javascript/) - Documentation on using the AWS SDK to interact with S3 and other AWS services.
517
- - [@tokenizer/s3](https://github.com/Borewit/tokenizer-s3) - Example of `ITokenizer` implementation.
208
+ * [streaming-http-token-reader](https://github.com/Borewit/streaming-http-token-reader) for chunked HTTP(S) reading, using [HTTP range requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests).
518
209
 
519
- ### Handling Parse Errors
520
-
521
- `music-metadata` provides a robust and extensible error handling system with custom error classes that inherit from the standard JavaScript `Error`.
522
- All possible parsing errors are part of a union type `UnionOfParseErrors`, ensuring that every error scenario is accounted for in your code.
523
-
524
- #### Union of Parse Errors
525
-
526
- All parsing errors extend from the base class `ParseError` and are included in the `UnionOfParseErrors` type:
527
- ```ts
528
- export type UnionOfParseErrors =
529
- | CouldNotDetermineFileTypeError
530
- | UnsupportedFileTypeError
531
- | UnexpectedFileContentError
532
- | FieldDecodingError
533
- | InternalParserError;
534
- ```
535
-
536
- #### Error Types
537
-
538
- - `CouldNotDetermineFileTypeError`: Raised when the file type cannot be determined.
539
- - `UnsupportedFileTypeError`: Raised when an unsupported file type is encountered.
540
- - `UnexpectedFileContentError`: Raised when the file content does not match the expected format.
541
- - `FieldDecodingError`: Raised when a specific field in the file cannot be decoded.
542
- - `InternalParserError`: Raised for internal parser errors.
543
-
544
- ### Other functions
545
-
546
- #### `orderTags` function
210
+ #### orderTags function
547
211
 
548
212
  Utility to Converts the native tags to a dictionary index on the tag identifier
549
213
 
@@ -551,29 +215,14 @@ Utility to Converts the native tags to a dictionary index on the tag identifier
551
215
  orderTags(nativeTags: ITag[]): [tagId: string]: any[]
552
216
  ```
553
217
 
554
- ```js
555
- import { parseFile, orderTags } from 'music-metadata';
556
- import { inspect } from 'util';
557
-
558
- (async () => {
559
- try {
560
- const metadata = await parseFile('../test/samples/MusicBrainz - Beth Hart - Sinner\'s Prayer [id3v2.3].V2.mp3');
561
- const orderedTags = orderTags(metadata.native['ID3v2.3']);
562
- console.log(inspect(orderedTags, { showHidden: false, depth: null }));
563
- } catch (error) {
564
- console.error(error.message);
565
- }
566
- })();
567
- ```
568
-
569
- #### `ratingToStars` function
570
-
218
+ #### ratingToStars function
219
+
571
220
  Can be used to convert the normalized rating value to the 0..5 stars, where 0 an undefined rating, 1 the star the lowest rating and 5 the highest rating.
572
-
221
+
573
222
  ```ts
574
223
  ratingToStars(rating: number): number
575
224
  ```
576
- #### `selectCover` function
225
+ #### selectCover function
577
226
 
578
227
  Select cover image based on image type field, otherwise the first picture in file.
579
228
 
@@ -582,125 +231,94 @@ export function selectCover(pictures?: IPicture[]): IPicture | null
582
231
  ```
583
232
 
584
233
  ```js
585
- import { parseFile, selectCover } from 'music-metadata';
234
+ import * as mm from 'music-metadata';
586
235
 
587
236
  (async () => {
588
- const {common} = await parseFile(filePath);
589
- const cover = selectCover(common.picture); // pick the cover image
237
+ const {common} = await mm.parseFile(filePath);
238
+ const cover = mm.selectCover(common.picture); // pick the cover image
590
239
  }
591
240
  )();
592
241
  ```
593
242
 
594
- #### `getSupportedMimeTypes` function
595
-
596
- Returns a list of supported MIME-types. This may include some MIME-types which are not formally recognized.
597
-
598
- ### `IOptions` Interface
599
- - `duration`: `boolean` (default: `false`)
600
-
601
- When `true`, the parser will read the entire media file _if necessary_ to determine the duration.
602
- This is only applicable in cases where duration cannot be reliably inferred without full file analysis.
603
- Note that enabling this option **does not guarantee** that duration will be available,
604
- only that the parser will attempt to calculate it when possible, even if it requires reading the full file.
605
-
606
- - `includeChapters`: `boolean` (default: `false`)
607
- When `true`, the MP4 parser scans the `mdat` atom for chapters.
608
-
609
- - `mkvUseIndex`: `boolean` (default: `false`)
610
-
611
- When `true`, the parser uses the SeekHead index in Matroska (MKV) files to skip segment and cluster elements.
612
- This experimental feature can improve performance, but:
613
- - Metadata not listed in the SeekHead may be skipped.
614
- - If the SeekHead is missing, this option has no effect.
243
+ ### Options
244
+ * `duration`: default: `false`, if set to `true`, it will parse the whole media file if required to determine the duration.
245
+ * `observer: (update: MetadataEvent) => void;`: Will be called after each change to `common` (generic) tag, or `format` properties.
246
+ * `skipCovers`: default: `false`, if set to `true`, it will not return embedded cover-art (images).
247
+ * `skipPostHeaders? boolean` default: `false`, if set to `true`, it will not search all the entire track for additional headers. Only recommenced to use in combination with streams.
248
+ * `includeChapters` default: `false`, if set to `true`, it will parse chapters (currently only MP4 files). _experimental functionality_
615
249
 
616
- - `observer`: `(update: MetadataEvent) => void;`:
617
-
618
- Callback function triggered when common tags or format properties are updated during parsing.
619
- Allows real-time monitoring of metadata as it becomes available.
620
-
621
- - `skipCovers`: `boolean` (default: `false`)
622
-
623
- When `true`, embedded cover art (images) will not be extracted.
624
- Useful for reducing memory and processing when cover images are unnecessary.
625
-
626
- - `skipPostHeaders`: `boolean` (default: `false`)
627
- When `true`, tag headers located at the end of the file will not be read.
628
- This is particularly beneficial for streaming input, as it avoids the need to read the entire stream.
629
-
630
- > [!NOTE]
631
- > - The `duration` option is typically included in most cases, but setting it to true ensures that the entire file is parsed if necessary to get an accurate duration.
632
- > - Using `mkvUseIndex` can improve performance in Matroska files, but be aware of potential side effects, such as missing metadata due to skipped elements.
633
-
634
-
635
- ### `IAudioMetadata` interface
250
+ Although in most cases duration is included, in some cases it requires `music-metadata` parsing the entire file.
251
+ To enforce parsing the entire file if needed you should set `duration` to `true`.
252
+
253
+ ### Metadata result
636
254
 
637
255
  If the returned promise resolves, the metadata (TypeScript `IAudioMetadata` interface) contains:
638
- - [`metadata.format`](#metadataformat) Audio format information
639
- - [`metadata.common`](#metadatacommon) Is a generic (abstract) way of reading metadata information.
640
- - [`metadata.trackInfo`](#metadatatrackInfo) Is a generic (abstract) way of reading metadata information.
641
- - `metadata.native` List of native (original) tags found in the parsed audio file.
642
-
256
+ * [`metadata.format`](#metadataformat) Audio format information
257
+ * [`metadata.common`](#metadatacommon) Is a generic (abstract) way of reading metadata information.
258
+ * [`metadata.trackInfo`](#metadatatrackInfo) Is a generic (abstract) way of reading metadata information.
259
+ * `metadata.native` List of native (original) tags found in the parsed audio file.
260
+
643
261
  #### `metadata.format`
644
262
 
645
- The questionmark `?` indicates the property is optional.
646
-
263
+ The questionmark `?` indicates the property is optional.
264
+
647
265
  Audio format information. Defined in the TypeScript `IFormat` interface:
648
- - `format.container?: string` Audio encoding format. e.g.: 'flac'
649
- - `format.codec?` Name of the codec (algorithm used for the audio compression)
650
- - `format.codecProfile?: string` Codec profile / settings
651
- - `format.tagTypes?: TagType[]` List of tagging formats found in parsed audio file
652
- - `format.duration?: number` Duration in seconds
653
- - `format.bitrate?: number` Number bits per second of encoded audio file
654
- - `format.sampleRate?: number` Sampling rate in Samples per second (S/s)
655
- - `format.bitsPerSample?: number` Audio bit depth
656
- - `format.lossless?: boolean` True if lossless, false for lossy encoding
657
- - `format.numberOfChannels?: number` Number of audio channels
658
- - `format.creationTime?: Date` Track creation time
659
- - `format.modificationTime?: Date` Track modification / tag update time
660
- - `format.trackGain?: number` Track gain in dB
661
- - `format.albumGain?: number` Album gain in dB
266
+ * `format.container?: string` Audio encoding format. e.g.: 'flac'
267
+ * `format.codec?` Name of the codec (algorithm used for the audio compression)
268
+ * `format.codecProfile?: string` Codec profile / settings
269
+ * `format.tagTypes?: TagType[]` List of tagging formats found in parsed audio file
270
+ * `format.duration?: number` Duration in seconds
271
+ * `format.bitrate?: number` Number bits per second of encoded audio file
272
+ * `format.sampleRate?: number` Sampling rate in Samples per second (S/s)
273
+ * `format.bitsPerSample?: number` Audio bit depth
274
+ * `format.lossless?: boolean` True if lossless, false for lossy encoding
275
+ * `format.numberOfChannels?: number` Number of audio channels
276
+ * `format.creationTime?: Date` Track creation time
277
+ * `format.modificationTime?: Date` Track modification / tag update time
278
+ * `format.trackGain?: number` Track gain in dB
279
+ * `format.albumGain?: number` Album gain in dB
662
280
 
663
281
  #### `metadata.trackInfo`
664
282
 
665
- To support advanced containers like [Matroska](https://wikipedia.org/wiki/Matroska) or [MPEG-4](https://en.wikipedia.org/wiki/MPEG-4), which may contain multiple audio and video tracks, the **experimental**- `metadata.trackInfo` has been added,
666
-
283
+ To support advanced containers like [Matroska](https://wikipedia.org/wiki/Matroska) or [MPEG-4](https://en.wikipedia.org/wiki/MPEG-4), which may contain multiple audio and video tracks, the **experimental** `metadata.trackInfo` has been added,
284
+
667
285
  `metadata.trackInfo` is either `undefined` or has an **array** of [trackInfo](#trackinfo)
668
-
286
+
669
287
  ##### trackInfo
670
-
288
+
671
289
  Audio format information. Defined in the TypeScript `IFormat` interface:
672
- - `trackInfo.type?: TrackType` Track type
673
- - `trackInfo.codecName?: string` Codec name
674
- - `trackInfo.codecSettings?: string` Codec settings
675
- - `trackInfo.flagEnabled?: boolean` Set if the track is usable, default: `true`
676
- - `trackInfo.flagDefault?: boolean` Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference.
677
- - `trackInfo.flagLacing?: boolean` Set if the track **may** contain blocks using lacing
678
- - `trackInfo.name?: string` A human-readable track name.
679
- - `trackInfo.language?: string` Specifies the language of the track
680
- - `trackInfo.audio?: IAudioTrack`, see [`trackInfo.audioTrack`](#trackinfoaudiotrack)
681
- - `trackInfo.video?: IVideoTrack`, see [`trackInfo.videoTrack`](#trackinfovideotrack)
290
+ * `trackInfo.type?: TrackType` Track type
291
+ * `trackInfo.codecName?: string` Codec name
292
+ * `trackInfo.codecSettings?: string` Codec settings
293
+ * `trackInfo.flagEnabled?: boolean` Set if the track is usable, default: `true`
294
+ * `trackInfo.flagDefault?: boolean` Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference.
295
+ * `trackInfo.flagLacing?: boolean` Set if the track **may** contain blocks using lacing
296
+ * `trackInfo.name?: string` A human-readable track name.
297
+ * `trackInfo.language?: string` Specifies the language of the track
298
+ * `trackInfo.audio?: IAudioTrack`, see [`trackInfo.audioTrack`](#trackinfoaudiotrack)
299
+ * `trackInfo.video?: IVideoTrack`, see [`trackInfo.videoTrack`](#trackinfovideotrack)
682
300
 
683
301
  ##### `trackInfo.audioTrack`
684
302
 
685
- - `audioTrack.samplingFrequency?: number`
686
- - `audioTrack.outputSamplingFrequency?: number`
687
- - `audioTrack.channels?: number`
688
- - `audioTrack.channelPositions?: Buffer`
689
- - `audioTrack.bitDepth?: number`
303
+ * `audioTrack.samplingFrequency?: number`
304
+ * `audioTrack.outputSamplingFrequency?: number`
305
+ * `audioTrack.channels?: number`
306
+ * `audioTrack.channelPositions?: Buffer`
307
+ * `audioTrack.bitDepth?: number`
690
308
 
691
309
  ##### `trackInfo.videoTrack`
692
310
 
693
- - `videoTrack.flagInterlaced?: boolean`
694
- - `videoTrack.stereoMode?: number`
695
- - `videoTrack.pixelWidth?: number`
696
- - `videoTrack.pixelHeight?: number`
697
- - `videoTrack.displayWidth?: number`
698
- - `videoTrack.displayHeight?: number`
699
- - `videoTrack.displayUnit?: number`
700
- - `videoTrack.aspectRatioType?: number`
701
- - `videoTrack.colourSpace?: Buffer`
702
- - `videoTrack.gammaValue?: number`
703
-
311
+ * `videoTrack.flagInterlaced?: boolean`
312
+ * `videoTrack.stereoMode?: number`
313
+ * `videoTrack.pixelWidth?: number`
314
+ * `videoTrack.pixelHeight?: number`
315
+ * `videoTrack.displayWidth?: number`
316
+ * `videoTrack.displayHeight?: number`
317
+ * `videoTrack.displayUnit?: number`
318
+ * `videoTrack.aspectRatioType?: number`
319
+ * `videoTrack.colourSpace?: Buffer`
320
+ * `videoTrack.gammaValue?: number`
321
+
704
322
  #### `metadata.common`
705
323
 
706
324
  [Common tag documentation](doc/common_metadata.md) is automatically generated.
@@ -709,15 +327,11 @@ Audio format information. Defined in the TypeScript `IFormat` interface:
709
327
 
710
328
  In order to read the duration of a stream (with the exception of file streams), in some cases you should pass the size of the file in bytes.
711
329
  ```js
712
- import { parseStream } from 'music-metadata';
713
- import { inspect } from 'util';
714
-
715
- (async () => {
716
- const metadata = await parseStream(someReadStream, {mimeType: 'audio/mpeg', size: 26838}, {duration: true});
717
- console.log(inspect(metadata, {showHidden: false, depth: null}));
718
- someReadStream.close();
719
- }
720
- )();
330
+ mm.parseStream(someReadStream, {mimeType: 'audio/mpeg', size: 26838}, {duration: true})
331
+ .then( function (metadata) {
332
+ console.log(util.inspect(metadata, {showHidden: false, depth: null}));
333
+ someReadStream.close();
334
+ });
721
335
  ```
722
336
 
723
337
  ### Access cover art
@@ -751,128 +365,70 @@ export interface IPicture {
751
365
 
752
366
  To assign `img` HTML-object you can do something like:
753
367
  ```js
754
- import {uint8ArrayToBase64} from 'uint8array-extras';
755
-
756
- img.src = `data:${picture.format};base64,${uint8ArrayToBase64(picture.data)}`;
757
- ```
758
-
759
- ## Dependencies
760
-
761
- Dependency diagram:
762
- ```mermaid
763
- graph TD;
764
- MMN("music-metadata (Node.js entry point)")-->MMP
765
- MMN-->FTN
766
- MMP("music-metadata (primary entry point)")-->S(strtok3)
767
- MMP-->TY(token-types)
768
- MMP-->FTP
769
- MMP-->UAE
770
- FTN("file-type (Node.js entry point)")-->FTP
771
- FTP("file-type (primary entry point)")-->S
772
- S(strtok3)-->TO("@tokenizer/token")
773
- TY(token-types)-->TO
774
- TY-->IE("ieee754")
775
- FTP-->TY
776
- NS("node:stream")
777
- FTN-->NS
778
- FTP-->UAE(uint8array-extras)
779
- style NS fill:#F88,stroke:#A44
780
- style IE fill:#CCC,stroke:#888
781
- style FTN fill:#FAA,stroke:#A44
782
- style MMN fill:#FAA,stroke:#A44
783
- ```
784
-
785
- Dependency list:
786
- - [tokenizer-token](https://github.com/Borewit/tokenizer-token)
787
- - [strtok3](https://github.com/Borewit/strtok3)
788
- - [token-types](https://github.com/Borewit/token-types)
789
- - [file-type](https://github.com/sindresorhus/file-type)
790
- - [@tokenizer-token](https://github.com/Borewit/tokenizer-token)
791
-
792
- ## CommonJS backward compatibility
793
-
794
- Using Node.js ≥ 22, which is support loading ESM module via require
795
- ```js
796
- const mm = require('music-metadata');
797
- ```
798
-
799
- For older Node.js version < 22, you need to dynamically import **music-metadata**:
800
- ```js
801
- (async () => {
802
- // Dynamically loads the ESM module in a CommonJS project
803
- const mm = await import('music-metadata');
804
- })();
368
+ img.src = `data:${picture.format};base64,${picture.data.toString('base64')}`;
805
369
  ```
806
370
 
807
- For CommonJS TypeScript projects, I recommend to avoid using `commonjs` for the TypeScript compiler `module` option,
808
- and either use `node16` or `nodenext`, which enable utilizing [dynamic import](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/import).
809
-
810
- If you do want to use the classic `commonjs` option, this is how you can get the _dynamic import_ to work.
811
-
812
- ```js
813
- import {loadEsm} from 'load-esm';
814
-
815
- (async () => {
816
- // Dynamically loads the ESM module in a CommonJS project
817
- const mm = await loadEsm<typeof import('music-metadata')>('music-metadata');
818
- })();
819
- ```
820
-
821
- When you use Node.js version ≥ 22, which supports loading ESM modules via require, this compensates for that issue.
822
-
823
371
  ## Frequently Asked Questions
824
372
 
825
- ### How can I traverse (a long) list of files?
373
+ 1. How can I traverse (a long) list of files?
374
+
375
+ What is important that file parsing should be done in a sequential manner.
376
+ In a plain loop, due to the asynchronous character (like most JavaScript functions), it would cause all the files to run in parallel which is will cause your application to hang in no time.
377
+ There are multiple ways of achieving this:
378
+
379
+ 1. Using recursion
380
+
381
+ ```js
382
+ const mm = require('music-metadata')
383
+
384
+ function parseFiles(audioFiles) {
385
+
386
+ const audioFile = audioFiles.shift();
387
+
388
+ if (audioFile) {
389
+ return mm.parseFile(audioFile).then(metadata => {
390
+ // Do great things with the metadata
391
+ return parseFiles(audioFiles); // process rest of the files AFTER we are finished
392
+ })
393
+ }
394
+
395
+ return Promise.resolve();
396
+ }
397
+
398
+ ```
399
+
400
+ 2. Use async/await
401
+
402
+ Use [async/await](https://javascript.info/async-await)
403
+
404
+ ```js
405
+ const mm = require('music-metadata');
406
+
407
+ // it is required to declare the function 'async' to allow the use of await
408
+ async function parseFiles(audioFiles) {
409
+
410
+ for (const audioFile of audioFiles) {
411
+
412
+ // await will ensure the metadata parsing is completed before we move on to the next file
413
+ const metadata = await mm.parseFile(audioFile);
414
+ // Do great things with the metadata
415
+ }
416
+ }
417
+ ```
418
+
419
+ 3. Use a specialized module to traverse files
420
+
421
+ There are specialized modules to traversing (walking) files and directory,
422
+ like [walk](https://www.npmjs.com/package/walk).
826
423
 
827
- What is important that file parsing should be done in a sequential manner.
828
- In a plain loop, due to the asynchronous character (like most JavaScript functions), it would cause all the files to run in parallel which is will cause your application to hang in no time.
829
- There are multiple ways of achieving this:
830
-
831
- 1. Using recursion
832
-
833
- ```js
834
- import { parseFile } from 'music-metadata';
835
-
836
- function parseFiles(audioFiles) {
837
-
838
- const audioFile = audioFiles.shift();
839
-
840
- if (audioFile) {
841
- return parseFile(audioFile).then(metadata => {
842
- // Do great things with the metadata
843
- return parseFiles(audioFiles); // process rest of the files AFTER we are finished
844
- })
845
- }
846
- }
847
-
848
- ```
849
-
850
- 1. Use async/await
851
-
852
- Use [async/await](https://javascript.info/async-await)
853
-
854
- ```js
855
- import { parseFile } from 'music-metadata';
856
-
857
- // it is required to declare the function 'async' to allow the use of await
858
- async function parseFiles(audioFiles) {
859
-
860
- for (const audioFile of audioFiles) {
861
-
862
- // await will ensure the metadata parsing is completed before we move on to the next file
863
- const metadata = await parseFile(audioFile);
864
- // Do great things with the metadata
865
- }
866
- }
867
- ```
424
+ ## Licence
868
425
 
869
- ### Using music-metadata with TypeScript and module-resolution set to bundler.
426
+ The MIT License (MIT)
870
427
 
871
- If the TypeScript compiler option [`moduleResolution`](https://www.typescriptlang.org/tsconfig/#moduleResolution)
872
- is set to `"bundler"`, it does not set the ECMAScript `"node"` condition, causing the Node specific function fail to import.
428
+ Copyright © 2022 Borewit
873
429
 
874
- This is the case using Next.js. See [issue #2370](https://github.com/Borewit/music-metadata/issues/2370) how to resolve that.
430
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
875
431
 
876
- ## Licence
432
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
877
433
 
878
- This project is licensed under the [MIT License](LICENSE.txt). Feel free to use, modify, and distribute as needed.
434
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.