@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.
- package/node_modules/music-metadata/LICENSE.txt +3 -3
- package/node_modules/music-metadata/README.md +246 -690
- package/node_modules/music-metadata/lib/ParserFactory.d.ts +31 -27
- package/node_modules/music-metadata/lib/ParserFactory.js +219 -108
- package/node_modules/music-metadata/lib/aiff/AiffParser.d.ts +2 -2
- package/node_modules/music-metadata/lib/aiff/AiffParser.js +38 -34
- package/node_modules/music-metadata/lib/aiff/AiffTagMap.d.ts +1 -1
- package/node_modules/music-metadata/lib/aiff/AiffTagMap.js +7 -2
- package/node_modules/music-metadata/lib/aiff/AiffToken.d.ts +6 -32
- package/node_modules/music-metadata/lib/aiff/AiffToken.js +17 -27
- package/node_modules/music-metadata/lib/apev2/APEv2Parser.d.ts +8 -24
- package/node_modules/music-metadata/lib/apev2/APEv2Parser.js +66 -78
- package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.d.ts +1 -1
- package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.js +8 -4
- package/node_modules/music-metadata/lib/apev2/APEv2Token.d.ts +11 -10
- package/node_modules/music-metadata/lib/apev2/APEv2Token.js +27 -16
- package/node_modules/music-metadata/lib/asf/AsfObject.d.ts +53 -59
- package/node_modules/music-metadata/lib/asf/AsfObject.js +131 -97
- package/node_modules/music-metadata/lib/asf/AsfParser.d.ts +1 -1
- package/node_modules/music-metadata/lib/asf/AsfParser.js +43 -42
- package/node_modules/music-metadata/lib/asf/AsfTagMapper.d.ts +2 -2
- package/node_modules/music-metadata/lib/asf/AsfTagMapper.js +10 -6
- package/node_modules/music-metadata/lib/asf/AsfUtil.d.ts +13 -4
- package/node_modules/music-metadata/lib/asf/AsfUtil.js +36 -30
- package/node_modules/music-metadata/lib/asf/GUID.d.ts +84 -0
- package/node_modules/music-metadata/lib/asf/GUID.js +121 -0
- package/node_modules/music-metadata/lib/common/BasicParser.d.ts +9 -9
- package/node_modules/music-metadata/lib/common/BasicParser.js +7 -2
- package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.d.ts +3 -3
- package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.js +7 -2
- package/node_modules/music-metadata/lib/common/CombinedTagMapper.d.ts +5 -5
- package/node_modules/music-metadata/lib/common/CombinedTagMapper.js +28 -24
- package/node_modules/music-metadata/lib/common/FourCC.d.ts +1 -1
- package/node_modules/music-metadata/lib/common/FourCC.js +11 -10
- package/node_modules/music-metadata/lib/common/GenericTagMapper.d.ts +13 -13
- package/node_modules/music-metadata/lib/common/GenericTagMapper.js +12 -7
- package/node_modules/music-metadata/lib/common/GenericTagTypes.d.ts +6 -7
- package/node_modules/music-metadata/lib/common/GenericTagTypes.js +85 -86
- package/node_modules/music-metadata/lib/common/MetadataCollector.d.ts +10 -20
- package/node_modules/music-metadata/lib/common/MetadataCollector.js +69 -100
- package/node_modules/music-metadata/lib/common/RandomFileReader.d.ts +22 -0
- package/node_modules/music-metadata/lib/common/RandomFileReader.js +34 -0
- package/node_modules/music-metadata/lib/common/RandomUint8ArrayReader.d.ts +18 -0
- package/node_modules/music-metadata/lib/common/RandomUint8ArrayReader.js +25 -0
- package/node_modules/music-metadata/lib/common/Util.d.ts +12 -11
- package/node_modules/music-metadata/lib/common/Util.js +53 -47
- package/node_modules/music-metadata/lib/core.d.ts +15 -42
- package/node_modules/music-metadata/lib/core.js +38 -74
- package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.d.ts +1 -16
- package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js +44 -55
- package/node_modules/music-metadata/lib/dsdiff/DsdiffToken.d.ts +3 -3
- package/node_modules/music-metadata/lib/dsdiff/DsdiffToken.js +7 -4
- package/node_modules/music-metadata/lib/dsf/DsfChunk.d.ts +10 -11
- package/node_modules/music-metadata/lib/dsf/DsfChunk.js +19 -15
- package/node_modules/music-metadata/lib/dsf/DsfParser.d.ts +1 -16
- package/node_modules/music-metadata/lib/dsf/DsfParser.js +20 -21
- package/node_modules/music-metadata/lib/flac/FlacParser.d.ts +15 -16
- package/node_modules/music-metadata/lib/flac/FlacParser.js +119 -69
- package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.d.ts +3 -7
- package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +36 -39
- package/node_modules/music-metadata/lib/id3v1/ID3v1TagMap.d.ts +1 -1
- package/node_modules/music-metadata/lib/id3v1/ID3v1TagMap.js +7 -2
- package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.d.ts +2 -2
- package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js +19 -15
- package/node_modules/music-metadata/lib/id3v2/FrameParser.d.ts +3 -64
- package/node_modules/music-metadata/lib/id3v2/FrameParser.js +103 -244
- package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.d.ts +2 -2
- package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js +16 -6
- package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.d.ts +5 -5
- package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js +35 -36
- package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.d.ts +6 -11
- package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.js +104 -91
- package/node_modules/music-metadata/lib/id3v2/ID3v2Token.d.ts +29 -67
- package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +36 -76
- package/node_modules/music-metadata/lib/iff/index.d.ts +1 -1
- package/node_modules/music-metadata/lib/iff/index.js +7 -4
- package/node_modules/music-metadata/lib/index.d.ts +31 -8
- package/node_modules/music-metadata/lib/index.js +53 -32
- package/node_modules/music-metadata/lib/lyrics3/Lyrics3.d.ts +2 -2
- package/node_modules/music-metadata/lib/lyrics3/Lyrics3.js +13 -13
- package/node_modules/music-metadata/lib/matroska/MatroskaDtd.d.ts +2 -2
- package/node_modules/music-metadata/lib/matroska/MatroskaDtd.js +242 -246
- package/node_modules/music-metadata/lib/matroska/MatroskaParser.d.ts +24 -6
- package/node_modules/music-metadata/lib/matroska/MatroskaParser.js +218 -124
- package/node_modules/music-metadata/lib/matroska/MatroskaTagMapper.d.ts +1 -1
- package/node_modules/music-metadata/lib/matroska/MatroskaTagMapper.js +7 -3
- package/node_modules/music-metadata/lib/matroska/types.d.ts +76 -43
- package/node_modules/music-metadata/lib/matroska/types.js +33 -27
- package/node_modules/music-metadata/lib/mp4/Atom.d.ts +7 -7
- package/node_modules/music-metadata/lib/mp4/Atom.js +22 -15
- package/node_modules/music-metadata/lib/mp4/AtomToken.d.ts +18 -110
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +66 -184
- package/node_modules/music-metadata/lib/mp4/MP4Parser.d.ts +4 -6
- package/node_modules/music-metadata/lib/mp4/MP4Parser.js +128 -255
- package/node_modules/music-metadata/lib/mp4/MP4TagMapper.d.ts +4 -4
- package/node_modules/music-metadata/lib/mp4/MP4TagMapper.js +12 -8
- package/node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.d.ts +5 -5
- package/node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.js +10 -7
- package/node_modules/music-metadata/lib/mpeg/MpegParser.d.ts +4 -17
- package/node_modules/music-metadata/lib/mpeg/MpegParser.js +131 -176
- package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.d.ts +14 -16
- package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.js +19 -14
- package/node_modules/music-metadata/lib/mpeg/XingTag.d.ts +7 -6
- package/node_modules/music-metadata/lib/mpeg/XingTag.js +18 -14
- package/node_modules/music-metadata/lib/musepack/index.d.ts +5 -0
- package/node_modules/music-metadata/lib/musepack/index.js +32 -0
- package/node_modules/music-metadata/lib/musepack/sv7/BitReader.d.ts +2 -2
- package/node_modules/music-metadata/lib/musepack/sv7/BitReader.js +24 -16
- package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.d.ts +1 -1
- package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.js +15 -16
- package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.d.ts +1 -1
- package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.js +7 -5
- package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.d.ts +1 -1
- package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.js +17 -18
- package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.d.ts +3 -5
- package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js +12 -14
- package/node_modules/music-metadata/lib/ogg/{OggToken.d.ts → Ogg.d.ts} +6 -17
- package/node_modules/music-metadata/lib/ogg/Ogg.js +2 -0
- package/node_modules/music-metadata/lib/ogg/OggParser.d.ts +12 -16
- package/node_modules/music-metadata/lib/ogg/OggParser.js +102 -101
- package/node_modules/music-metadata/lib/ogg/opus/Opus.d.ts +2 -17
- package/node_modules/music-metadata/lib/ogg/opus/Opus.js +14 -13
- package/node_modules/music-metadata/lib/ogg/opus/OpusParser.d.ts +25 -0
- package/node_modules/music-metadata/lib/ogg/opus/{OpusStream.js → OpusParser.js} +18 -18
- package/node_modules/music-metadata/lib/ogg/speex/Speex.d.ts +1 -1
- package/node_modules/music-metadata/lib/ogg/speex/Speex.js +19 -16
- package/node_modules/music-metadata/lib/ogg/speex/SpeexParser.d.ts +22 -0
- package/node_modules/music-metadata/lib/ogg/speex/{SpeexStream.js → SpeexParser.js} +13 -9
- package/node_modules/music-metadata/lib/ogg/theora/Theora.d.ts +1 -1
- package/node_modules/music-metadata/lib/ogg/theora/Theora.js +11 -8
- package/node_modules/music-metadata/lib/ogg/theora/TheoraParser.d.ts +28 -0
- package/node_modules/music-metadata/lib/ogg/theora/TheoraParser.js +44 -0
- package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.d.ts +7 -6
- package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.js +29 -34
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.d.ts +1 -1
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js +9 -6
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.d.ts +36 -0
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.js +128 -0
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.d.ts +3 -3
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js +9 -5
- package/node_modules/music-metadata/lib/riff/RiffChunk.d.ts +5 -5
- package/node_modules/music-metadata/lib/riff/RiffChunk.js +9 -5
- package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.d.ts +2 -2
- package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.js +25 -20
- package/node_modules/music-metadata/lib/type.d.ts +52 -121
- package/node_modules/music-metadata/lib/type.js +6 -2
- package/node_modules/music-metadata/lib/wav/BwfChunk.d.ts +1 -1
- package/node_modules/music-metadata/lib/wav/BwfChunk.js +11 -8
- package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +20 -50
- package/node_modules/music-metadata/lib/wav/WaveChunk.js +32 -45
- package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +2 -2
- package/node_modules/music-metadata/lib/wav/WaveParser.js +39 -46
- package/node_modules/music-metadata/lib/wavpack/WavPackParser.d.ts +2 -18
- package/node_modules/music-metadata/lib/wavpack/WavPackParser.js +32 -42
- package/node_modules/music-metadata/lib/wavpack/WavPackToken.d.ts +18 -14
- package/node_modules/music-metadata/lib/wavpack/WavPackToken.js +30 -24
- package/node_modules/music-metadata/package.json +74 -81
- package/package.json +1 -5
- package/node_modules/@borewit/text-codec/LICENSE.txt +0 -9
- package/node_modules/@borewit/text-codec/README.md +0 -87
- package/node_modules/@borewit/text-codec/lib/index.d.ts +0 -6
- package/node_modules/@borewit/text-codec/lib/index.js +0 -380
- package/node_modules/@borewit/text-codec/package.json +0 -70
- package/node_modules/music-metadata/lib/ParseError.d.ts +0 -87
- package/node_modules/music-metadata/lib/ParseError.js +0 -38
- package/node_modules/music-metadata/lib/aiff/AiffLoader.d.ts +0 -2
- package/node_modules/music-metadata/lib/aiff/AiffLoader.js +0 -8
- package/node_modules/music-metadata/lib/apev2/Apev2Loader.d.ts +0 -2
- package/node_modules/music-metadata/lib/apev2/Apev2Loader.js +0 -8
- package/node_modules/music-metadata/lib/asf/AsfGuid.d.ts +0 -83
- package/node_modules/music-metadata/lib/asf/AsfGuid.js +0 -109
- package/node_modules/music-metadata/lib/asf/AsfLoader.d.ts +0 -2
- package/node_modules/music-metadata/lib/asf/AsfLoader.js +0 -8
- package/node_modules/music-metadata/lib/dsdiff/DsdiffLoader.d.ts +0 -2
- package/node_modules/music-metadata/lib/dsdiff/DsdiffLoader.js +0 -8
- package/node_modules/music-metadata/lib/dsf/DsfLoader.d.ts +0 -2
- package/node_modules/music-metadata/lib/dsf/DsfLoader.js +0 -8
- package/node_modules/music-metadata/lib/ebml/EbmlIterator.d.ts +0 -67
- package/node_modules/music-metadata/lib/ebml/EbmlIterator.js +0 -218
- package/node_modules/music-metadata/lib/ebml/types.d.ts +0 -37
- package/node_modules/music-metadata/lib/ebml/types.js +0 -8
- package/node_modules/music-metadata/lib/flac/FlacLoader.d.ts +0 -2
- package/node_modules/music-metadata/lib/flac/FlacLoader.js +0 -8
- package/node_modules/music-metadata/lib/flac/FlacToken.d.ts +0 -45
- package/node_modules/music-metadata/lib/flac/FlacToken.js +0 -63
- package/node_modules/music-metadata/lib/id3v2/FrameHeader.d.ts +0 -31
- package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +0 -73
- package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.d.ts +0 -11
- package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.js +0 -17
- package/node_modules/music-metadata/lib/lrc/LyricsParser.d.ts +0 -9
- package/node_modules/music-metadata/lib/lrc/LyricsParser.js +0 -45
- package/node_modules/music-metadata/lib/matroska/MatroskaLoader.d.ts +0 -2
- package/node_modules/music-metadata/lib/matroska/MatroskaLoader.js +0 -8
- package/node_modules/music-metadata/lib/mp4/Mp4Loader.d.ts +0 -2
- package/node_modules/music-metadata/lib/mp4/Mp4Loader.js +0 -8
- package/node_modules/music-metadata/lib/mpeg/MpegLoader.d.ts +0 -2
- package/node_modules/music-metadata/lib/mpeg/MpegLoader.js +0 -8
- package/node_modules/music-metadata/lib/musepack/MusepackConentError.d.ts +0 -15
- package/node_modules/music-metadata/lib/musepack/MusepackConentError.js +0 -3
- package/node_modules/music-metadata/lib/musepack/MusepackLoader.d.ts +0 -2
- package/node_modules/music-metadata/lib/musepack/MusepackLoader.js +0 -8
- package/node_modules/music-metadata/lib/musepack/MusepackParser.d.ts +0 -4
- package/node_modules/music-metadata/lib/musepack/MusepackParser.js +0 -30
- package/node_modules/music-metadata/lib/ogg/OggLoader.d.ts +0 -2
- package/node_modules/music-metadata/lib/ogg/OggLoader.js +0 -8
- package/node_modules/music-metadata/lib/ogg/OggToken.js +0 -41
- package/node_modules/music-metadata/lib/ogg/flac/FlacStream.d.ts +0 -29
- package/node_modules/music-metadata/lib/ogg/flac/FlacStream.js +0 -74
- package/node_modules/music-metadata/lib/ogg/opus/OpusStream.d.ts +0 -24
- package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.d.ts +0 -20
- package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.d.ts +0 -25
- package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.js +0 -39
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.d.ts +0 -53
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.js +0 -136
- package/node_modules/music-metadata/lib/wav/WaveLoader.d.ts +0 -2
- package/node_modules/music-metadata/lib/wav/WaveLoader.js +0 -8
- package/node_modules/music-metadata/lib/wavpack/WavPackLoader.d.ts +0 -2
- package/node_modules/music-metadata/lib/wavpack/WavPackLoader.js +0 -8
- package/node_modules/music-metadata/node_modules/file-type/core.d.ts +0 -253
- package/node_modules/music-metadata/node_modules/file-type/core.js +0 -2899
- package/node_modules/music-metadata/node_modules/file-type/index.d.ts +0 -98
- package/node_modules/music-metadata/node_modules/file-type/index.js +0 -163
- package/node_modules/music-metadata/node_modules/file-type/license +0 -9
- package/node_modules/music-metadata/node_modules/file-type/package.json +0 -290
- package/node_modules/music-metadata/node_modules/file-type/readme.md +0 -667
- package/node_modules/music-metadata/node_modules/file-type/supported.js +0 -360
- package/node_modules/music-metadata/node_modules/file-type/util.js +0 -60
- package/node_modules/music-metadata/node_modules/strtok3/LICENSE.txt +0 -21
- package/node_modules/music-metadata/node_modules/strtok3/README.md +0 -399
- package/node_modules/music-metadata/node_modules/strtok3/lib/AbstractTokenizer.d.ts +0 -76
- package/node_modules/music-metadata/node_modules/strtok3/lib/AbstractTokenizer.js +0 -111
- package/node_modules/music-metadata/node_modules/strtok3/lib/BlobTokenizer.d.ts +0 -29
- package/node_modules/music-metadata/node_modules/strtok3/lib/BlobTokenizer.js +0 -53
- package/node_modules/music-metadata/node_modules/strtok3/lib/BufferTokenizer.d.ts +0 -29
- package/node_modules/music-metadata/node_modules/strtok3/lib/BufferTokenizer.js +0 -52
- package/node_modules/music-metadata/node_modules/strtok3/lib/FileTokenizer.d.ts +0 -37
- package/node_modules/music-metadata/node_modules/strtok3/lib/FileTokenizer.js +0 -61
- package/node_modules/music-metadata/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +0 -34
- package/node_modules/music-metadata/node_modules/strtok3/lib/ReadStreamTokenizer.js +0 -107
- package/node_modules/music-metadata/node_modules/strtok3/lib/core.d.ts +0 -40
- package/node_modules/music-metadata/node_modules/strtok3/lib/core.js +0 -62
- package/node_modules/music-metadata/node_modules/strtok3/lib/index.d.ts +0 -16
- package/node_modules/music-metadata/node_modules/strtok3/lib/index.js +0 -22
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +0 -54
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/AbstractStreamReader.js +0 -71
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Deferred.d.ts +0 -6
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Deferred.js +0 -10
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Errors.d.ts +0 -10
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Errors.js +0 -16
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/StreamReader.d.ts +0 -29
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/StreamReader.js +0 -83
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +0 -14
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamByobReader.js +0 -27
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +0 -19
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +0 -62
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +0 -14
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReader.js +0 -13
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +0 -5
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +0 -19
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/index.d.ts +0 -6
- package/node_modules/music-metadata/node_modules/strtok3/lib/stream/index.js +0 -5
- package/node_modules/music-metadata/node_modules/strtok3/lib/types.d.ts +0 -139
- package/node_modules/music-metadata/node_modules/strtok3/lib/types.js +0 -1
- package/node_modules/music-metadata/node_modules/strtok3/package.json +0 -94
- package/node_modules/music-metadata/node_modules/token-types/LICENSE.txt +0 -9
- package/node_modules/music-metadata/node_modules/token-types/README.md +0 -120
- package/node_modules/music-metadata/node_modules/token-types/lib/index.d.ts +0 -135
- package/node_modules/music-metadata/node_modules/token-types/lib/index.js +0 -401
- package/node_modules/music-metadata/node_modules/token-types/package.json +0 -81
- package/node_modules/sprintf-js/.npmignore +0 -1
- package/node_modules/sprintf-js/LICENSE +0 -24
- package/node_modules/sprintf-js/README.md +0 -88
- package/node_modules/sprintf-js/bower.json +0 -14
- package/node_modules/sprintf-js/demo/angular.html +0 -20
- package/node_modules/sprintf-js/dist/angular-sprintf.min.js +0 -4
- package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +0 -1
- package/node_modules/sprintf-js/dist/angular-sprintf.min.map +0 -1
- package/node_modules/sprintf-js/dist/sprintf.min.js +0 -4
- package/node_modules/sprintf-js/dist/sprintf.min.js.map +0 -1
- package/node_modules/sprintf-js/dist/sprintf.min.map +0 -1
- package/node_modules/sprintf-js/gruntfile.js +0 -36
- package/node_modules/sprintf-js/package.json +0 -22
- package/node_modules/sprintf-js/src/angular-sprintf.js +0 -18
- package/node_modules/sprintf-js/src/sprintf.js +0 -208
- package/node_modules/sprintf-js/test/test.js +0 -82
- package/node_modules/uint8array-extras/index.d.ts +0 -331
- package/node_modules/uint8array-extras/index.js +0 -318
- package/node_modules/uint8array-extras/license +0 -9
- package/node_modules/uint8array-extras/package.json +0 -54
- package/node_modules/uint8array-extras/readme.md +0 -318
- package/node_modules/win-guid/LICENSE.txt +0 -9
- package/node_modules/win-guid/README.md +0 -113
- package/node_modules/win-guid/lib/guid.d.ts +0 -20
- package/node_modules/win-guid/lib/guid.js +0 -107
- package/node_modules/win-guid/package.json +0 -55
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/LICENSE +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/README.md +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/index.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/append/constant.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/append.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/count.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/help.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store/constant.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store/false.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store/true.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/subparsers.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/version.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action_container.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argparse.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument/error.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument/exclusive.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument/group.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument_parser.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/const.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/help/added_formatters.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/help/formatter.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/namespace.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/utils.js +0 -0
- /package/node_modules/{argparse → mammoth/node_modules/argparse}/package.json +0 -0
|
@@ -1,43 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DsfParser = void 0;
|
|
4
|
+
const debug_1 = require("debug");
|
|
5
|
+
const AbstractID3Parser_1 = require("../id3v2/AbstractID3Parser");
|
|
6
|
+
const DsfChunk_1 = require("./DsfChunk");
|
|
7
|
+
const ID3v2Parser_1 = require("../id3v2/ID3v2Parser");
|
|
8
|
+
const debug = (0, debug_1.default)('music-metadata:parser:DSF');
|
|
9
9
|
/**
|
|
10
10
|
* DSF (dsd stream file) File Parser
|
|
11
11
|
* Ref: https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
class DsfParser extends AbstractID3Parser_1.AbstractID3Parser {
|
|
14
14
|
async postId3v2Parse() {
|
|
15
15
|
const p0 = this.tokenizer.position; // mark start position, normally 0
|
|
16
|
-
const chunkHeader = await this.tokenizer.readToken(ChunkHeader);
|
|
16
|
+
const chunkHeader = await this.tokenizer.readToken(DsfChunk_1.ChunkHeader);
|
|
17
17
|
if (chunkHeader.id !== 'DSD ')
|
|
18
|
-
throw new
|
|
18
|
+
throw new Error('Invalid chunk signature');
|
|
19
19
|
this.metadata.setFormat('container', 'DSF');
|
|
20
20
|
this.metadata.setFormat('lossless', true);
|
|
21
|
-
this.
|
|
22
|
-
const dsdChunk = await this.tokenizer.readToken(DsdChunk);
|
|
21
|
+
const dsdChunk = await this.tokenizer.readToken(DsfChunk_1.DsdChunk);
|
|
23
22
|
if (dsdChunk.metadataPointer === BigInt(0)) {
|
|
24
|
-
debug(
|
|
23
|
+
debug(`No ID3v2 tag present`);
|
|
25
24
|
}
|
|
26
25
|
else {
|
|
27
26
|
debug(`expect ID3v2 at offset=${dsdChunk.metadataPointer}`);
|
|
28
27
|
await this.parseChunks(dsdChunk.fileSize - chunkHeader.size);
|
|
29
28
|
// Jump to ID3 header
|
|
30
29
|
await this.tokenizer.ignore(Number(dsdChunk.metadataPointer) - this.tokenizer.position - p0);
|
|
31
|
-
return new ID3v2Parser().parse(this.metadata, this.tokenizer, this.options);
|
|
30
|
+
return new ID3v2Parser_1.ID3v2Parser().parse(this.metadata, this.tokenizer, this.options);
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
async parseChunks(bytesRemaining) {
|
|
35
|
-
while (bytesRemaining >= ChunkHeader.len) {
|
|
36
|
-
const chunkHeader = await this.tokenizer.readToken(ChunkHeader);
|
|
34
|
+
while (bytesRemaining >= DsfChunk_1.ChunkHeader.len) {
|
|
35
|
+
const chunkHeader = await this.tokenizer.readToken(DsfChunk_1.ChunkHeader);
|
|
37
36
|
debug(`Parsing chunk name=${chunkHeader.id} size=${chunkHeader.size}`);
|
|
38
37
|
switch (chunkHeader.id) {
|
|
39
|
-
case 'fmt ':
|
|
40
|
-
const formatChunk = await this.tokenizer.readToken(FormatChunk);
|
|
38
|
+
case 'fmt ':
|
|
39
|
+
const formatChunk = await this.tokenizer.readToken(DsfChunk_1.FormatChunk);
|
|
41
40
|
this.metadata.setFormat('numberOfChannels', formatChunk.channelNum);
|
|
42
41
|
this.metadata.setFormat('sampleRate', formatChunk.samplingFrequency);
|
|
43
42
|
this.metadata.setFormat('bitsPerSample', formatChunk.bitsPerSample);
|
|
@@ -46,12 +45,12 @@ export class DsfParser extends AbstractID3Parser {
|
|
|
46
45
|
const bitrate = formatChunk.bitsPerSample * formatChunk.samplingFrequency * formatChunk.channelNum;
|
|
47
46
|
this.metadata.setFormat('bitrate', bitrate);
|
|
48
47
|
return; // We got what we want, stop further processing of chunks
|
|
49
|
-
}
|
|
50
48
|
default:
|
|
51
|
-
this.tokenizer.ignore(Number(chunkHeader.size) - ChunkHeader.len);
|
|
49
|
+
this.tokenizer.ignore(Number(chunkHeader.size) - DsfChunk_1.ChunkHeader.len);
|
|
52
50
|
break;
|
|
53
51
|
}
|
|
54
52
|
bytesRemaining -= chunkHeader.size;
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
55
|
}
|
|
56
|
+
exports.DsfParser = DsfParser;
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AbstractID3Parser } from '../id3v2/AbstractID3Parser
|
|
3
|
-
import
|
|
1
|
+
import { ITokenizer } from 'strtok3/lib/core';
|
|
2
|
+
import { AbstractID3Parser } from '../id3v2/AbstractID3Parser';
|
|
3
|
+
import { INativeMetadataCollector } from '../common/MetadataCollector';
|
|
4
|
+
import { IOptions } from '../type';
|
|
5
|
+
import { ITokenParser } from '../ParserFactory';
|
|
4
6
|
export declare class FlacParser extends AbstractID3Parser {
|
|
5
7
|
private vorbisParser;
|
|
6
|
-
|
|
7
|
-
private parseDataBlock;
|
|
8
|
+
private padding;
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
+
* Initialize parser with output (metadata), input (tokenizer) & parsing options (options).
|
|
11
|
+
* @param {INativeMetadataCollector} metadata Output
|
|
12
|
+
* @param {ITokenizer} tokenizer Input
|
|
13
|
+
* @param {IOptions} options Parsing options
|
|
10
14
|
*/
|
|
11
|
-
|
|
15
|
+
init(metadata: INativeMetadataCollector, tokenizer: ITokenizer, options: IOptions): ITokenParser;
|
|
16
|
+
postId3v2Parse(): Promise<void>;
|
|
17
|
+
private parseDataBlock;
|
|
12
18
|
/**
|
|
13
19
|
* Parse STREAMINFO
|
|
14
20
|
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Read VORBIS_COMMENT from tokenizer
|
|
18
|
-
* Ref: https://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-640004.2.3
|
|
19
|
-
*/
|
|
20
|
-
private readComment;
|
|
21
|
+
private parseBlockStreamInfo;
|
|
21
22
|
/**
|
|
22
23
|
* Parse VORBIS_COMMENT
|
|
23
24
|
* Ref: https://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-640004.2.3
|
|
24
25
|
*/
|
|
25
|
-
parseComment
|
|
26
|
+
private parseComment;
|
|
26
27
|
private parsePicture;
|
|
27
|
-
addPictureTag(picture: IVorbisPicture): Promise<void>;
|
|
28
|
-
private addTag;
|
|
29
28
|
}
|
|
@@ -1,29 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlacParser = void 0;
|
|
4
|
+
const token_types_1 = require("token-types");
|
|
5
|
+
const debug_1 = require("debug");
|
|
6
|
+
const util = require("../common/Util");
|
|
7
|
+
const Vorbis_1 = require("../ogg/vorbis/Vorbis");
|
|
8
|
+
const AbstractID3Parser_1 = require("../id3v2/AbstractID3Parser");
|
|
9
|
+
const FourCC_1 = require("../common/FourCC");
|
|
10
|
+
const VorbisParser_1 = require("../ogg/vorbis/VorbisParser");
|
|
11
|
+
const VorbisDecoder_1 = require("../ogg/vorbis/VorbisDecoder");
|
|
12
|
+
const debug = (0, debug_1.default)('music-metadata:parser:FLAC');
|
|
13
|
+
/**
|
|
14
|
+
* FLAC supports up to 128 kinds of metadata blocks; currently the following are defined:
|
|
15
|
+
* ref: https://xiph.org/flac/format.html#metadata_block
|
|
16
|
+
*/
|
|
17
|
+
var BlockType;
|
|
18
|
+
(function (BlockType) {
|
|
19
|
+
BlockType[BlockType["STREAMINFO"] = 0] = "STREAMINFO";
|
|
20
|
+
BlockType[BlockType["PADDING"] = 1] = "PADDING";
|
|
21
|
+
BlockType[BlockType["APPLICATION"] = 2] = "APPLICATION";
|
|
22
|
+
BlockType[BlockType["SEEKTABLE"] = 3] = "SEEKTABLE";
|
|
23
|
+
BlockType[BlockType["VORBIS_COMMENT"] = 4] = "VORBIS_COMMENT";
|
|
24
|
+
BlockType[BlockType["CUESHEET"] = 5] = "CUESHEET";
|
|
25
|
+
BlockType[BlockType["PICTURE"] = 6] = "PICTURE";
|
|
26
|
+
})(BlockType || (BlockType = {}));
|
|
27
|
+
class FlacParser extends AbstractID3Parser_1.AbstractID3Parser {
|
|
14
28
|
constructor() {
|
|
15
29
|
super(...arguments);
|
|
16
|
-
this.
|
|
30
|
+
this.padding = 0;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Initialize parser with output (metadata), input (tokenizer) & parsing options (options).
|
|
34
|
+
* @param {INativeMetadataCollector} metadata Output
|
|
35
|
+
* @param {ITokenizer} tokenizer Input
|
|
36
|
+
* @param {IOptions} options Parsing options
|
|
37
|
+
*/
|
|
38
|
+
init(metadata, tokenizer, options) {
|
|
39
|
+
super.init(metadata, tokenizer, options);
|
|
40
|
+
this.vorbisParser = new VorbisParser_1.VorbisParser(metadata, options);
|
|
41
|
+
return this;
|
|
17
42
|
}
|
|
18
43
|
async postId3v2Parse() {
|
|
19
|
-
const fourCC = await this.tokenizer.readToken(FourCcToken);
|
|
44
|
+
const fourCC = await this.tokenizer.readToken(FourCC_1.FourCcToken);
|
|
20
45
|
if (fourCC.toString() !== 'fLaC') {
|
|
21
|
-
throw new
|
|
46
|
+
throw new Error('Invalid FLAC preamble');
|
|
22
47
|
}
|
|
23
48
|
let blockHeader;
|
|
24
49
|
do {
|
|
25
50
|
// Read block header
|
|
26
|
-
blockHeader = await this.tokenizer.readToken(
|
|
51
|
+
blockHeader = await this.tokenizer.readToken(Metadata.BlockHeader);
|
|
27
52
|
// Parse block data
|
|
28
53
|
await this.parseDataBlock(blockHeader);
|
|
29
54
|
} while (!blockHeader.lastBlock);
|
|
@@ -32,26 +57,26 @@ export class FlacParser extends AbstractID3Parser {
|
|
|
32
57
|
this.metadata.setFormat('bitrate', 8 * dataSize / this.metadata.format.duration);
|
|
33
58
|
}
|
|
34
59
|
}
|
|
35
|
-
|
|
60
|
+
parseDataBlock(blockHeader) {
|
|
36
61
|
debug(`blockHeader type=${blockHeader.type}, length=${blockHeader.length}`);
|
|
37
62
|
switch (blockHeader.type) {
|
|
38
|
-
case
|
|
39
|
-
return this.
|
|
40
|
-
case
|
|
63
|
+
case BlockType.STREAMINFO:
|
|
64
|
+
return this.parseBlockStreamInfo(blockHeader.length);
|
|
65
|
+
case BlockType.PADDING:
|
|
66
|
+
this.padding += blockHeader.length;
|
|
41
67
|
break;
|
|
42
|
-
case
|
|
68
|
+
case BlockType.APPLICATION:
|
|
43
69
|
break;
|
|
44
|
-
case
|
|
70
|
+
case BlockType.SEEKTABLE:
|
|
45
71
|
break;
|
|
46
|
-
case
|
|
47
|
-
return this.
|
|
48
|
-
case
|
|
72
|
+
case BlockType.VORBIS_COMMENT:
|
|
73
|
+
return this.parseComment(blockHeader.length);
|
|
74
|
+
case BlockType.CUESHEET:
|
|
49
75
|
break;
|
|
50
|
-
case
|
|
51
|
-
|
|
52
|
-
return;
|
|
76
|
+
case BlockType.PICTURE:
|
|
77
|
+
return this.parsePicture(blockHeader.length).then();
|
|
53
78
|
default:
|
|
54
|
-
this.metadata.addWarning(
|
|
79
|
+
this.metadata.addWarning('Unknown block type: ' + blockHeader.type);
|
|
55
80
|
}
|
|
56
81
|
// Ignore data block
|
|
57
82
|
return this.tokenizer.ignore(blockHeader.length).then();
|
|
@@ -59,19 +84,12 @@ export class FlacParser extends AbstractID3Parser {
|
|
|
59
84
|
/**
|
|
60
85
|
* Parse STREAMINFO
|
|
61
86
|
*/
|
|
62
|
-
async
|
|
63
|
-
if (dataLen !==
|
|
64
|
-
throw new
|
|
65
|
-
const streamInfo = await this.tokenizer.readToken(
|
|
87
|
+
async parseBlockStreamInfo(dataLen) {
|
|
88
|
+
if (dataLen !== Metadata.BlockStreamInfo.len)
|
|
89
|
+
throw new Error('Unexpected block-stream-info length');
|
|
90
|
+
const streamInfo = await this.tokenizer.readToken(Metadata.BlockStreamInfo);
|
|
66
91
|
this.metadata.setFormat('container', 'FLAC');
|
|
67
|
-
this.processsStreamInfo(streamInfo);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Parse STREAMINFO
|
|
71
|
-
*/
|
|
72
|
-
processsStreamInfo(streamInfo) {
|
|
73
92
|
this.metadata.setFormat('codec', 'FLAC');
|
|
74
|
-
this.metadata.setFormat('hasAudio', true);
|
|
75
93
|
this.metadata.setFormat('lossless', true);
|
|
76
94
|
this.metadata.setFormat('numberOfChannels', streamInfo.channels);
|
|
77
95
|
this.metadata.setFormat('bitsPerSample', streamInfo.bitsPerSample);
|
|
@@ -80,46 +98,78 @@ export class FlacParser extends AbstractID3Parser {
|
|
|
80
98
|
this.metadata.setFormat('duration', streamInfo.totalSamples / streamInfo.sampleRate);
|
|
81
99
|
}
|
|
82
100
|
}
|
|
83
|
-
/**
|
|
84
|
-
* Read VORBIS_COMMENT from tokenizer
|
|
85
|
-
* Ref: https://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-640004.2.3
|
|
86
|
-
*/
|
|
87
|
-
async readComment(dataLen) {
|
|
88
|
-
const data = await this.tokenizer.readToken(new Uint8ArrayType(dataLen));
|
|
89
|
-
return this.parseComment(data);
|
|
90
|
-
}
|
|
91
101
|
/**
|
|
92
102
|
* Parse VORBIS_COMMENT
|
|
93
103
|
* Ref: https://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-640004.2.3
|
|
94
104
|
*/
|
|
95
|
-
async parseComment(
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
this.metadata.setFormat('tool', vendor);
|
|
100
|
-
}
|
|
105
|
+
async parseComment(dataLen) {
|
|
106
|
+
const data = await this.tokenizer.readToken(new token_types_1.Uint8ArrayType(dataLen));
|
|
107
|
+
const decoder = new VorbisDecoder_1.VorbisDecoder(data, 0);
|
|
108
|
+
decoder.readStringUtf8(); // vendor (skip)
|
|
101
109
|
const commentListLength = decoder.readInt32();
|
|
102
|
-
const tags = new Array(commentListLength);
|
|
103
110
|
for (let i = 0; i < commentListLength; i++) {
|
|
104
|
-
|
|
111
|
+
const tag = decoder.parseUserComment();
|
|
112
|
+
this.vorbisParser.addTag(tag.key, tag.value);
|
|
105
113
|
}
|
|
106
|
-
await Promise.all(tags.map(tag => {
|
|
107
|
-
if (tag.key === 'ENCODER') {
|
|
108
|
-
this.metadata.setFormat('tool', tag.value);
|
|
109
|
-
}
|
|
110
|
-
return this.addTag(tag.key, tag.value);
|
|
111
|
-
}));
|
|
112
114
|
}
|
|
113
115
|
async parsePicture(dataLen) {
|
|
114
116
|
if (this.options.skipCovers) {
|
|
115
117
|
return this.tokenizer.ignore(dataLen);
|
|
116
118
|
}
|
|
117
|
-
|
|
119
|
+
else {
|
|
120
|
+
const picture = await this.tokenizer.readToken(new Vorbis_1.VorbisPictureToken(dataLen));
|
|
121
|
+
this.vorbisParser.addTag('METADATA_BLOCK_PICTURE', picture);
|
|
122
|
+
}
|
|
118
123
|
}
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
}
|
|
125
|
+
exports.FlacParser = FlacParser;
|
|
126
|
+
class Metadata {
|
|
127
|
+
}
|
|
128
|
+
Metadata.BlockHeader = {
|
|
129
|
+
len: 4,
|
|
130
|
+
get: (buf, off) => {
|
|
131
|
+
return {
|
|
132
|
+
lastBlock: util.getBit(buf, off, 7),
|
|
133
|
+
type: util.getBitAllignedNumber(buf, off, 1, 7),
|
|
134
|
+
length: token_types_1.UINT24_BE.get(buf, off + 1)
|
|
135
|
+
};
|
|
121
136
|
}
|
|
122
|
-
|
|
123
|
-
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* METADATA_BLOCK_DATA
|
|
140
|
+
* Ref: https://xiph.org/flac/format.html#metadata_block_streaminfo
|
|
141
|
+
*/
|
|
142
|
+
Metadata.BlockStreamInfo = {
|
|
143
|
+
len: 34,
|
|
144
|
+
get: (buf, off) => {
|
|
145
|
+
return {
|
|
146
|
+
// The minimum block size (in samples) used in the stream.
|
|
147
|
+
minimumBlockSize: token_types_1.UINT16_BE.get(buf, off),
|
|
148
|
+
// The maximum block size (in samples) used in the stream.
|
|
149
|
+
// (Minimum blocksize == maximum blocksize) implies a fixed-blocksize stream.
|
|
150
|
+
maximumBlockSize: token_types_1.UINT16_BE.get(buf, off + 2) / 1000,
|
|
151
|
+
// The minimum frame size (in bytes) used in the stream.
|
|
152
|
+
// May be 0 to imply the value is not known.
|
|
153
|
+
minimumFrameSize: token_types_1.UINT24_BE.get(buf, off + 4),
|
|
154
|
+
// The maximum frame size (in bytes) used in the stream.
|
|
155
|
+
// May be 0 to imply the value is not known.
|
|
156
|
+
maximumFrameSize: token_types_1.UINT24_BE.get(buf, off + 7),
|
|
157
|
+
// Sample rate in Hz. Though 20 bits are available,
|
|
158
|
+
// the maximum sample rate is limited by the structure of frame headers to 655350Hz.
|
|
159
|
+
// Also, a value of 0 is invalid.
|
|
160
|
+
sampleRate: token_types_1.UINT24_BE.get(buf, off + 10) >> 4,
|
|
161
|
+
// probably slower: sampleRate: common.getBitAllignedNumber(buf, off + 10, 0, 20),
|
|
162
|
+
// (number of channels)-1. FLAC supports from 1 to 8 channels
|
|
163
|
+
channels: util.getBitAllignedNumber(buf, off + 12, 4, 3) + 1,
|
|
164
|
+
// bits per sample)-1.
|
|
165
|
+
// FLAC supports from 4 to 32 bits per sample. Currently the reference encoder and decoders only support up to 24 bits per sample.
|
|
166
|
+
bitsPerSample: util.getBitAllignedNumber(buf, off + 12, 7, 5) + 1,
|
|
167
|
+
// Total samples in stream.
|
|
168
|
+
// 'Samples' means inter-channel sample, i.e. one second of 44.1Khz audio will have 44100 samples regardless of the number of channels.
|
|
169
|
+
// A value of zero here means the number of total samples is unknown.
|
|
170
|
+
totalSamples: util.getBitAllignedNumber(buf, off + 13, 4, 36),
|
|
171
|
+
// the MD5 hash of the file (see notes for usage... it's a littly tricky)
|
|
172
|
+
fileMD5: new token_types_1.Uint8ArrayType(16).get(buf, off + 18)
|
|
173
|
+
};
|
|
124
174
|
}
|
|
125
|
-
}
|
|
175
|
+
};
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import type { IPrivateOptions } from '../type.js';
|
|
4
|
-
import type { INativeMetadataCollector } from '../common/MetadataCollector.js';
|
|
1
|
+
import { BasicParser } from '../common/BasicParser';
|
|
2
|
+
import { IRandomReader } from '../type';
|
|
5
3
|
/**
|
|
6
4
|
* ID3v1 Genre mappings
|
|
7
5
|
* Ref: https://de.wikipedia.org/wiki/Liste_der_ID3v1-Genres
|
|
8
6
|
*/
|
|
9
7
|
export declare const Genres: string[];
|
|
10
8
|
export declare class ID3v1Parser extends BasicParser {
|
|
11
|
-
private apeHeader;
|
|
12
|
-
constructor(metadata: INativeMetadataCollector, tokenizer: ITokenizer, options: IPrivateOptions);
|
|
13
9
|
private static getGenre;
|
|
14
10
|
parse(): Promise<void>;
|
|
15
11
|
private addTag;
|
|
16
12
|
}
|
|
17
|
-
export declare function hasID3v1Header(
|
|
13
|
+
export declare function hasID3v1Header(reader: IRandomReader): Promise<boolean>;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasID3v1Header = exports.ID3v1Parser = exports.Genres = void 0;
|
|
4
|
+
const debug_1 = require("debug");
|
|
5
|
+
const token_types_1 = require("token-types");
|
|
6
|
+
const util = require("../common/Util");
|
|
7
|
+
const BasicParser_1 = require("../common/BasicParser");
|
|
8
|
+
const APEv2Parser_1 = require("../apev2/APEv2Parser");
|
|
9
|
+
const debug = (0, debug_1.default)('music-metadata:parser:ID3v1');
|
|
8
10
|
/**
|
|
9
11
|
* ID3v1 Genre mappings
|
|
10
12
|
* Ref: https://de.wikipedia.org/wiki/Liste_der_ID3v1-Genres
|
|
11
13
|
*/
|
|
12
|
-
|
|
14
|
+
exports.Genres = [
|
|
13
15
|
'Blues', 'Classic Rock', 'Country', 'Dance', 'Disco', 'Funk', 'Grunge', 'Hip-Hop',
|
|
14
16
|
'Jazz', 'Metal', 'New Age', 'Oldies', 'Other', 'Pop', 'R&B', 'Rap', 'Reggae', 'Rock',
|
|
15
17
|
'Techno', 'Industrial', 'Alternative', 'Ska', 'Death Metal', 'Pranks', 'Soundtrack',
|
|
@@ -60,33 +62,28 @@ const Iid3v1Token = {
|
|
|
60
62
|
year: new Id3v1StringType(4).get(buf, off + 93),
|
|
61
63
|
comment: new Id3v1StringType(28).get(buf, off + 97),
|
|
62
64
|
// ID3v1.1 separator for track
|
|
63
|
-
zeroByte: UINT8.get(buf, off + 127),
|
|
65
|
+
zeroByte: token_types_1.UINT8.get(buf, off + 127),
|
|
64
66
|
// track: ID3v1.1 field added by Michael Mutschler
|
|
65
|
-
track: UINT8.get(buf, off + 126),
|
|
66
|
-
genre: UINT8.get(buf, off + 127)
|
|
67
|
+
track: token_types_1.UINT8.get(buf, off + 126),
|
|
68
|
+
genre: token_types_1.UINT8.get(buf, off + 127)
|
|
67
69
|
} : null;
|
|
68
70
|
}
|
|
69
71
|
};
|
|
70
|
-
class Id3v1StringType {
|
|
72
|
+
class Id3v1StringType extends token_types_1.StringType {
|
|
71
73
|
constructor(len) {
|
|
72
|
-
|
|
73
|
-
this.stringType = new StringType(len, 'latin1');
|
|
74
|
+
super(len, 'binary');
|
|
74
75
|
}
|
|
75
76
|
get(buf, off) {
|
|
76
|
-
let value =
|
|
77
|
+
let value = super.get(buf, off);
|
|
77
78
|
value = util.trimRightNull(value);
|
|
78
79
|
value = value.trim();
|
|
79
80
|
return value.length > 0 ? value : undefined;
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
-
constructor(metadata, tokenizer, options) {
|
|
84
|
-
super(metadata, tokenizer, options);
|
|
85
|
-
this.apeHeader = options.apeHeader;
|
|
86
|
-
}
|
|
83
|
+
class ID3v1Parser extends BasicParser_1.BasicParser {
|
|
87
84
|
static getGenre(genreIndex) {
|
|
88
|
-
if (genreIndex < Genres.length) {
|
|
89
|
-
return Genres[genreIndex];
|
|
85
|
+
if (genreIndex < exports.Genres.length) {
|
|
86
|
+
return exports.Genres[genreIndex];
|
|
90
87
|
}
|
|
91
88
|
return undefined; // ToDO: generate warning
|
|
92
89
|
}
|
|
@@ -95,10 +92,11 @@ export class ID3v1Parser extends BasicParser {
|
|
|
95
92
|
debug('Skip checking for ID3v1 because the file-size is unknown');
|
|
96
93
|
return;
|
|
97
94
|
}
|
|
98
|
-
if (this.apeHeader) {
|
|
99
|
-
this.tokenizer.ignore(this.apeHeader.offset - this.tokenizer.position);
|
|
100
|
-
const apeParser = new APEv2Parser(
|
|
101
|
-
|
|
95
|
+
if (this.options.apeHeader) {
|
|
96
|
+
this.tokenizer.ignore(this.options.apeHeader.offset - this.tokenizer.position);
|
|
97
|
+
const apeParser = new APEv2Parser_1.APEv2Parser();
|
|
98
|
+
apeParser.init(this.metadata, this.tokenizer, this.options);
|
|
99
|
+
await apeParser.parseTags(this.options.apeHeader.footer);
|
|
102
100
|
}
|
|
103
101
|
const offset = this.tokenizer.fileInfo.size - Iid3v1Token.len;
|
|
104
102
|
if (this.tokenizer.position > offset) {
|
|
@@ -108,30 +106,29 @@ export class ID3v1Parser extends BasicParser {
|
|
|
108
106
|
const header = await this.tokenizer.readToken(Iid3v1Token, offset);
|
|
109
107
|
if (header) {
|
|
110
108
|
debug('ID3v1 header found at: pos=%s', this.tokenizer.fileInfo.size - Iid3v1Token.len);
|
|
111
|
-
const
|
|
112
|
-
for (const id of props) {
|
|
109
|
+
for (const id of ['title', 'artist', 'album', 'comment', 'track', 'year']) {
|
|
113
110
|
if (header[id] && header[id] !== '')
|
|
114
|
-
|
|
111
|
+
this.addTag(id, header[id]);
|
|
115
112
|
}
|
|
116
113
|
const genre = ID3v1Parser.getGenre(header.genre);
|
|
117
114
|
if (genre)
|
|
118
|
-
|
|
115
|
+
this.addTag('genre', genre);
|
|
119
116
|
}
|
|
120
117
|
else {
|
|
121
118
|
debug('ID3v1 header not found at: pos=%s', this.tokenizer.fileInfo.size - Iid3v1Token.len);
|
|
122
119
|
}
|
|
123
120
|
}
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
addTag(id, value) {
|
|
122
|
+
this.metadata.addTag('ID3v1', id, value);
|
|
126
123
|
}
|
|
127
124
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
await
|
|
133
|
-
|
|
134
|
-
return textDecode(tag, 'latin1') === 'TAG';
|
|
125
|
+
exports.ID3v1Parser = ID3v1Parser;
|
|
126
|
+
async function hasID3v1Header(reader) {
|
|
127
|
+
if (reader.fileSize >= 128) {
|
|
128
|
+
const tag = Buffer.alloc(3);
|
|
129
|
+
await reader.randomRead(tag, 0, tag.length, reader.fileSize - 128);
|
|
130
|
+
return tag.toString('binary') === 'TAG';
|
|
135
131
|
}
|
|
136
132
|
return false;
|
|
137
133
|
}
|
|
134
|
+
exports.hasID3v1Header = hasID3v1Header;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ID3v1TagMapper = void 0;
|
|
4
|
+
const GenericTagMapper_1 = require("../common/GenericTagMapper");
|
|
2
5
|
/**
|
|
3
6
|
* ID3v1 tag mappings
|
|
4
7
|
*/
|
|
@@ -11,8 +14,10 @@ const id3v1TagMap = {
|
|
|
11
14
|
track: 'track',
|
|
12
15
|
genre: 'genre'
|
|
13
16
|
};
|
|
14
|
-
|
|
17
|
+
class ID3v1TagMapper extends GenericTagMapper_1.CommonTagMapper {
|
|
15
18
|
constructor() {
|
|
16
19
|
super(['ID3v1'], id3v1TagMap);
|
|
17
20
|
}
|
|
18
21
|
}
|
|
22
|
+
exports.ID3v1TagMapper = ID3v1TagMapper;
|
|
23
|
+
//# sourceMappingURL=ID3v1TagMap.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BasicParser } from '../common/BasicParser
|
|
1
|
+
import { ITokenizer } from 'strtok3/lib/core';
|
|
2
|
+
import { BasicParser } from '../common/BasicParser';
|
|
3
3
|
/**
|
|
4
4
|
* Abstract parser which tries take ID3v2 and ID3v1 headers.
|
|
5
5
|
*/
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbstractID3Parser = void 0;
|
|
4
|
+
const core_1 = require("strtok3/lib/core");
|
|
5
|
+
const debug_1 = require("debug");
|
|
6
|
+
const ID3v2Token_1 = require("./ID3v2Token");
|
|
7
|
+
const ID3v2Parser_1 = require("./ID3v2Parser");
|
|
8
|
+
const ID3v1Parser_1 = require("../id3v1/ID3v1Parser");
|
|
9
|
+
const BasicParser_1 = require("../common/BasicParser");
|
|
10
|
+
const debug = (0, debug_1.default)('music-metadata:parser:ID3');
|
|
8
11
|
/**
|
|
9
12
|
* Abstract parser which tries take ID3v2 and ID3v1 headers.
|
|
10
13
|
*/
|
|
11
|
-
|
|
14
|
+
class AbstractID3Parser extends BasicParser_1.BasicParser {
|
|
12
15
|
constructor() {
|
|
13
16
|
super(...arguments);
|
|
14
|
-
this.id3parser = new ID3v2Parser();
|
|
17
|
+
this.id3parser = new ID3v2Parser_1.ID3v2Parser();
|
|
15
18
|
}
|
|
16
19
|
static async startsWithID3v2Header(tokenizer) {
|
|
17
|
-
return (await tokenizer.peekToken(ID3v2Header)).fileIdentifier === 'ID3';
|
|
20
|
+
return (await tokenizer.peekToken(ID3v2Token_1.ID3v2Header)).fileIdentifier === 'ID3';
|
|
18
21
|
}
|
|
19
22
|
async parse() {
|
|
20
23
|
try {
|
|
21
24
|
await this.parseID3v2();
|
|
22
25
|
}
|
|
23
26
|
catch (err) {
|
|
24
|
-
if (err instanceof EndOfStreamError) {
|
|
25
|
-
debug(
|
|
27
|
+
if (err instanceof core_1.EndOfStreamError) {
|
|
28
|
+
debug(`End-of-stream`);
|
|
26
29
|
}
|
|
27
30
|
else {
|
|
28
31
|
throw err;
|
|
@@ -40,13 +43,13 @@ export class AbstractID3Parser extends BasicParser {
|
|
|
40
43
|
this.finalize();
|
|
41
44
|
}
|
|
42
45
|
else {
|
|
43
|
-
const id3v1parser = new ID3v1Parser(
|
|
44
|
-
await id3v1parser.parse();
|
|
46
|
+
const id3v1parser = new ID3v1Parser_1.ID3v1Parser();
|
|
47
|
+
await id3v1parser.init(this.metadata, this.tokenizer, this.options).parse();
|
|
45
48
|
this.finalize();
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
async tryReadId3v2Headers() {
|
|
49
|
-
const id3Header = await this.tokenizer.peekToken(ID3v2Header);
|
|
52
|
+
const id3Header = await this.tokenizer.peekToken(ID3v2Token_1.ID3v2Header);
|
|
50
53
|
if (id3Header.fileIdentifier === 'ID3') {
|
|
51
54
|
debug('Found ID3v2 header, pos=%s', this.tokenizer.position);
|
|
52
55
|
await this.id3parser.parse(this.metadata, this.tokenizer, this.options);
|
|
@@ -54,3 +57,4 @@ export class AbstractID3Parser extends BasicParser {
|
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
}
|
|
60
|
+
exports.AbstractID3Parser = AbstractID3Parser;
|