@digabi/exam-engine-core 23.8.2-alpha.0 → 23.8.2

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 (205) hide show
  1. package/dist/__tests__/annotations.test.d.ts +2 -0
  2. package/dist/__tests__/annotations.test.d.ts.map +1 -0
  3. package/dist/__tests__/annotations.test.js +306 -0
  4. package/dist/__tests__/annotations.test.js.map +1 -0
  5. package/dist/__tests__/examServerApi.d.ts.map +1 -1
  6. package/dist/__tests__/examServerApi.js +0 -2
  7. package/dist/__tests__/examServerApi.js.map +1 -1
  8. package/dist/__tests__/playwright/Annotations.test.d.ts +2 -0
  9. package/dist/__tests__/playwright/Annotations.test.d.ts.map +1 -0
  10. package/dist/__tests__/playwright/Annotations.test.js +201 -0
  11. package/dist/__tests__/playwright/Annotations.test.js.map +1 -0
  12. package/dist/__tests__/playwright/attachments/Attachments.test.d.ts +2 -0
  13. package/dist/__tests__/playwright/attachments/Attachments.test.d.ts.map +1 -0
  14. package/dist/__tests__/playwright/attachments/Attachments.test.js +30 -0
  15. package/dist/__tests__/playwright/attachments/Attachments.test.js.map +1 -0
  16. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.d.ts +2 -0
  17. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.d.ts.map +1 -0
  18. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.js +30 -0
  19. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.js.map +1 -0
  20. package/dist/__tests__/playwright/stories/Annotations.story.d.ts +15 -0
  21. package/dist/__tests__/playwright/stories/Annotations.story.d.ts.map +1 -0
  22. package/dist/__tests__/playwright/stories/Annotations.story.js +27 -0
  23. package/dist/__tests__/playwright/stories/Annotations.story.js.map +1 -0
  24. package/dist/__tests__/playwright/stories/attachments/Attachments.story.d.ts +13 -0
  25. package/dist/__tests__/playwright/stories/attachments/Attachments.story.d.ts.map +1 -0
  26. package/dist/__tests__/playwright/stories/attachments/Attachments.story.js +17 -0
  27. package/dist/__tests__/playwright/stories/attachments/Attachments.story.js.map +1 -0
  28. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.d.ts +13 -0
  29. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.d.ts.map +1 -0
  30. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.js +16 -0
  31. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.js.map +1 -0
  32. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  33. package/dist/assets/NotoMono.ttf +0 -0
  34. package/dist/assets/NotoMono.woff +0 -0
  35. package/dist/assets/NotoMono.woff2 +0 -0
  36. package/dist/assets/NotoSans-Bold.ttf +0 -0
  37. package/dist/assets/NotoSans-Bold.woff +0 -0
  38. package/dist/assets/NotoSans-Bold.woff2 +0 -0
  39. package/dist/assets/NotoSans-BoldItalic.ttf +0 -0
  40. package/dist/assets/NotoSans-BoldItalic.woff +0 -0
  41. package/dist/assets/NotoSans-BoldItalic.woff2 +0 -0
  42. package/dist/assets/NotoSans-Italic.ttf +0 -0
  43. package/dist/assets/NotoSans-Italic.woff +0 -0
  44. package/dist/assets/NotoSans-Italic.woff2 +0 -0
  45. package/dist/assets/NotoSans-Light.ttf +0 -0
  46. package/dist/assets/NotoSans-Light.woff +0 -0
  47. package/dist/assets/NotoSans-Light.woff2 +0 -0
  48. package/dist/assets/NotoSans-LightItalic.ttf +0 -0
  49. package/dist/assets/NotoSans-LightItalic.woff +0 -0
  50. package/dist/assets/NotoSans-LightItalic.woff2 +0 -0
  51. package/dist/assets/NotoSans-Regular.ttf +0 -0
  52. package/dist/assets/NotoSans-Regular.woff +0 -0
  53. package/dist/assets/NotoSans-Regular.woff2 +0 -0
  54. package/dist/assets/NotoSans-SemiBold.ttf +0 -0
  55. package/dist/assets/NotoSans-SemiBold.woff +0 -0
  56. package/dist/assets/NotoSans-SemiBold.woff2 +0 -0
  57. package/dist/assets/NotoSans-SemiBoldItalic.ttf +0 -0
  58. package/dist/assets/NotoSans-SemiBoldItalic.woff +0 -0
  59. package/dist/assets/NotoSans-SemiBoldItalic.woff2 +0 -0
  60. package/dist/assets/closeButton.svg +1 -0
  61. package/dist/assets/collapse.svg +12 -0
  62. package/dist/assets/expand.svg +12 -0
  63. package/dist/assets/helpButton.svg +9 -0
  64. package/dist/assets/redoButton.svg +5 -0
  65. package/dist/assets/undoButton.svg +5 -0
  66. package/dist/components/attachments/Attachments.js +1 -1
  67. package/dist/components/attachments/Attachments.js.map +1 -1
  68. package/dist/components/context/QuestionContext.d.ts.map +1 -1
  69. package/dist/components/context/QuestionContext.js +1 -1
  70. package/dist/components/context/QuestionContext.js.map +1 -1
  71. package/dist/components/exam/Exam.d.ts.map +1 -1
  72. package/dist/components/exam/Exam.js +1 -3
  73. package/dist/components/exam/Exam.js.map +1 -1
  74. package/dist/components/grading/GradingAnswer.d.ts +6 -2
  75. package/dist/components/grading/GradingAnswer.d.ts.map +1 -1
  76. package/dist/components/grading/GradingAnswer.js +3 -4
  77. package/dist/components/grading/GradingAnswer.js.map +1 -1
  78. package/dist/components/grading/examAnnotationUtils.d.ts +4 -0
  79. package/dist/components/grading/examAnnotationUtils.d.ts.map +1 -0
  80. package/dist/components/grading/examAnnotationUtils.js +123 -0
  81. package/dist/components/grading/examAnnotationUtils.js.map +1 -0
  82. package/dist/components/results/DNDAnswerContainer.d.ts +4 -0
  83. package/dist/components/results/DNDAnswerContainer.d.ts.map +1 -0
  84. package/dist/components/results/DNDAnswerContainer.js +22 -0
  85. package/dist/components/results/DNDAnswerContainer.js.map +1 -0
  86. package/dist/components/results/Results.d.ts.map +1 -1
  87. package/dist/components/results/Results.js +1 -3
  88. package/dist/components/results/Results.js.map +1 -1
  89. package/dist/components/shared/AnnotatableText.d.ts +5 -0
  90. package/dist/components/shared/AnnotatableText.d.ts.map +1 -0
  91. package/dist/components/shared/AnnotatableText.js +25 -0
  92. package/dist/components/shared/AnnotatableText.js.map +1 -0
  93. package/dist/components/shared/AnnotationImageMark.d.ts +16 -0
  94. package/dist/components/shared/AnnotationImageMark.d.ts.map +1 -0
  95. package/dist/components/shared/AnnotationImageMark.js +99 -0
  96. package/dist/components/shared/AnnotationImageMark.js.map +1 -0
  97. package/dist/components/shared/AnnotationMark.d.ts +9 -0
  98. package/dist/components/shared/AnnotationMark.d.ts.map +1 -0
  99. package/dist/components/shared/AnnotationMark.js +14 -0
  100. package/dist/components/shared/AnnotationMark.js.map +1 -0
  101. package/dist/components/shared/AnnotationPopup.d.ts +3 -0
  102. package/dist/components/shared/AnnotationPopup.d.ts.map +1 -0
  103. package/dist/components/shared/AnnotationPopup.js +24 -0
  104. package/dist/components/shared/AnnotationPopup.js.map +1 -0
  105. package/dist/components/shared/AnnotationTextMark.d.ts +11 -0
  106. package/dist/components/shared/AnnotationTextMark.d.ts.map +1 -0
  107. package/dist/components/shared/AnnotationTextMark.js +21 -0
  108. package/dist/components/shared/AnnotationTextMark.js.map +1 -0
  109. package/dist/components/shared/QuestionNumber.d.ts +1 -1
  110. package/dist/components/shared/QuestionNumber.d.ts.map +1 -1
  111. package/dist/components/shared/QuestionNumber.js +4 -1
  112. package/dist/components/shared/QuestionNumber.js.map +1 -1
  113. package/dist/components/shared/markText.d.ts +6 -0
  114. package/dist/components/shared/markText.d.ts.map +1 -0
  115. package/dist/components/shared/markText.js +77 -0
  116. package/dist/components/shared/markText.js.map +1 -0
  117. package/dist/createRenderChildNodes.d.ts +2 -0
  118. package/dist/createRenderChildNodes.d.ts.map +1 -1
  119. package/dist/createRenderChildNodes.js +4 -3
  120. package/dist/createRenderChildNodes.js.map +1 -1
  121. package/dist/dom-utils.js +1 -1
  122. package/dist/dom-utils.js.map +1 -1
  123. package/dist/eslint.config.d.ts +22 -0
  124. package/dist/eslint.config.d.ts.map +1 -0
  125. package/dist/eslint.config.js +31 -0
  126. package/dist/eslint.config.js.map +1 -0
  127. package/dist/i18n/exam_titles_fi-FI.d.ts +46 -0
  128. package/dist/i18n/exam_titles_fi-FI.d.ts.map +1 -0
  129. package/dist/i18n/exam_titles_fi-FI.js +46 -0
  130. package/dist/i18n/exam_titles_fi-FI.js.map +1 -0
  131. package/dist/i18n/exam_titles_fi-FI.json +45 -0
  132. package/dist/i18n/exam_titles_sv-FI.d.ts +46 -0
  133. package/dist/i18n/exam_titles_sv-FI.d.ts.map +1 -0
  134. package/dist/i18n/exam_titles_sv-FI.js +46 -0
  135. package/dist/i18n/exam_titles_sv-FI.js.map +1 -0
  136. package/dist/i18n/exam_titles_sv-FI.json +45 -0
  137. package/dist/i18n/exams.d.ts +11 -0
  138. package/dist/i18n/exams.d.ts.map +1 -0
  139. package/dist/i18n/exams.js +10 -0
  140. package/dist/i18n/exams.js.map +1 -0
  141. package/dist/i18n/fi-FI.d.ts +0 -3
  142. package/dist/i18n/fi-FI.d.ts.map +1 -1
  143. package/dist/i18n/fi-FI.js +0 -3
  144. package/dist/i18n/fi-FI.js.map +1 -1
  145. package/dist/i18n/sv-FI.d.ts.map +1 -1
  146. package/dist/i18n/sv-FI.js +0 -3
  147. package/dist/i18n/sv-FI.js.map +1 -1
  148. package/dist/main-bundle.js +13 -13
  149. package/dist/main-bundle.js.LICENSE.txt +0 -7
  150. package/dist/main.css +1 -1
  151. package/dist/parser/parseExamStructure.d.ts +1 -8
  152. package/dist/parser/parseExamStructure.d.ts.map +1 -1
  153. package/dist/parser/parseExamStructure.js +1 -1
  154. package/dist/parser/parseExamStructure.js.map +1 -1
  155. package/dist/types/ExamAnnotations.d.ts +46 -0
  156. package/dist/types/ExamAnnotations.d.ts.map +1 -0
  157. package/dist/types/ExamAnnotations.js +2 -0
  158. package/dist/types/ExamAnnotations.js.map +1 -0
  159. package/dist/types/ExamAnswer.d.ts +1 -5
  160. package/dist/types/ExamAnswer.d.ts.map +1 -1
  161. package/dist/types/ExamServerAPI.d.ts +0 -4
  162. package/dist/types/ExamServerAPI.d.ts.map +1 -1
  163. package/dist/types/GradingStructure.d.ts +1 -7
  164. package/dist/types/GradingStructure.d.ts.map +1 -1
  165. package/dist/validateAnswers.d.ts.map +1 -1
  166. package/dist/validateAnswers.js +0 -1
  167. package/dist/validateAnswers.js.map +1 -1
  168. package/package.json +2 -3
  169. package/dist/components/exam/AudioAnswer.d.ts +0 -7
  170. package/dist/components/exam/AudioAnswer.d.ts.map +0 -1
  171. package/dist/components/exam/AudioAnswer.js +0 -79
  172. package/dist/components/exam/AudioAnswer.js.map +0 -1
  173. package/dist/components/exam/AudioAnswerRecorder.d.ts +0 -10
  174. package/dist/components/exam/AudioAnswerRecorder.d.ts.map +0 -1
  175. package/dist/components/exam/AudioAnswerRecorder.js +0 -28
  176. package/dist/components/exam/AudioAnswerRecorder.js.map +0 -1
  177. package/dist/components/exam/OralAnswer.d.ts +0 -6
  178. package/dist/components/exam/OralAnswer.d.ts.map +0 -1
  179. package/dist/components/exam/OralAnswer.js +0 -18
  180. package/dist/components/exam/OralAnswer.js.map +0 -1
  181. package/dist/components/results/AudioAnswer.d.ts +0 -6
  182. package/dist/components/results/AudioAnswer.d.ts.map +0 -1
  183. package/dist/components/results/AudioAnswer.js +0 -13
  184. package/dist/components/results/AudioAnswer.js.map +0 -1
  185. package/dist/components/shared/internal/AudioError.d.ts +0 -8
  186. package/dist/components/shared/internal/AudioError.d.ts.map +0 -1
  187. package/dist/components/shared/internal/AudioError.js +0 -17
  188. package/dist/components/shared/internal/AudioError.js.map +0 -1
  189. package/dist/components/shared/internal/AudioRecordingError.d.ts +0 -8
  190. package/dist/components/shared/internal/AudioRecordingError.d.ts.map +0 -1
  191. package/dist/components/shared/internal/AudioRecordingError.js +0 -17
  192. package/dist/components/shared/internal/AudioRecordingError.js.map +0 -1
  193. package/dist/node_modules_music-metadata_lib_aiff_AiffParser_js.main-bundle.js +0 -33
  194. package/dist/node_modules_music-metadata_lib_dsdiff_DsdiffParser_js.main-bundle.js +0 -26
  195. package/dist/node_modules_music-metadata_lib_dsf_DsfParser_js.main-bundle.js +0 -33
  196. package/dist/node_modules_music-metadata_lib_wavpack_WavPackParser_js.main-bundle.js +0 -26
  197. package/dist/vendors-node_modules_music-metadata_lib_asf_AsfParser_js.main-bundle.js +0 -40
  198. package/dist/vendors-node_modules_music-metadata_lib_flac_FlacParser_js.main-bundle.js +0 -47
  199. package/dist/vendors-node_modules_music-metadata_lib_id3v2_ID3v2Parser_js.main-bundle.js +0 -26
  200. package/dist/vendors-node_modules_music-metadata_lib_matroska_MatroskaParser_js.main-bundle.js +0 -40
  201. package/dist/vendors-node_modules_music-metadata_lib_mp4_MP4Parser_js.main-bundle.js +0 -33
  202. package/dist/vendors-node_modules_music-metadata_lib_mpeg_MpegParser_js.main-bundle.js +0 -47
  203. package/dist/vendors-node_modules_music-metadata_lib_musepack_MusepackParser_js.main-bundle.js +0 -68
  204. package/dist/vendors-node_modules_music-metadata_lib_ogg_OggParser_js.main-bundle.js +0 -82
  205. package/dist/vendors-node_modules_music-metadata_lib_wav_WaveParser_js.main-bundle.js +0 -40
@@ -1,33 +0,0 @@
1
- "use strict";
2
- /*
3
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
4
- * This devtool is neither made for production nor for readable output files.
5
- * It uses "eval()" calls to create a separate source file in the browser devtools.
6
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
7
- * or disable the default devtool with "devtool: false".
8
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
9
- */
10
- (this["webpackChunkExamBundle"] = this["webpackChunkExamBundle"] || []).push([["vendors-node_modules_music-metadata_lib_mp4_MP4Parser_js"],{
11
-
12
- /***/ "../../node_modules/music-metadata/lib/mp4/Atom.js":
13
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14
-
15
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Atom: () => (/* binding */ Atom)\n/* harmony export */ });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var _AtomToken_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/music-metadata/lib/mp4/AtomToken.js\");\n\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_0__('music-metadata:parser:MP4:Atom');\nclass Atom {\n static async readAtom(tokenizer, dataHandler, parent, remaining) {\n // Parse atom header\n const offset = tokenizer.position;\n debug(`Reading next token on offset=${offset}...`); // buf.toString('ascii')\n const header = await tokenizer.readToken(_AtomToken_js__WEBPACK_IMPORTED_MODULE_1__.Header);\n const extended = header.length === 1n;\n if (extended) {\n header.length = await tokenizer.readToken(_AtomToken_js__WEBPACK_IMPORTED_MODULE_1__.ExtendedSize);\n }\n const atomBean = new Atom(header, extended, parent);\n const payloadLength = atomBean.getPayloadLength(remaining);\n debug(`parse atom name=${atomBean.atomPath}, extended=${atomBean.extended}, offset=${offset}, len=${atomBean.header.length}`); // buf.toString('ascii')\n await atomBean.readData(tokenizer, dataHandler, payloadLength);\n return atomBean;\n }\n constructor(header, extended, parent) {\n this.header = header;\n this.extended = extended;\n this.parent = parent;\n this.children = [];\n this.atomPath = (this.parent ? `${this.parent.atomPath}.` : '') + this.header.name;\n }\n getHeaderLength() {\n return this.extended ? 16 : 8;\n }\n getPayloadLength(remaining) {\n return (this.header.length === 0n ? remaining : Number(this.header.length)) - this.getHeaderLength();\n }\n async readAtoms(tokenizer, dataHandler, size) {\n while (size > 0) {\n const atomBean = await Atom.readAtom(tokenizer, dataHandler, this, size);\n this.children.push(atomBean);\n size -= atomBean.header.length === 0n ? size : Number(atomBean.header.length);\n }\n }\n async readData(tokenizer, dataHandler, remaining) {\n switch (this.header.name) {\n // \"Container\" atoms, contains nested atoms\n case 'moov': // The Movie Atom: contains other atoms\n case 'udta': // User defined atom\n case 'trak':\n case 'mdia': // Media atom\n case 'minf': // Media Information Atom\n case 'stbl': // The Sample Table Atom\n case '<id>':\n case 'ilst':\n case 'tref':\n return this.readAtoms(tokenizer, dataHandler, this.getPayloadLength(remaining));\n case 'meta': { // Metadata Atom, ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW8\n // meta has 4 bytes of padding, ignore\n const peekHeader = await tokenizer.peekToken(_AtomToken_js__WEBPACK_IMPORTED_MODULE_1__.Header);\n const paddingLength = peekHeader.name === 'hdlr' ? 0 : 4;\n await tokenizer.ignore(paddingLength);\n return this.readAtoms(tokenizer, dataHandler, this.getPayloadLength(remaining) - paddingLength);\n }\n default:\n return dataHandler(this, remaining);\n }\n }\n}\n//# sourceMappingURL=Atom.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/mp4/Atom.js?");
16
-
17
- /***/ }),
18
-
19
- /***/ "../../node_modules/music-metadata/lib/mp4/AtomToken.js":
20
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
21
-
22
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ChapterText: () => (/* binding */ ChapterText),\n/* harmony export */ DataAtom: () => (/* binding */ DataAtom),\n/* harmony export */ ExtendedSize: () => (/* binding */ ExtendedSize),\n/* harmony export */ FixedLengthAtom: () => (/* binding */ FixedLengthAtom),\n/* harmony export */ Header: () => (/* binding */ Header),\n/* harmony export */ MdhdAtom: () => (/* binding */ MdhdAtom),\n/* harmony export */ Mp4ContentError: () => (/* binding */ Mp4ContentError),\n/* harmony export */ MvhdAtom: () => (/* binding */ MvhdAtom),\n/* harmony export */ NameAtom: () => (/* binding */ NameAtom),\n/* harmony export */ SampleToChunkToken: () => (/* binding */ SampleToChunkToken),\n/* harmony export */ SoundSampleDescriptionV0: () => (/* binding */ SoundSampleDescriptionV0),\n/* harmony export */ SoundSampleDescriptionVersion: () => (/* binding */ SoundSampleDescriptionVersion),\n/* harmony export */ StcoAtom: () => (/* binding */ StcoAtom),\n/* harmony export */ StscAtom: () => (/* binding */ StscAtom),\n/* harmony export */ StsdAtom: () => (/* binding */ StsdAtom),\n/* harmony export */ StszAtom: () => (/* binding */ StszAtom),\n/* harmony export */ SttsAtom: () => (/* binding */ SttsAtom),\n/* harmony export */ TimeToSampleToken: () => (/* binding */ TimeToSampleToken),\n/* harmony export */ TrackHeaderAtom: () => (/* binding */ TrackHeaderAtom),\n/* harmony export */ ftyp: () => (/* binding */ ftyp),\n/* harmony export */ mhdr: () => (/* binding */ mhdr),\n/* harmony export */ tkhd: () => (/* binding */ tkhd)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var _common_FourCC_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/FourCC.js\");\n/* harmony import */ var _ParseError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ParseError.js\");\n\n\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_1__('music-metadata:parser:MP4:atom');\nclass Mp4ContentError extends (0,_ParseError_js__WEBPACK_IMPORTED_MODULE_3__.makeUnexpectedFileContentError)('MP4') {\n}\nconst Header = {\n len: 8,\n get: (buf, off) => {\n const length = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off);\n if (length < 0)\n throw new Mp4ContentError('Invalid atom header length');\n return {\n length: BigInt(length),\n name: new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(4, 'latin1').get(buf, off + 4)\n };\n },\n put: (buf, off, hdr) => {\n token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.put(buf, off, Number(hdr.length));\n return _common_FourCC_js__WEBPACK_IMPORTED_MODULE_2__.FourCcToken.put(buf, off + 4, hdr.name);\n }\n};\n/**\n * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap1/qtff1.html#//apple_ref/doc/uid/TP40000939-CH203-38190\n */\nconst ExtendedSize = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT64_BE;\nconst ftyp = {\n len: 4,\n get: (buf, off) => {\n return {\n type: new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(4, 'ascii').get(buf, off)\n };\n }\n};\nconst tkhd = {\n len: 4,\n get: (buf, off) => {\n return {\n type: new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(4, 'ascii').get(buf, off)\n };\n }\n};\n/**\n * Token: Movie Header Atom\n */\nconst mhdr = {\n len: 8,\n get: (buf, off) => {\n return {\n version: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off),\n flags: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT24_BE.get(buf, off + 1),\n nextItemID: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 4)\n };\n }\n};\n/**\n * Base class for 'fixed' length atoms.\n * In some cases these atoms are longer then the sum of the described fields.\n * Issue: https://github.com/Borewit/music-metadata/issues/120\n */\nclass FixedLengthAtom {\n /**\n *\n * @param {number} len Length as specified in the size field\n * @param {number} expLen Total length of sum of specified fields in the standard\n * @param atomId Atom ID\n */\n constructor(len, expLen, atomId) {\n this.len = len;\n if (len < expLen) {\n throw new Mp4ContentError(`Atom ${atomId} expected to be ${expLen}, but specifies ${len} bytes long.`);\n }\n if (len > expLen) {\n debug(`Warning: atom ${atomId} expected to be ${expLen}, but was actually ${len} bytes long.`);\n }\n }\n}\n/**\n * Timestamp stored in seconds since Mac Epoch (1 January 1904)\n */\nconst SecondsSinceMacEpoch = {\n len: 4,\n get: (buf, off) => {\n const secondsSinceUnixEpoch = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off) - 2082844800;\n return new Date(secondsSinceUnixEpoch * 1000);\n }\n};\n/**\n * Token: Media Header Atom\n * Ref:\n * - https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-SW34\n * - https://wiki.multimedia.cx/index.php/QuickTime_container#mdhd\n */\nclass MdhdAtom extends FixedLengthAtom {\n constructor(len) {\n super(len, 24, 'mdhd');\n this.len = len;\n }\n get(buf, off) {\n return {\n version: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 0),\n flags: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT24_BE.get(buf, off + 1),\n creationTime: SecondsSinceMacEpoch.get(buf, off + 4),\n modificationTime: SecondsSinceMacEpoch.get(buf, off + 8),\n timeScale: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 12),\n duration: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 16),\n language: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_BE.get(buf, off + 20),\n quality: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_BE.get(buf, off + 22)\n };\n }\n}\n/**\n * Token: Movie Header Atom\n */\nclass MvhdAtom extends FixedLengthAtom {\n constructor(len) {\n super(len, 100, 'mvhd');\n this.len = len;\n }\n get(buf, off) {\n return {\n version: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off),\n flags: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT24_BE.get(buf, off + 1),\n creationTime: SecondsSinceMacEpoch.get(buf, off + 4),\n modificationTime: SecondsSinceMacEpoch.get(buf, off + 8),\n timeScale: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 12),\n duration: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 16),\n preferredRate: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 20),\n preferredVolume: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_BE.get(buf, off + 24),\n // ignore reserver: 10 bytes\n // ignore matrix structure: 36 bytes\n previewTime: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 72),\n previewDuration: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 76),\n posterTime: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 80),\n selectionTime: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 84),\n selectionDuration: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 88),\n currentTime: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 92),\n nextTrackID: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 96)\n };\n }\n}\n/**\n * Data Atom Structure\n */\nclass DataAtom {\n constructor(len) {\n this.len = len;\n }\n get(buf, off) {\n return {\n type: {\n set: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 0),\n type: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT24_BE.get(buf, off + 1)\n },\n locale: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT24_BE.get(buf, off + 4),\n value: new token_types__WEBPACK_IMPORTED_MODULE_0__.Uint8ArrayType(this.len - 8).get(buf, off + 8)\n };\n }\n}\n/**\n * Data Atom Structure\n * Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW31\n */\nclass NameAtom {\n constructor(len) {\n this.len = len;\n }\n get(buf, off) {\n return {\n version: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off),\n flags: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT24_BE.get(buf, off + 1),\n name: new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(this.len - 4, 'utf-8').get(buf, off + 4)\n };\n }\n}\n/**\n * Track Header Atoms structure\n * Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25550\n */\nclass TrackHeaderAtom {\n constructor(len) {\n this.len = len;\n }\n get(buf, off) {\n return {\n version: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off),\n flags: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT24_BE.get(buf, off + 1),\n creationTime: SecondsSinceMacEpoch.get(buf, off + 4),\n modificationTime: SecondsSinceMacEpoch.get(buf, off + 8),\n trackId: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 12),\n // reserved 4 bytes\n duration: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 20),\n layer: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_BE.get(buf, off + 24),\n alternateGroup: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_BE.get(buf, off + 26),\n volume: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_BE.get(buf, off + 28) // ToDo: fixed point\n // ToDo: add remaining fields\n };\n }\n}\n/**\n * Atom: Sample Description Atom ('stsd')\n * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25691\n */\nconst stsdHeader = {\n len: 8,\n get: (buf, off) => {\n return {\n version: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off),\n flags: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT24_BE.get(buf, off + 1),\n numberOfEntries: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 4)\n };\n }\n};\n/**\n * Atom: Sample Description Atom ('stsd')\n * Ref: https://developer.apple.com/documentation/quicktime-file-format/sample_description_atom\n */\nclass SampleDescriptionTable {\n constructor(len) {\n this.len = len;\n }\n get(buf, off) {\n const descrLen = this.len - 12;\n return {\n dataFormat: _common_FourCC_js__WEBPACK_IMPORTED_MODULE_2__.FourCcToken.get(buf, off),\n dataReferenceIndex: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_BE.get(buf, off + 10),\n description: descrLen > 0 ? new token_types__WEBPACK_IMPORTED_MODULE_0__.Uint8ArrayType(descrLen).get(buf, off + 12) : undefined\n };\n }\n}\n/**\n * Atom: Sample-description Atom ('stsd')\n * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25691\n */\nclass StsdAtom {\n constructor(len) {\n this.len = len;\n }\n get(buf, off) {\n const header = stsdHeader.get(buf, off);\n off += stsdHeader.len;\n const table = [];\n for (let n = 0; n < header.numberOfEntries; ++n) {\n const size = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off); // Sample description size\n off += token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.len;\n table.push(new SampleDescriptionTable(size - token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.len).get(buf, off));\n off += size;\n }\n return {\n header,\n table\n };\n }\n}\n/**\n * Common Sound Sample Description (version & revision)\n * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-57317\n */\nconst SoundSampleDescriptionVersion = {\n len: 8,\n get(buf, off) {\n return {\n version: token_types__WEBPACK_IMPORTED_MODULE_0__.INT16_BE.get(buf, off),\n revision: token_types__WEBPACK_IMPORTED_MODULE_0__.INT16_BE.get(buf, off + 2),\n vendor: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_BE.get(buf, off + 4)\n };\n }\n};\n/**\n * Sound Sample Description (Version 0)\n * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-130736\n */\nconst SoundSampleDescriptionV0 = {\n len: 12,\n get(buf, off) {\n return {\n numAudioChannels: token_types__WEBPACK_IMPORTED_MODULE_0__.INT16_BE.get(buf, off + 0),\n sampleSize: token_types__WEBPACK_IMPORTED_MODULE_0__.INT16_BE.get(buf, off + 2),\n compressionId: token_types__WEBPACK_IMPORTED_MODULE_0__.INT16_BE.get(buf, off + 4),\n packetSize: token_types__WEBPACK_IMPORTED_MODULE_0__.INT16_BE.get(buf, off + 6),\n sampleRate: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_BE.get(buf, off + 8) + token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_BE.get(buf, off + 10) / 10000\n };\n }\n};\nclass SimpleTableAtom {\n constructor(len, token) {\n this.len = len;\n this.token = token;\n }\n get(buf, off) {\n const nrOfEntries = token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_BE.get(buf, off + 4);\n return {\n version: token_types__WEBPACK_IMPORTED_MODULE_0__.INT8.get(buf, off + 0),\n flags: token_types__WEBPACK_IMPORTED_MODULE_0__.INT24_BE.get(buf, off + 1),\n numberOfEntries: nrOfEntries,\n entries: readTokenTable(buf, this.token, off + 8, this.len - 8, nrOfEntries)\n };\n }\n}\nconst TimeToSampleToken = {\n len: 8,\n get(buf, off) {\n return {\n count: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_BE.get(buf, off + 0),\n duration: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_BE.get(buf, off + 4)\n };\n }\n};\n/**\n * Time-to-sample('stts') atom.\n * Store duration information for a media’s samples.\n * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25696\n */\nclass SttsAtom extends SimpleTableAtom {\n constructor(len) {\n super(len, TimeToSampleToken);\n this.len = len;\n }\n}\nconst SampleToChunkToken = {\n len: 12,\n get(buf, off) {\n return {\n firstChunk: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_BE.get(buf, off),\n samplesPerChunk: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_BE.get(buf, off + 4),\n sampleDescriptionId: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_BE.get(buf, off + 8)\n };\n }\n};\n/**\n * Sample-to-Chunk ('stsc') atom interface\n * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25706\n */\nclass StscAtom extends SimpleTableAtom {\n constructor(len) {\n super(len, SampleToChunkToken);\n this.len = len;\n }\n}\n/**\n * Sample-size ('stsz') atom\n * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25710\n */\nclass StszAtom {\n constructor(len) {\n this.len = len;\n }\n get(buf, off) {\n const nrOfEntries = token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_BE.get(buf, off + 8);\n return {\n version: token_types__WEBPACK_IMPORTED_MODULE_0__.INT8.get(buf, off),\n flags: token_types__WEBPACK_IMPORTED_MODULE_0__.INT24_BE.get(buf, off + 1),\n sampleSize: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_BE.get(buf, off + 4),\n numberOfEntries: nrOfEntries,\n entries: readTokenTable(buf, token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_BE, off + 12, this.len - 12, nrOfEntries)\n };\n }\n}\n/**\n * Chunk offset atom, 'stco'\n * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25715\n */\nclass StcoAtom extends SimpleTableAtom {\n constructor(len) {\n super(len, token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_BE);\n this.len = len;\n }\n}\n/**\n * Token used to decode text-track from 'mdat' atom (raw data stream)\n */\nclass ChapterText {\n constructor(len) {\n this.len = len;\n }\n get(buf, off) {\n const titleLen = token_types__WEBPACK_IMPORTED_MODULE_0__.INT16_BE.get(buf, off + 0);\n const str = new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(titleLen, 'utf-8');\n return str.get(buf, off + 2);\n }\n}\nfunction readTokenTable(buf, token, off, remainingLen, numberOfEntries) {\n debug(`remainingLen=${remainingLen}, numberOfEntries=${numberOfEntries} * token-len=${token.len}`);\n if (remainingLen === 0)\n return [];\n if (remainingLen !== numberOfEntries * token.len)\n throw new Mp4ContentError('mismatch number-of-entries with remaining atom-length');\n const entries = [];\n // parse offset-table\n for (let n = 0; n < numberOfEntries; ++n) {\n entries.push(token.get(buf, off));\n off += token.len;\n }\n return entries;\n}\n//# sourceMappingURL=AtomToken.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/mp4/AtomToken.js?");
23
-
24
- /***/ }),
25
-
26
- /***/ "../../node_modules/music-metadata/lib/mp4/MP4Parser.js":
27
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
28
-
29
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MP4Parser: () => (/* binding */ MP4Parser)\n/* harmony export */ });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var _common_BasicParser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/BasicParser.js\");\n/* harmony import */ var _id3v1_ID3v1Parser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\"../../node_modules/music-metadata/lib/id3v1/ID3v1Parser.js\");\n/* harmony import */ var _Atom_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\"../../node_modules/music-metadata/lib/mp4/Atom.js\");\n/* harmony import */ var _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\"../../node_modules/music-metadata/lib/mp4/AtomToken.js\");\n/* harmony import */ var _type_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(\"../../node_modules/music-metadata/lib/type.js\");\n/* harmony import */ var uint8array_extras__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(\"../../node_modules/uint8array-extras/index.js\");\n\n\n\n\n\n\n\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_0__('music-metadata:parser:MP4');\nconst tagFormat = 'iTunes';\nconst encoderDict = {\n raw: {\n lossy: false,\n format: 'raw'\n },\n MAC3: {\n lossy: true,\n format: 'MACE 3:1'\n },\n MAC6: {\n lossy: true,\n format: 'MACE 6:1'\n },\n ima4: {\n lossy: true,\n format: 'IMA 4:1'\n },\n ulaw: {\n lossy: true,\n format: 'uLaw 2:1'\n },\n alaw: {\n lossy: true,\n format: 'uLaw 2:1'\n },\n Qclp: {\n lossy: true,\n format: 'QUALCOMM PureVoice'\n },\n '.mp3': {\n lossy: true,\n format: 'MPEG-1 layer 3'\n },\n alac: {\n lossy: false,\n format: 'ALAC'\n },\n 'ac-3': {\n lossy: true,\n format: 'AC-3'\n },\n mp4a: {\n lossy: true,\n format: 'MPEG-4/AAC'\n },\n mp4s: {\n lossy: true,\n format: 'MP4S'\n },\n // Closed Captioning Media, https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-SW87\n c608: {\n lossy: true,\n format: 'CEA-608'\n },\n c708: {\n lossy: true,\n format: 'CEA-708'\n }\n};\nfunction distinct(value, index, self) {\n return self.indexOf(value) === index;\n}\n/*\n * Parser for the MP4 (MPEG-4 Part 14) container format\n * Standard: ISO/IEC 14496-14\n * supporting:\n * - QuickTime container\n * - MP4 File Format\n * - 3GPP file format\n * - 3GPP2 file format\n *\n * MPEG-4 Audio / Part 3 (.m4a)& MPEG 4 Video (m4v, mp4) extension.\n * Support for Apple iTunes tags as found in a M4A/M4V files.\n * Ref:\n * https://en.wikipedia.org/wiki/ISO_base_media_file_format\n * https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/Metadata/Metadata.html\n * http://atomicparsley.sourceforge.net/mpeg-4files.html\n * https://github.com/sergiomb2/libmp4v2/wiki/iTunesMetadata\n * https://wiki.multimedia.cx/index.php/QuickTime_container\n */\nclass MP4Parser extends _common_BasicParser_js__WEBPACK_IMPORTED_MODULE_2__.BasicParser {\n constructor() {\n super(...arguments);\n this.tracks = [];\n this.atomParsers = {\n /**\n * Parse movie header (mvhd) atom\n * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-56313\n */\n mvhd: async (len) => {\n const mvhd = await this.tokenizer.readToken(new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.MvhdAtom(len));\n this.metadata.setFormat('creationTime', mvhd.creationTime);\n this.metadata.setFormat('modificationTime', mvhd.modificationTime);\n },\n /**\n * Parse media header (mdhd) atom\n * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25615\n */\n mdhd: async (len) => {\n const mdhd_data = await this.tokenizer.readToken(new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.MdhdAtom(len));\n // this.parse_mxhd(mdhd_data, this.currentTrack);\n const td = this.getTrackDescription();\n td.creationTime = mdhd_data.creationTime;\n td.modificationTime = mdhd_data.modificationTime;\n td.timeScale = mdhd_data.timeScale;\n td.duration = mdhd_data.duration;\n },\n chap: async (len) => {\n const td = this.getTrackDescription();\n const trackIds = [];\n while (len >= token_types__WEBPACK_IMPORTED_MODULE_1__.UINT32_BE.len) {\n trackIds.push(await this.tokenizer.readNumber(token_types__WEBPACK_IMPORTED_MODULE_1__.UINT32_BE));\n len -= token_types__WEBPACK_IMPORTED_MODULE_1__.UINT32_BE.len;\n }\n td.chapterList = trackIds;\n },\n tkhd: async (len) => {\n const track = (await this.tokenizer.readToken(new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.TrackHeaderAtom(len)));\n this.tracks.push(track);\n },\n /**\n * Parse mdat atom.\n * Will scan for chapters\n */\n mdat: async (len) => {\n this.audioLengthInBytes = len;\n this.calculateBitRate();\n if (this.options.includeChapters) {\n const trackWithChapters = this.tracks.filter(track => track.chapterList);\n if (trackWithChapters.length === 1) {\n const chapterTrackIds = trackWithChapters[0].chapterList;\n const chapterTracks = this.tracks.filter(track => chapterTrackIds.indexOf(track.trackId) !== -1);\n if (chapterTracks.length === 1) {\n return this.parseChapterTrack(chapterTracks[0], trackWithChapters[0], len);\n }\n }\n }\n await this.tokenizer.ignore(len);\n },\n ftyp: async (len) => {\n const types = [];\n while (len > 0) {\n const ftype = await this.tokenizer.readToken(_AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.ftyp);\n len -= _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.ftyp.len;\n const value = ftype.type.replace(/\\W/g, '');\n if (value.length > 0) {\n types.push(value); // unshift for backward compatibility\n }\n }\n debug(`ftyp: ${types.join('/')}`);\n const x = types.filter(distinct).join('/');\n this.metadata.setFormat('container', x);\n },\n /**\n * Parse sample description atom\n */\n stsd: async (len) => {\n const stsd = await this.tokenizer.readToken(new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.StsdAtom(len));\n const trackDescription = this.getTrackDescription();\n trackDescription.soundSampleDescription = stsd.table.map(dfEntry => this.parseSoundSampleDescription(dfEntry));\n },\n /**\n * sample-to-Chunk Atoms\n */\n stsc: async (len) => {\n const stsc = await this.tokenizer.readToken(new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.StscAtom(len));\n this.getTrackDescription().sampleToChunkTable = stsc.entries;\n },\n /**\n * time-to-sample table\n */\n stts: async (len) => {\n const stts = await this.tokenizer.readToken(new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.SttsAtom(len));\n this.getTrackDescription().timeToSampleTable = stts.entries;\n },\n /**\n * Parse sample-sizes atom ('stsz')\n */\n stsz: async (len) => {\n const stsz = await this.tokenizer.readToken(new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.StszAtom(len));\n const td = this.getTrackDescription();\n td.sampleSize = stsz.sampleSize;\n td.sampleSizeTable = stsz.entries;\n },\n /**\n * Parse chunk-offset atom ('stco')\n */\n stco: async (len) => {\n const stco = await this.tokenizer.readToken(new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.StcoAtom(len));\n this.getTrackDescription().chunkOffsetTable = stco.entries; // remember chunk offsets\n },\n date: async (len) => {\n const date = await this.tokenizer.readToken(new token_types__WEBPACK_IMPORTED_MODULE_1__.StringType(len, 'utf-8'));\n await this.addTag('date', date);\n }\n };\n }\n static read_BE_Integer(array, signed) {\n const integerType = (signed ? 'INT' : 'UINT') + array.length * 8 + (array.length > 1 ? '_BE' : '');\n const token = token_types__WEBPACK_IMPORTED_MODULE_1__[integerType];\n if (!token) {\n throw new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.Mp4ContentError(`Token for integer type not found: \"${integerType}\"`);\n }\n return Number(token.get(array, 0));\n }\n async parse() {\n this.tracks = [];\n let remainingFileSize = this.tokenizer.fileInfo.size || 0;\n while (!this.tokenizer.fileInfo.size || remainingFileSize > 0) {\n try {\n const token = await this.tokenizer.peekToken(_AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.Header);\n if (token.name === '\\0\\0\\0\\0') {\n const errMsg = `Error at offset=${this.tokenizer.position}: box.id=0`;\n debug(errMsg);\n this.addWarning(errMsg);\n break;\n }\n }\n catch (error) {\n if (error instanceof Error) {\n const errMsg = `Error at offset=${this.tokenizer.position}: ${error.message}`;\n debug(errMsg);\n this.addWarning(errMsg);\n }\n else\n throw error;\n break;\n }\n const rootAtom = await _Atom_js__WEBPACK_IMPORTED_MODULE_4__.Atom.readAtom(this.tokenizer, (atom, remaining) => this.handleAtom(atom, remaining), null, remainingFileSize);\n remainingFileSize -= rootAtom.header.length === BigInt(0) ? remainingFileSize : Number(rootAtom.header.length);\n }\n // Post process metadata\n const formatList = [];\n this.tracks.forEach(track => {\n const trackFormats = [];\n track.soundSampleDescription.forEach(ssd => {\n const streamInfo = {};\n const encoderInfo = encoderDict[ssd.dataFormat];\n if (encoderInfo) {\n trackFormats.push(encoderInfo.format);\n streamInfo.codecName = encoderInfo.format;\n }\n else {\n streamInfo.codecName = `<${ssd.dataFormat}>`;\n }\n if (ssd.description) {\n const { description } = ssd;\n if (description.sampleRate > 0) {\n streamInfo.type = _type_js__WEBPACK_IMPORTED_MODULE_6__.TrackType.audio;\n streamInfo.audio = {\n samplingFrequency: description.sampleRate,\n bitDepth: description.sampleSize,\n channels: description.numAudioChannels\n };\n }\n }\n this.metadata.addStreamInfo(streamInfo);\n });\n if (trackFormats.length >= 1) {\n formatList.push(trackFormats.join('/'));\n }\n });\n if (formatList.length > 0) {\n this.metadata.setFormat('codec', formatList.filter(distinct).join('+'));\n }\n const audioTracks = this.tracks.filter(track => {\n return track.soundSampleDescription.length >= 1 && track.soundSampleDescription[0].description && track.soundSampleDescription[0].description.numAudioChannels > 0;\n });\n if (audioTracks.length >= 1) {\n const audioTrack = audioTracks[0];\n if (audioTrack.timeScale > 0) {\n const duration = audioTrack.duration / audioTrack.timeScale; // calculate duration in seconds\n this.metadata.setFormat('duration', duration);\n }\n const ssd = audioTrack.soundSampleDescription[0];\n if (ssd.description) {\n this.metadata.setFormat('sampleRate', ssd.description.sampleRate);\n this.metadata.setFormat('bitsPerSample', ssd.description.sampleSize);\n this.metadata.setFormat('numberOfChannels', ssd.description.numAudioChannels);\n if (audioTrack.timeScale === 0 && audioTrack.timeToSampleTable.length > 0) {\n const totalSampleSize = audioTrack.timeToSampleTable\n .map(ttstEntry => ttstEntry.count * ttstEntry.duration)\n .reduce((total, sampleSize) => total + sampleSize);\n const duration = totalSampleSize / ssd.description.sampleRate;\n this.metadata.setFormat('duration', duration);\n }\n }\n const encoderInfo = encoderDict[ssd.dataFormat];\n if (encoderInfo) {\n this.metadata.setFormat('lossless', !encoderInfo.lossy);\n }\n this.calculateBitRate();\n }\n }\n async handleAtom(atom, remaining) {\n if (atom.parent) {\n switch (atom.parent.header.name) {\n case 'ilst':\n case '<id>':\n return this.parseMetadataItemData(atom);\n }\n }\n // const payloadLength = atom.getPayloadLength(remaining);\n if (this.atomParsers[atom.header.name]) {\n return this.atomParsers[atom.header.name](remaining);\n }\n debug(`No parser for atom path=${atom.atomPath}, payload-len=${remaining}, ignoring atom`);\n await this.tokenizer.ignore(remaining);\n }\n getTrackDescription() {\n return this.tracks[this.tracks.length - 1];\n }\n calculateBitRate() {\n if (this.audioLengthInBytes && this.metadata.format.duration) {\n this.metadata.setFormat('bitrate', 8 * this.audioLengthInBytes / this.metadata.format.duration);\n }\n }\n async addTag(id, value) {\n await this.metadata.addTag(tagFormat, id, value);\n }\n addWarning(message) {\n debug(`Warning: ${message}`);\n this.metadata.addWarning(message);\n }\n /**\n * Parse data of Meta-item-list-atom (item of 'ilst' atom)\n * @param metaAtom\n * Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW8\n */\n parseMetadataItemData(metaAtom) {\n let tagKey = metaAtom.header.name;\n return metaAtom.readAtoms(this.tokenizer, async (child, remaining) => {\n const payLoadLength = child.getPayloadLength(remaining);\n switch (child.header.name) {\n case 'data': // value atom\n return this.parseValueAtom(tagKey, child);\n case 'name': // name atom (optional)\n case 'mean':\n case 'rate': {\n const name = await this.tokenizer.readToken(new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.NameAtom(payLoadLength));\n tagKey += `:${name.name}`;\n break;\n }\n default: {\n const uint8Array = await this.tokenizer.readToken(new token_types__WEBPACK_IMPORTED_MODULE_1__.Uint8ArrayType(payLoadLength));\n this.addWarning(`Unsupported meta-item: ${tagKey}[${child.header.name}] => value=${(0,uint8array_extras__WEBPACK_IMPORTED_MODULE_7__.uint8ArrayToHex)(uint8Array)} ascii=${(0,uint8array_extras__WEBPACK_IMPORTED_MODULE_7__.uint8ArrayToString)(uint8Array, 'ascii')}`);\n }\n }\n }, metaAtom.getPayloadLength(0));\n }\n async parseValueAtom(tagKey, metaAtom) {\n const dataAtom = await this.tokenizer.readToken(new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.DataAtom(Number(metaAtom.header.length) - _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.Header.len));\n if (dataAtom.type.set !== 0) {\n throw new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.Mp4ContentError(`Unsupported type-set != 0: ${dataAtom.type.set}`);\n }\n // Use well-known-type table\n // Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW35\n switch (dataAtom.type.type) {\n case 0: // reserved: Reserved for use where no type needs to be indicated\n switch (tagKey) {\n case 'trkn':\n case 'disk': {\n const num = token_types__WEBPACK_IMPORTED_MODULE_1__.UINT8.get(dataAtom.value, 3);\n const of = token_types__WEBPACK_IMPORTED_MODULE_1__.UINT8.get(dataAtom.value, 5);\n // console.log(\" %s[data] = %s/%s\", tagKey, num, of);\n await this.addTag(tagKey, `${num}/${of}`);\n break;\n }\n case 'gnre': {\n const genreInt = token_types__WEBPACK_IMPORTED_MODULE_1__.UINT8.get(dataAtom.value, 1);\n const genreStr = _id3v1_ID3v1Parser_js__WEBPACK_IMPORTED_MODULE_3__.Genres[genreInt - 1];\n // console.log(\" %s[data] = %s\", tagKey, genreStr);\n await this.addTag(tagKey, genreStr);\n break;\n }\n case 'rate': {\n const rate = new TextDecoder('ascii').decode(dataAtom.value);\n await this.addTag(tagKey, rate);\n break;\n }\n default:\n debug(`unknown proprietary value type for: ${metaAtom.atomPath}`);\n }\n break;\n case 1: // UTF-8: Without any count or NULL terminator\n case 18: // Unknown: Found in m4b in combination with a '©gen' tag\n await this.addTag(tagKey, new TextDecoder('utf-8').decode(dataAtom.value));\n break;\n case 13: // JPEG\n if (this.options.skipCovers)\n break;\n await this.addTag(tagKey, {\n format: 'image/jpeg',\n data: Uint8Array.from(dataAtom.value)\n });\n break;\n case 14: // PNG\n if (this.options.skipCovers)\n break;\n await this.addTag(tagKey, {\n format: 'image/png',\n data: Uint8Array.from(dataAtom.value)\n });\n break;\n case 21: // BE Signed Integer\n await this.addTag(tagKey, MP4Parser.read_BE_Integer(dataAtom.value, true));\n break;\n case 22: // BE Unsigned Integer\n await this.addTag(tagKey, MP4Parser.read_BE_Integer(dataAtom.value, false));\n break;\n case 65: // An 8-bit signed integer\n await this.addTag(tagKey, token_types__WEBPACK_IMPORTED_MODULE_1__.UINT8.get(dataAtom.value, 0));\n break;\n case 66: // A big-endian 16-bit signed integer\n await this.addTag(tagKey, token_types__WEBPACK_IMPORTED_MODULE_1__.UINT16_BE.get(dataAtom.value, 0));\n break;\n case 67: // A big-endian 32-bit signed integer\n await this.addTag(tagKey, token_types__WEBPACK_IMPORTED_MODULE_1__.UINT32_BE.get(dataAtom.value, 0));\n break;\n default:\n this.addWarning(`atom key=${tagKey}, has unknown well-known-type (data-type): ${dataAtom.type.type}`);\n }\n }\n /**\n * @param sampleDescription\n * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-128916\n */\n parseSoundSampleDescription(sampleDescription) {\n const ssd = {\n dataFormat: sampleDescription.dataFormat,\n dataReferenceIndex: sampleDescription.dataReferenceIndex\n };\n let offset = 0;\n if (sampleDescription.description) {\n const version = _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.SoundSampleDescriptionVersion.get(sampleDescription.description, offset);\n offset += _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.SoundSampleDescriptionVersion.len;\n if (version.version === 0 || version.version === 1) {\n // Sound Sample Description (Version 0)\n ssd.description = _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.SoundSampleDescriptionV0.get(sampleDescription.description, offset);\n }\n else {\n debug(`Warning: sound-sample-description ${version} not implemented`);\n }\n }\n return ssd;\n }\n async parseChapterTrack(chapterTrack, track, len) {\n if (!chapterTrack.sampleSize) {\n if (chapterTrack.chunkOffsetTable.length !== chapterTrack.sampleSizeTable.length)\n throw new Error('Expected equal chunk-offset-table & sample-size-table length.');\n }\n const chapters = [];\n for (let i = 0; i < chapterTrack.chunkOffsetTable.length && len > 0; ++i) {\n const chunkOffset = chapterTrack.chunkOffsetTable[i];\n const nextChunkLen = chunkOffset - this.tokenizer.position;\n const sampleSize = chapterTrack.sampleSize > 0 ? chapterTrack.sampleSize : chapterTrack.sampleSizeTable[i];\n len -= nextChunkLen + sampleSize;\n if (len < 0)\n throw new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.Mp4ContentError('Chapter chunk exceeding token length');\n await this.tokenizer.ignore(nextChunkLen);\n const title = await this.tokenizer.readToken(new _AtomToken_js__WEBPACK_IMPORTED_MODULE_5__.ChapterText(sampleSize));\n debug(`Chapter ${i + 1}: ${title}`);\n const chapter = {\n title,\n sampleOffset: this.findSampleOffset(track, this.tokenizer.position)\n };\n debug(`Chapter title=${chapter.title}, offset=${chapter.sampleOffset}/${this.tracks[0].duration}`);\n chapters.push(chapter);\n }\n this.metadata.setFormat('chapters', chapters);\n await this.tokenizer.ignore(len);\n }\n findSampleOffset(track, chapterOffset) {\n let totalDuration = 0;\n track.timeToSampleTable.forEach(e => {\n totalDuration += e.count * e.duration;\n });\n debug(`Total duration=${totalDuration}`);\n let chunkIndex = 0;\n while (chunkIndex < track.chunkOffsetTable.length && track.chunkOffsetTable[chunkIndex] < chapterOffset) {\n ++chunkIndex;\n }\n return this.getChunkDuration(chunkIndex + 1, track);\n }\n getChunkDuration(chunkId, track) {\n let ttsi = 0;\n let ttsc = track.timeToSampleTable[ttsi].count;\n let ttsd = track.timeToSampleTable[ttsi].duration;\n let curChunkId = 1;\n let samplesPerChunk = this.getSamplesPerChunk(curChunkId, track.sampleToChunkTable);\n let totalDuration = 0;\n while (curChunkId < chunkId) {\n const nrOfSamples = Math.min(ttsc, samplesPerChunk);\n totalDuration += nrOfSamples * ttsd;\n ttsc -= nrOfSamples;\n samplesPerChunk -= nrOfSamples;\n if (samplesPerChunk === 0) {\n ++curChunkId;\n samplesPerChunk = this.getSamplesPerChunk(curChunkId, track.sampleToChunkTable);\n }\n else {\n ++ttsi;\n ttsc = track.timeToSampleTable[ttsi].count;\n ttsd = track.timeToSampleTable[ttsi].duration;\n }\n }\n return totalDuration;\n }\n getSamplesPerChunk(chunkId, stcTable) {\n for (let i = 0; i < stcTable.length - 1; ++i) {\n if (chunkId >= stcTable[i].firstChunk && chunkId < stcTable[i + 1].firstChunk) {\n return stcTable[i].samplesPerChunk;\n }\n }\n return stcTable[stcTable.length - 1].samplesPerChunk;\n }\n}\n//# sourceMappingURL=MP4Parser.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/mp4/MP4Parser.js?");
30
-
31
- /***/ })
32
-
33
- }]);
@@ -1,47 +0,0 @@
1
- "use strict";
2
- /*
3
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
4
- * This devtool is neither made for production nor for readable output files.
5
- * It uses "eval()" calls to create a separate source file in the browser devtools.
6
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
7
- * or disable the default devtool with "devtool: false".
8
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
9
- */
10
- (this["webpackChunkExamBundle"] = this["webpackChunkExamBundle"] || []).push([["vendors-node_modules_music-metadata_lib_mpeg_MpegParser_js"],{
11
-
12
- /***/ "../../node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js":
13
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14
-
15
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AbstractID3Parser: () => (/* binding */ AbstractID3Parser)\n/* harmony export */ });\n/* harmony import */ var strtok3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/strtok3/lib/core.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var _ID3v2Token_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/id3v2/ID3v2Token.js\");\n/* harmony import */ var _ID3v2Parser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\"../../node_modules/music-metadata/lib/id3v2/ID3v2Parser.js\");\n/* harmony import */ var _id3v1_ID3v1Parser_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\"../../node_modules/music-metadata/lib/id3v1/ID3v1Parser.js\");\n/* harmony import */ var _common_BasicParser_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/BasicParser.js\");\n\n\n\n\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_1__('music-metadata:parser:ID3');\n/**\n * Abstract parser which tries take ID3v2 and ID3v1 headers.\n */\nclass AbstractID3Parser extends _common_BasicParser_js__WEBPACK_IMPORTED_MODULE_5__.BasicParser {\n constructor() {\n super(...arguments);\n this.id3parser = new _ID3v2Parser_js__WEBPACK_IMPORTED_MODULE_3__.ID3v2Parser();\n }\n static async startsWithID3v2Header(tokenizer) {\n return (await tokenizer.peekToken(_ID3v2Token_js__WEBPACK_IMPORTED_MODULE_2__.ID3v2Header)).fileIdentifier === 'ID3';\n }\n async parse() {\n try {\n await this.parseID3v2();\n }\n catch (err) {\n if (err instanceof strtok3__WEBPACK_IMPORTED_MODULE_0__.EndOfStreamError) {\n debug(\"End-of-stream\");\n }\n else {\n throw err;\n }\n }\n }\n finalize() {\n return;\n }\n async parseID3v2() {\n await this.tryReadId3v2Headers();\n debug('End of ID3v2 header, go to MPEG-parser: pos=%s', this.tokenizer.position);\n await this.postId3v2Parse();\n if (this.options.skipPostHeaders && this.metadata.hasAny()) {\n this.finalize();\n }\n else {\n const id3v1parser = new _id3v1_ID3v1Parser_js__WEBPACK_IMPORTED_MODULE_4__.ID3v1Parser(this.metadata, this.tokenizer, this.options);\n await id3v1parser.parse();\n this.finalize();\n }\n }\n async tryReadId3v2Headers() {\n const id3Header = await this.tokenizer.peekToken(_ID3v2Token_js__WEBPACK_IMPORTED_MODULE_2__.ID3v2Header);\n if (id3Header.fileIdentifier === 'ID3') {\n debug('Found ID3v2 header, pos=%s', this.tokenizer.position);\n await this.id3parser.parse(this.metadata, this.tokenizer, this.options);\n return this.tryReadId3v2Headers();\n }\n }\n}\n//# sourceMappingURL=AbstractID3Parser.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js?");
16
-
17
- /***/ }),
18
-
19
- /***/ "../../node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.js":
20
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
21
-
22
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExtendedLameHeader: () => (/* binding */ ExtendedLameHeader)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var _common_Util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/Util.js\");\n/* harmony import */ var _ReplayGainDataFormat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.js\");\n/**\n * Extended Lame Header\n */\n\n\n\n/**\n * Info Tag\n * @link http://gabriel.mp3-tech.org/mp3infotag.html\n * @link https://github.com/quodlibet/mutagen/blob/abd58ee58772224334a18817c3fb31103572f70e/mutagen/mp3/_util.py#L112\n */\nconst ExtendedLameHeader = {\n len: 27,\n get: (buf, off) => {\n const track_peak = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 2);\n return {\n revision: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.getBitAllignedNumber(buf, off, 0, 4),\n vbr_method: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.getBitAllignedNumber(buf, off, 4, 4),\n lowpass_filter: 100 * token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 1),\n track_peak: track_peak === 0 ? null : track_peak / 2 ** 23,\n track_gain: _ReplayGainDataFormat_js__WEBPACK_IMPORTED_MODULE_2__.ReplayGain.get(buf, 6),\n album_gain: _ReplayGainDataFormat_js__WEBPACK_IMPORTED_MODULE_2__.ReplayGain.get(buf, 8),\n music_length: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buf, off + 20),\n music_crc: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 24),\n header_crc: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_BE.get(buf, off + 24)\n };\n }\n};\n//# sourceMappingURL=ExtendedLameHeader.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.js?");
23
-
24
- /***/ }),
25
-
26
- /***/ "../../node_modules/music-metadata/lib/mpeg/MpegParser.js":
27
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
28
-
29
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MpegContentError: () => (/* binding */ MpegContentError),\n/* harmony export */ MpegParser: () => (/* binding */ MpegParser)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var strtok3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/strtok3/lib/core.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var _common_Util_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/Util.js\");\n/* harmony import */ var _id3v2_AbstractID3Parser_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\"../../node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js\");\n/* harmony import */ var _XingTag_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\"../../node_modules/music-metadata/lib/mpeg/XingTag.js\");\n/* harmony import */ var _ParseError_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ParseError.js\");\n\n\n\n\n\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_2__('music-metadata:parser:mpeg');\nclass MpegContentError extends (0,_ParseError_js__WEBPACK_IMPORTED_MODULE_6__.makeUnexpectedFileContentError)('MPEG') {\n}\n/**\n * Cache buffer size used for searching synchronization preabmle\n */\nconst maxPeekLen = 1024;\n/**\n * MPEG-4 Audio definitions\n * Ref: https://wiki.multimedia.cx/index.php/MPEG-4_Audio\n */\nconst MPEG4 = {\n /**\n * Audio Object Types\n */\n AudioObjectTypes: [\n 'AAC Main',\n 'AAC LC', // Low Complexity\n 'AAC SSR', // Scalable Sample Rate\n 'AAC LTP' // Long Term Prediction\n ],\n /**\n * Sampling Frequencies\n * https://wiki.multimedia.cx/index.php/MPEG-4_Audio#Sampling_Frequencies\n */\n SamplingFrequencies: [\n 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350, null, null, -1\n ]\n /**\n * Channel Configurations\n */\n};\nconst MPEG4_ChannelConfigurations = [\n undefined,\n ['front-center'],\n ['front-left', 'front-right'],\n ['front-center', 'front-left', 'front-right'],\n ['front-center', 'front-left', 'front-right', 'back-center'],\n ['front-center', 'front-left', 'front-right', 'back-left', 'back-right'],\n ['front-center', 'front-left', 'front-right', 'back-left', 'back-right', 'LFE-channel'],\n ['front-center', 'front-left', 'front-right', 'side-left', 'side-right', 'back-left', 'back-right', 'LFE-channel']\n];\n/**\n * MPEG Audio Layer I/II/III frame header\n * Ref: https://www.mp3-tech.org/programmer/frame_header.html\n * Bit layout: AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM\n * Ref: https://wiki.multimedia.cx/index.php/ADTS\n */\nclass MpegFrameHeader {\n constructor(buf, off) {\n // E(15,12): Bitrate index\n this.bitrateIndex = null;\n // F(11,10): Sampling rate frequency index\n this.sampRateFreqIndex = null;\n // G(9): Padding bit\n this.padding = null;\n // H(8): Private bit\n this.privateBit = null;\n // I(7,6): Channel Mode\n this.channelModeIndex = null;\n // J(5,4): Mode extension (Only used in Joint stereo)\n this.modeExtension = null;\n // L(2): Original\n this.isOriginalMedia = null;\n this.version = null;\n this.bitrate = null;\n this.samplingRate = null;\n this.frameLength = 0;\n // B(20,19): MPEG Audio versionIndex ID\n this.versionIndex = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBitAllignedNumber(buf, off + 1, 3, 2);\n // C(18,17): Layer description\n this.layer = MpegFrameHeader.LayerDescription[_common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBitAllignedNumber(buf, off + 1, 5, 2)];\n if (this.versionIndex > 1 && this.layer === 0) {\n this.parseAdtsHeader(buf, off); // Audio Data Transport Stream (ADTS)\n }\n else {\n this.parseMpegHeader(buf, off); // Conventional MPEG header\n }\n // D(16): Protection bit (if true 16-bit CRC follows header)\n this.isProtectedByCRC = !_common_Util_js__WEBPACK_IMPORTED_MODULE_3__.isBitSet(buf, off + 1, 7);\n }\n calcDuration(numFrames) {\n return this.samplingRate == null ? null : (numFrames * this.calcSamplesPerFrame() / this.samplingRate);\n }\n calcSamplesPerFrame() {\n return MpegFrameHeader.samplesInFrameTable[this.version === 1 ? 0 : 1][this.layer];\n }\n calculateSideInfoLength() {\n if (this.layer !== 3)\n return 2;\n if (this.channelModeIndex === 3) {\n // mono\n if (this.version === 1) {\n return 17;\n }\n if (this.version === 2 || this.version === 2.5) {\n return 9;\n }\n }\n else {\n if (this.version === 1) {\n return 32;\n }\n if (this.version === 2 || this.version === 2.5) {\n return 17;\n }\n }\n return null;\n }\n calcSlotSize() {\n return [null, 4, 1, 1][this.layer];\n }\n parseMpegHeader(buf, off) {\n this.container = 'MPEG';\n // E(15,12): Bitrate index\n this.bitrateIndex = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBitAllignedNumber(buf, off + 2, 0, 4);\n // F(11,10): Sampling rate frequency index\n this.sampRateFreqIndex = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBitAllignedNumber(buf, off + 2, 4, 2);\n // G(9): Padding bit\n this.padding = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.isBitSet(buf, off + 2, 6);\n // H(8): Private bit\n this.privateBit = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.isBitSet(buf, off + 2, 7);\n // I(7,6): Channel Mode\n this.channelModeIndex = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBitAllignedNumber(buf, off + 3, 0, 2);\n // J(5,4): Mode extension (Only used in Joint stereo)\n this.modeExtension = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBitAllignedNumber(buf, off + 3, 2, 2);\n // K(3): Copyright\n this.isCopyrighted = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.isBitSet(buf, off + 3, 4);\n // L(2): Original\n this.isOriginalMedia = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.isBitSet(buf, off + 3, 5);\n // M(3): The original bit indicates, if it is set, that the frame is located on its original media.\n this.emphasis = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBitAllignedNumber(buf, off + 3, 7, 2);\n this.version = MpegFrameHeader.VersionID[this.versionIndex];\n this.channelMode = MpegFrameHeader.ChannelMode[this.channelModeIndex];\n this.codec = `MPEG ${this.version} Layer ${this.layer}`;\n // Calculate bitrate\n const bitrateInKbps = this.calcBitrate();\n if (!bitrateInKbps) {\n throw new MpegContentError('Cannot determine bit-rate');\n }\n this.bitrate = bitrateInKbps * 1000;\n // Calculate sampling rate\n this.samplingRate = this.calcSamplingRate();\n if (this.samplingRate == null) {\n throw new MpegContentError('Cannot determine sampling-rate');\n }\n }\n parseAdtsHeader(buf, off) {\n debug(\"layer=0 => ADTS\");\n this.version = this.versionIndex === 2 ? 4 : 2;\n this.container = `ADTS/MPEG-${this.version}`;\n const profileIndex = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBitAllignedNumber(buf, off + 2, 0, 2);\n this.codec = 'AAC';\n this.codecProfile = MPEG4.AudioObjectTypes[profileIndex];\n debug(`MPEG-4 audio-codec=${this.codec}`);\n const samplingFrequencyIndex = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBitAllignedNumber(buf, off + 2, 2, 4);\n this.samplingRate = MPEG4.SamplingFrequencies[samplingFrequencyIndex];\n debug(`sampling-rate=${this.samplingRate}`);\n const channelIndex = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBitAllignedNumber(buf, off + 2, 7, 3);\n this.mp4ChannelConfig = MPEG4_ChannelConfigurations[channelIndex];\n debug(`channel-config=${this.mp4ChannelConfig ? this.mp4ChannelConfig.join('+') : '?'}`);\n this.frameLength = _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBitAllignedNumber(buf, off + 3, 6, 2) << 11;\n }\n calcBitrate() {\n if (this.bitrateIndex === 0x00 || // free\n this.bitrateIndex === 0x0F) { // reserved\n return null;\n }\n if (this.version && this.bitrateIndex) {\n const codecIndex = 10 * Math.floor(this.version) + this.layer;\n return MpegFrameHeader.bitrate_index[this.bitrateIndex][codecIndex];\n }\n return null;\n }\n calcSamplingRate() {\n if (this.sampRateFreqIndex === 0x03 || this.version === null || this.sampRateFreqIndex == null)\n return null; // 'reserved'\n return MpegFrameHeader.sampling_rate_freq_index[this.version][this.sampRateFreqIndex];\n }\n}\nMpegFrameHeader.SyncByte1 = 0xFF;\nMpegFrameHeader.SyncByte2 = 0xE0;\nMpegFrameHeader.VersionID = [2.5, null, 2, 1];\nMpegFrameHeader.LayerDescription = [0, 3, 2, 1];\nMpegFrameHeader.ChannelMode = ['stereo', 'joint_stereo', 'dual_channel', 'mono'];\nMpegFrameHeader.bitrate_index = {\n 1: { 11: 32, 12: 32, 13: 32, 21: 32, 22: 8, 23: 8 },\n 2: { 11: 64, 12: 48, 13: 40, 21: 48, 22: 16, 23: 16 },\n 3: { 11: 96, 12: 56, 13: 48, 21: 56, 22: 24, 23: 24 },\n 4: { 11: 128, 12: 64, 13: 56, 21: 64, 22: 32, 23: 32 },\n 5: { 11: 160, 12: 80, 13: 64, 21: 80, 22: 40, 23: 40 },\n 6: { 11: 192, 12: 96, 13: 80, 21: 96, 22: 48, 23: 48 },\n 7: { 11: 224, 12: 112, 13: 96, 21: 112, 22: 56, 23: 56 },\n 8: { 11: 256, 12: 128, 13: 112, 21: 128, 22: 64, 23: 64 },\n 9: { 11: 288, 12: 160, 13: 128, 21: 144, 22: 80, 23: 80 },\n 10: { 11: 320, 12: 192, 13: 160, 21: 160, 22: 96, 23: 96 },\n 11: { 11: 352, 12: 224, 13: 192, 21: 176, 22: 112, 23: 112 },\n 12: { 11: 384, 12: 256, 13: 224, 21: 192, 22: 128, 23: 128 },\n 13: { 11: 416, 12: 320, 13: 256, 21: 224, 22: 144, 23: 144 },\n 14: { 11: 448, 12: 384, 13: 320, 21: 256, 22: 160, 23: 160 }\n};\nMpegFrameHeader.sampling_rate_freq_index = {\n 1: { 0: 44100, 1: 48000, 2: 32000 },\n 2: { 0: 22050, 1: 24000, 2: 16000 },\n 2.5: { 0: 11025, 1: 12000, 2: 8000 }\n};\nMpegFrameHeader.samplesInFrameTable = [\n /* Layer I II III */\n [0, 384, 1152, 1152], // MPEG-1\n [0, 384, 1152, 576] // MPEG-2(.5\n];\n/**\n * MPEG Audio Layer I/II/III\n */\nconst FrameHeader = {\n len: 4,\n get: (buf, off) => {\n return new MpegFrameHeader(buf, off);\n }\n};\nfunction getVbrCodecProfile(vbrScale) {\n return `V${Math.floor((100 - vbrScale) / 10)}`;\n}\nclass MpegParser extends _id3v2_AbstractID3Parser_js__WEBPACK_IMPORTED_MODULE_4__.AbstractID3Parser {\n constructor() {\n super(...arguments);\n this.frameCount = 0;\n this.syncFrameCount = -1;\n this.countSkipFrameData = 0;\n this.totalDataLength = 0;\n this.bitrates = [];\n this.offset = 0;\n this.frame_size = 0;\n this.crc = null;\n this.calculateEofDuration = false;\n this.samplesPerFrame = null;\n this.buf_frame_header = new Uint8Array(4);\n /**\n * Number of bytes already parsed since beginning of stream / file\n */\n this.mpegOffset = null;\n this.syncPeek = {\n buf: new Uint8Array(maxPeekLen),\n len: 0\n };\n }\n /**\n * Called after ID3 headers have been parsed\n */\n async postId3v2Parse() {\n this.metadata.setFormat('lossless', false);\n try {\n let quit = false;\n while (!quit) {\n await this.sync();\n quit = await this.parseCommonMpegHeader();\n }\n }\n catch (err) {\n if (err instanceof strtok3__WEBPACK_IMPORTED_MODULE_1__.EndOfStreamError) {\n debug(\"End-of-stream\");\n if (this.calculateEofDuration) {\n if (this.samplesPerFrame !== null) {\n const numberOfSamples = this.frameCount * this.samplesPerFrame;\n this.metadata.setFormat('numberOfSamples', numberOfSamples);\n if (this.metadata.format.sampleRate) {\n const duration = numberOfSamples / this.metadata.format.sampleRate;\n debug(`Calculate duration at EOF: ${duration} sec.`, duration);\n this.metadata.setFormat('duration', duration);\n }\n }\n }\n }\n else {\n throw err;\n }\n }\n }\n /**\n * Called after file has been fully parsed, this allows, if present, to exclude the ID3v1.1 header length\n */\n finalize() {\n const format = this.metadata.format;\n const hasID3v1 = !!this.metadata.native.ID3v1;\n if (this.mpegOffset !== null) {\n if (format.duration && this.tokenizer.fileInfo.size) {\n const mpegSize = this.tokenizer.fileInfo.size - this.mpegOffset - (hasID3v1 ? 128 : 0);\n if (format.codecProfile && format.codecProfile[0] === 'V') {\n this.metadata.setFormat('bitrate', mpegSize * 8 / format.duration);\n }\n }\n if (this.tokenizer.fileInfo.size && format.codecProfile === 'CBR') {\n const mpegSize = this.tokenizer.fileInfo.size - this.mpegOffset - (hasID3v1 ? 128 : 0);\n if (this.frame_size !== null && this.samplesPerFrame !== null) {\n const numberOfSamples = Math.round(mpegSize / this.frame_size) * this.samplesPerFrame;\n this.metadata.setFormat('numberOfSamples', numberOfSamples);\n if (format.sampleRate && !format.duration) {\n const duration = numberOfSamples / format.sampleRate;\n debug(\"Calculate CBR duration based on file size: %s\", duration);\n this.metadata.setFormat('duration', duration);\n }\n }\n }\n }\n }\n async sync() {\n let gotFirstSync = false;\n while (true) {\n let bo = 0;\n this.syncPeek.len = await this.tokenizer.peekBuffer(this.syncPeek.buf, { length: maxPeekLen, mayBeLess: true });\n if (this.syncPeek.len <= 163) {\n throw new strtok3__WEBPACK_IMPORTED_MODULE_1__.EndOfStreamError();\n }\n while (true) {\n if (gotFirstSync && (this.syncPeek.buf[bo] & 0xE0) === 0xE0) {\n this.buf_frame_header[0] = MpegFrameHeader.SyncByte1;\n this.buf_frame_header[1] = this.syncPeek.buf[bo];\n await this.tokenizer.ignore(bo);\n debug(`Sync at offset=${this.tokenizer.position - 1}, frameCount=${this.frameCount}`);\n if (this.syncFrameCount === this.frameCount) {\n debug(`Re-synced MPEG stream, frameCount=${this.frameCount}`);\n this.frameCount = 0;\n this.frame_size = 0;\n }\n this.syncFrameCount = this.frameCount;\n return; // sync\n }\n gotFirstSync = false;\n bo = this.syncPeek.buf.indexOf(MpegFrameHeader.SyncByte1, bo);\n if (bo === -1) {\n if (this.syncPeek.len < this.syncPeek.buf.length) {\n throw new strtok3__WEBPACK_IMPORTED_MODULE_1__.EndOfStreamError();\n }\n await this.tokenizer.ignore(this.syncPeek.len);\n break; // continue with next buffer\n }\n ++bo;\n gotFirstSync = true;\n }\n }\n }\n /**\n * Combined ADTS & MPEG (MP2 & MP3) header handling\n * @return {Promise<boolean>} true if parser should quit\n */\n async parseCommonMpegHeader() {\n if (this.frameCount === 0) {\n this.mpegOffset = this.tokenizer.position - 1;\n }\n await this.tokenizer.peekBuffer(this.buf_frame_header.subarray(1), { length: 3 });\n let header;\n try {\n header = FrameHeader.get(this.buf_frame_header, 0);\n }\n catch (err) {\n await this.tokenizer.ignore(1);\n if (err instanceof Error) {\n this.metadata.addWarning(`Parse error: ${err.message}`);\n return false; // sync\n }\n throw err;\n }\n await this.tokenizer.ignore(3);\n this.metadata.setFormat('container', header.container);\n this.metadata.setFormat('codec', header.codec);\n this.metadata.setFormat('lossless', false);\n this.metadata.setFormat('sampleRate', header.samplingRate);\n this.frameCount++;\n return header.version !== null && header.version >= 2 && header.layer === 0 ? this.parseAdts(header) : this.parseAudioFrameHeader(header);\n }\n /**\n * @return {Promise<boolean>} true if parser should quit\n */\n async parseAudioFrameHeader(header) {\n this.metadata.setFormat('numberOfChannels', header.channelMode === 'mono' ? 1 : 2);\n this.metadata.setFormat('bitrate', header.bitrate);\n if (this.frameCount < 20 * 10000) {\n debug('offset=%s MP%s bitrate=%s sample-rate=%s', this.tokenizer.position - 4, header.layer, header.bitrate, header.samplingRate);\n }\n const slot_size = header.calcSlotSize();\n if (slot_size === null) {\n throw new MpegContentError('invalid slot_size');\n }\n const samples_per_frame = header.calcSamplesPerFrame();\n debug(`samples_per_frame=${samples_per_frame}`);\n const bps = samples_per_frame / 8.0;\n if (header.bitrate !== null && header.samplingRate != null) {\n const fsize = (bps * header.bitrate / header.samplingRate) + ((header.padding) ? slot_size : 0);\n this.frame_size = Math.floor(fsize);\n }\n this.audioFrameHeader = header;\n if (header.bitrate !== null) {\n this.bitrates.push(header.bitrate);\n }\n // xtra header only exists in first frame\n if (this.frameCount === 1) {\n this.offset = FrameHeader.len;\n await this.skipSideInformation();\n return false;\n }\n if (this.frameCount === 3) {\n // the stream is CBR if the first 3 frame bitrates are the same\n if (this.areAllSame(this.bitrates)) {\n // Actual calculation will be done in finalize\n this.samplesPerFrame = samples_per_frame;\n this.metadata.setFormat('codecProfile', 'CBR');\n if (this.tokenizer.fileInfo.size)\n return true; // Will calculate duration based on the file size\n }\n else if (this.metadata.format.duration) {\n return true; // We already got the duration, stop processing MPEG stream any further\n }\n if (!this.options.duration) {\n return true; // Enforce duration not enabled, stop processing entire stream\n }\n }\n // once we know the file is VBR attach listener to end of\n // stream so we can do the duration calculation when we\n // have counted all the frames\n if (this.options.duration && this.frameCount === 4) {\n this.samplesPerFrame = samples_per_frame;\n this.calculateEofDuration = true;\n }\n this.offset = 4;\n if (header.isProtectedByCRC) {\n await this.parseCrc();\n return false;\n }\n await this.skipSideInformation();\n return false;\n }\n async parseAdts(header) {\n const buf = new Uint8Array(3);\n await this.tokenizer.readBuffer(buf);\n header.frameLength += _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBitAllignedNumber(buf, 0, 0, 11);\n this.totalDataLength += header.frameLength;\n this.samplesPerFrame = 1024;\n if (header.samplingRate !== null) {\n const framesPerSec = header.samplingRate / this.samplesPerFrame;\n const bytesPerFrame = this.frameCount === 0 ? 0 : this.totalDataLength / this.frameCount;\n const bitrate = 8 * bytesPerFrame * framesPerSec + 0.5;\n this.metadata.setFormat('bitrate', bitrate);\n debug(`frame-count=${this.frameCount}, size=${header.frameLength} bytes, bit-rate=${bitrate}`);\n }\n await this.tokenizer.ignore(header.frameLength > 7 ? header.frameLength - 7 : 1);\n // Consume remaining header and frame data\n if (this.frameCount === 3) {\n this.metadata.setFormat('codecProfile', header.codecProfile);\n if (header.mp4ChannelConfig) {\n this.metadata.setFormat('numberOfChannels', header.mp4ChannelConfig.length);\n }\n if (this.options.duration) {\n this.calculateEofDuration = true;\n }\n else {\n return true; // Stop parsing after the third frame\n }\n }\n return false;\n }\n async parseCrc() {\n this.crc = await this.tokenizer.readNumber(token_types__WEBPACK_IMPORTED_MODULE_0__.INT16_BE);\n this.offset += 2;\n return this.skipSideInformation();\n }\n async skipSideInformation() {\n if (this.audioFrameHeader) {\n const sideinfo_length = this.audioFrameHeader.calculateSideInfoLength();\n if (sideinfo_length !== null) {\n await this.tokenizer.readToken(new token_types__WEBPACK_IMPORTED_MODULE_0__.Uint8ArrayType(sideinfo_length));\n // side information\n this.offset += sideinfo_length;\n await this.readXtraInfoHeader();\n return;\n }\n }\n }\n async readXtraInfoHeader() {\n const headerTag = await this.tokenizer.readToken(_XingTag_js__WEBPACK_IMPORTED_MODULE_5__.InfoTagHeaderTag);\n this.offset += _XingTag_js__WEBPACK_IMPORTED_MODULE_5__.InfoTagHeaderTag.len; // 12\n switch (headerTag) {\n case 'Info':\n this.metadata.setFormat('codecProfile', 'CBR');\n return this.readXingInfoHeader();\n case 'Xing': {\n const infoTag = await this.readXingInfoHeader();\n if (infoTag.vbrScale !== null) {\n const codecProfile = getVbrCodecProfile(infoTag.vbrScale);\n this.metadata.setFormat('codecProfile', codecProfile);\n }\n return null;\n }\n case 'Xtra':\n // ToDo: ???\n break;\n case 'LAME': {\n const version = await this.tokenizer.readToken(_XingTag_js__WEBPACK_IMPORTED_MODULE_5__.LameEncoderVersion);\n if (this.frame_size !== null && this.frame_size >= this.offset + _XingTag_js__WEBPACK_IMPORTED_MODULE_5__.LameEncoderVersion.len) {\n this.offset += _XingTag_js__WEBPACK_IMPORTED_MODULE_5__.LameEncoderVersion.len;\n this.metadata.setFormat('tool', `LAME ${version}`);\n await this.skipFrameData(this.frame_size - this.offset);\n return null;\n }\n this.metadata.addWarning('Corrupt LAME header');\n break;\n }\n // ToDo: ???\n }\n // ToDo: promise duration???\n const frameDataLeft = this.frame_size - this.offset;\n if (frameDataLeft < 0) {\n this.metadata.addWarning(`Frame ${this.frameCount}corrupt: negative frameDataLeft`);\n }\n else {\n await this.skipFrameData(frameDataLeft);\n }\n return null;\n }\n /**\n * Ref: http://gabriel.mp3-tech.org/mp3infotag.html\n * @returns {Promise<string>}\n */\n async readXingInfoHeader() {\n const offset = this.tokenizer.position;\n const infoTag = await (0,_XingTag_js__WEBPACK_IMPORTED_MODULE_5__.readXingHeader)(this.tokenizer);\n this.offset += this.tokenizer.position - offset;\n if (infoTag.lame) {\n this.metadata.setFormat('tool', `LAME ${_common_Util_js__WEBPACK_IMPORTED_MODULE_3__.stripNulls(infoTag.lame.version)}`);\n if (infoTag.lame.extended) {\n // this.metadata.setFormat('trackGain', infoTag.lame.extended.track_gain);\n this.metadata.setFormat('trackPeakLevel', infoTag.lame.extended.track_peak);\n if (infoTag.lame.extended.track_gain) {\n this.metadata.setFormat('trackGain', infoTag.lame.extended.track_gain.adjustment);\n }\n if (infoTag.lame.extended.album_gain) {\n this.metadata.setFormat('albumGain', infoTag.lame.extended.album_gain.adjustment);\n }\n this.metadata.setFormat('duration', infoTag.lame.extended.music_length / 1000);\n }\n }\n if (infoTag.streamSize && this.audioFrameHeader && infoTag.numFrames !== null) {\n const duration = this.audioFrameHeader.calcDuration(infoTag.numFrames);\n this.metadata.setFormat('duration', duration);\n debug('Get duration from Xing header: %s', this.metadata.format.duration);\n return infoTag;\n }\n // frames field is not present\n const frameDataLeft = this.frame_size - this.offset;\n await this.skipFrameData(frameDataLeft);\n return infoTag;\n }\n async skipFrameData(frameDataLeft) {\n if (frameDataLeft < 0)\n throw new MpegContentError('frame-data-left cannot be negative');\n await this.tokenizer.ignore(frameDataLeft);\n this.countSkipFrameData += frameDataLeft;\n }\n areAllSame(array) {\n const first = array[0];\n return array.every(element => {\n return element === first;\n });\n }\n}\n//# sourceMappingURL=MpegParser.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/mpeg/MpegParser.js?");
30
-
31
- /***/ }),
32
-
33
- /***/ "../../node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.js":
34
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35
-
36
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ReplayGain: () => (/* binding */ ReplayGain)\n/* harmony export */ });\n/* harmony import */ var _common_Util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/Util.js\");\n\n/**\n * https://github.com/Borewit/music-metadata/wiki/Replay-Gain-Data-Format#name-code\n */\nvar NameCode;\n(function (NameCode) {\n /**\n * not set\n */\n NameCode[NameCode[\"not_set\"] = 0] = \"not_set\";\n /**\n * Radio Gain Adjustment\n */\n NameCode[NameCode[\"radio\"] = 1] = \"radio\";\n /**\n * Audiophile Gain Adjustment\n */\n NameCode[NameCode[\"audiophile\"] = 2] = \"audiophile\";\n})(NameCode || (NameCode = {}));\n/**\n * https://github.com/Borewit/music-metadata/wiki/Replay-Gain-Data-Format#originator-code\n */\nvar ReplayGainOriginator;\n(function (ReplayGainOriginator) {\n /**\n * Replay Gain unspecified\n */\n ReplayGainOriginator[ReplayGainOriginator[\"unspecified\"] = 0] = \"unspecified\";\n /**\n * Replay Gain pre-set by artist/producer/mastering engineer\n */\n ReplayGainOriginator[ReplayGainOriginator[\"engineer\"] = 1] = \"engineer\";\n /**\n * Replay Gain set by user\n */\n ReplayGainOriginator[ReplayGainOriginator[\"user\"] = 2] = \"user\";\n /**\n * Replay Gain determined automatically, as described on this site\n */\n ReplayGainOriginator[ReplayGainOriginator[\"automatic\"] = 3] = \"automatic\";\n /**\n * Set by simple RMS average\n */\n ReplayGainOriginator[ReplayGainOriginator[\"rms_average\"] = 4] = \"rms_average\";\n})(ReplayGainOriginator || (ReplayGainOriginator = {}));\n/**\n * Replay Gain Data Format\n *\n * https://github.com/Borewit/music-metadata/wiki/Replay-Gain-Data-Format\n */\nconst ReplayGain = {\n len: 2,\n get: (buf, off) => {\n const gain_type = _common_Util_js__WEBPACK_IMPORTED_MODULE_0__.getBitAllignedNumber(buf, off, 0, 3);\n const sign = _common_Util_js__WEBPACK_IMPORTED_MODULE_0__.getBitAllignedNumber(buf, off, 6, 1);\n const gain_adj = _common_Util_js__WEBPACK_IMPORTED_MODULE_0__.getBitAllignedNumber(buf, off, 7, 9) / 10.0;\n if (gain_type > 0) {\n return {\n type: _common_Util_js__WEBPACK_IMPORTED_MODULE_0__.getBitAllignedNumber(buf, off, 0, 3),\n origin: _common_Util_js__WEBPACK_IMPORTED_MODULE_0__.getBitAllignedNumber(buf, off, 3, 3),\n adjustment: (sign ? -gain_adj : gain_adj)\n };\n }\n return undefined;\n }\n};\n//# sourceMappingURL=ReplayGainDataFormat.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.js?");
37
-
38
- /***/ }),
39
-
40
- /***/ "../../node_modules/music-metadata/lib/mpeg/XingTag.js":
41
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
42
-
43
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ InfoTagHeaderTag: () => (/* binding */ InfoTagHeaderTag),\n/* harmony export */ LameEncoderVersion: () => (/* binding */ LameEncoderVersion),\n/* harmony export */ XingHeaderFlags: () => (/* binding */ XingHeaderFlags),\n/* harmony export */ readXingHeader: () => (/* binding */ readXingHeader)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var _common_Util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/Util.js\");\n/* harmony import */ var _ExtendedLameHeader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.js\");\n\n\n\n/**\n * Info Tag: Xing, LAME\n */\nconst InfoTagHeaderTag = new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(4, 'ascii');\n/**\n * LAME TAG value\n * Did not find any official documentation for this\n * Value e.g.: \"3.98.4\"\n */\nconst LameEncoderVersion = new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(6, 'ascii');\n/**\n * Info Tag\n * Ref: http://gabriel.mp3-tech.org/mp3infotag.html\n */\nconst XingHeaderFlags = {\n len: 4,\n get: (buf, off) => {\n return {\n frames: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.isBitSet(buf, off, 31),\n bytes: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.isBitSet(buf, off, 30),\n toc: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.isBitSet(buf, off, 29),\n vbrScale: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.isBitSet(buf, off, 28)\n };\n }\n};\n// /**\n// * XING Header Tag\n// * Ref: http://gabriel.mp3-tech.org/mp3infotag.html\n// */\nasync function readXingHeader(tokenizer) {\n const flags = await tokenizer.readToken(XingHeaderFlags);\n const xingInfoTag = { numFrames: null, streamSize: null, vbrScale: null };\n if (flags.frames) {\n xingInfoTag.numFrames = await tokenizer.readToken(token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE);\n }\n if (flags.bytes) {\n xingInfoTag.streamSize = await tokenizer.readToken(token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE);\n }\n if (flags.toc) {\n xingInfoTag.toc = new Uint8Array(100);\n await tokenizer.readBuffer(xingInfoTag.toc);\n }\n if (flags.vbrScale) {\n xingInfoTag.vbrScale = await tokenizer.readToken(token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE);\n }\n const lameTag = await tokenizer.peekToken(new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(4, 'ascii'));\n if (lameTag === 'LAME') {\n await tokenizer.ignore(4);\n xingInfoTag.lame = {\n version: await tokenizer.readToken(new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(5, 'ascii'))\n };\n const match = xingInfoTag.lame.version.match(/\\d+.\\d+/g);\n if (match !== null) {\n const majorMinorVersion = match[0]; // e.g. 3.97\n const version = majorMinorVersion.split('.').map(n => Number.parseInt(n, 10));\n if (version[0] >= 3 && version[1] >= 90) {\n xingInfoTag.lame.extended = await tokenizer.readToken(_ExtendedLameHeader_js__WEBPACK_IMPORTED_MODULE_2__.ExtendedLameHeader);\n }\n }\n }\n return xingInfoTag;\n}\n//# sourceMappingURL=XingTag.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/mpeg/XingTag.js?");
44
-
45
- /***/ })
46
-
47
- }]);
@@ -1,68 +0,0 @@
1
- "use strict";
2
- /*
3
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
4
- * This devtool is neither made for production nor for readable output files.
5
- * It uses "eval()" calls to create a separate source file in the browser devtools.
6
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
7
- * or disable the default devtool with "devtool: false".
8
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
9
- */
10
- (this["webpackChunkExamBundle"] = this["webpackChunkExamBundle"] || []).push([["vendors-node_modules_music-metadata_lib_musepack_MusepackParser_js"],{
11
-
12
- /***/ "../../node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js":
13
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14
-
15
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AbstractID3Parser: () => (/* binding */ AbstractID3Parser)\n/* harmony export */ });\n/* harmony import */ var strtok3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/strtok3/lib/core.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var _ID3v2Token_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/id3v2/ID3v2Token.js\");\n/* harmony import */ var _ID3v2Parser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\"../../node_modules/music-metadata/lib/id3v2/ID3v2Parser.js\");\n/* harmony import */ var _id3v1_ID3v1Parser_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\"../../node_modules/music-metadata/lib/id3v1/ID3v1Parser.js\");\n/* harmony import */ var _common_BasicParser_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/BasicParser.js\");\n\n\n\n\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_1__('music-metadata:parser:ID3');\n/**\n * Abstract parser which tries take ID3v2 and ID3v1 headers.\n */\nclass AbstractID3Parser extends _common_BasicParser_js__WEBPACK_IMPORTED_MODULE_5__.BasicParser {\n constructor() {\n super(...arguments);\n this.id3parser = new _ID3v2Parser_js__WEBPACK_IMPORTED_MODULE_3__.ID3v2Parser();\n }\n static async startsWithID3v2Header(tokenizer) {\n return (await tokenizer.peekToken(_ID3v2Token_js__WEBPACK_IMPORTED_MODULE_2__.ID3v2Header)).fileIdentifier === 'ID3';\n }\n async parse() {\n try {\n await this.parseID3v2();\n }\n catch (err) {\n if (err instanceof strtok3__WEBPACK_IMPORTED_MODULE_0__.EndOfStreamError) {\n debug(\"End-of-stream\");\n }\n else {\n throw err;\n }\n }\n }\n finalize() {\n return;\n }\n async parseID3v2() {\n await this.tryReadId3v2Headers();\n debug('End of ID3v2 header, go to MPEG-parser: pos=%s', this.tokenizer.position);\n await this.postId3v2Parse();\n if (this.options.skipPostHeaders && this.metadata.hasAny()) {\n this.finalize();\n }\n else {\n const id3v1parser = new _id3v1_ID3v1Parser_js__WEBPACK_IMPORTED_MODULE_4__.ID3v1Parser(this.metadata, this.tokenizer, this.options);\n await id3v1parser.parse();\n this.finalize();\n }\n }\n async tryReadId3v2Headers() {\n const id3Header = await this.tokenizer.peekToken(_ID3v2Token_js__WEBPACK_IMPORTED_MODULE_2__.ID3v2Header);\n if (id3Header.fileIdentifier === 'ID3') {\n debug('Found ID3v2 header, pos=%s', this.tokenizer.position);\n await this.id3parser.parse(this.metadata, this.tokenizer, this.options);\n return this.tryReadId3v2Headers();\n }\n }\n}\n//# sourceMappingURL=AbstractID3Parser.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js?");
16
-
17
- /***/ }),
18
-
19
- /***/ "../../node_modules/music-metadata/lib/musepack/MusepackConentError.js":
20
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
21
-
22
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MusepackContentError: () => (/* binding */ MusepackContentError)\n/* harmony export */ });\n/* harmony import */ var _ParseError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ParseError.js\");\n\nclass MusepackContentError extends (0,_ParseError_js__WEBPACK_IMPORTED_MODULE_0__.makeUnexpectedFileContentError)('Musepack') {\n}\n//# sourceMappingURL=MusepackConentError.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/musepack/MusepackConentError.js?");
23
-
24
- /***/ }),
25
-
26
- /***/ "../../node_modules/music-metadata/lib/musepack/MusepackParser.js":
27
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
28
-
29
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MusepackParser: () => (/* binding */ MusepackParser)\n/* harmony export */ });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var _id3v2_AbstractID3Parser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js\");\n/* harmony import */ var _sv8_MpcSv8Parser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\"../../node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.js\");\n/* harmony import */ var _sv7_MpcSv7Parser_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\"../../node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.js\");\n/* harmony import */ var _MusepackConentError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\"../../node_modules/music-metadata/lib/musepack/MusepackConentError.js\");\n\n\n\n\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_0__('music-metadata:parser:musepack');\nclass MusepackParser extends _id3v2_AbstractID3Parser_js__WEBPACK_IMPORTED_MODULE_2__.AbstractID3Parser {\n async postId3v2Parse() {\n const signature = await this.tokenizer.peekToken(new token_types__WEBPACK_IMPORTED_MODULE_1__.StringType(3, 'latin1'));\n let mpcParser;\n switch (signature) {\n case 'MP+': {\n debug('Stream-version 7');\n mpcParser = new _sv7_MpcSv7Parser_js__WEBPACK_IMPORTED_MODULE_4__.MpcSv7Parser(this.metadata, this.tokenizer, this.options);\n break;\n }\n case 'MPC': {\n debug('Stream-version 8');\n mpcParser = new _sv8_MpcSv8Parser_js__WEBPACK_IMPORTED_MODULE_3__.MpcSv8Parser(this.metadata, this.tokenizer, this.options);\n break;\n }\n default: {\n throw new _MusepackConentError_js__WEBPACK_IMPORTED_MODULE_5__.MusepackContentError('Invalid signature prefix');\n }\n }\n return mpcParser.parse();\n }\n}\n//# sourceMappingURL=MusepackParser.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/musepack/MusepackParser.js?");
30
-
31
- /***/ }),
32
-
33
- /***/ "../../node_modules/music-metadata/lib/musepack/sv7/BitReader.js":
34
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35
-
36
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BitReader: () => (/* binding */ BitReader)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n\nclass BitReader {\n constructor(tokenizer) {\n this.tokenizer = tokenizer;\n this.pos = 0;\n this.dword = null;\n }\n /**\n *\n * @param bits 1..30 bits\n */\n async read(bits) {\n while (this.dword === null) {\n this.dword = await this.tokenizer.readToken(token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE);\n }\n let out = this.dword;\n this.pos += bits;\n if (this.pos < 32) {\n out >>>= (32 - this.pos);\n return out & ((1 << bits) - 1);\n }\n this.pos -= 32;\n if (this.pos === 0) {\n this.dword = null;\n return out & ((1 << bits) - 1);\n }\n this.dword = await this.tokenizer.readToken(token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE);\n if (this.pos) {\n out <<= this.pos;\n out |= this.dword >>> (32 - this.pos);\n }\n return out & ((1 << bits) - 1);\n }\n async ignore(bits) {\n if (this.pos > 0) {\n const remaining = 32 - this.pos;\n this.dword = null;\n bits -= remaining;\n this.pos = 0;\n }\n const remainder = bits % 32;\n const numOfWords = (bits - remainder) / 32;\n await this.tokenizer.ignore(numOfWords * 4);\n return this.read(remainder);\n }\n}\n//# sourceMappingURL=BitReader.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/musepack/sv7/BitReader.js?");
37
-
38
- /***/ }),
39
-
40
- /***/ "../../node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.js":
41
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
42
-
43
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MpcSv7Parser: () => (/* binding */ MpcSv7Parser)\n/* harmony export */ });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var _common_BasicParser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/BasicParser.js\");\n/* harmony import */ var _apev2_APEv2Parser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/apev2/APEv2Parser.js\");\n/* harmony import */ var _BitReader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\"../../node_modules/music-metadata/lib/musepack/sv7/BitReader.js\");\n/* harmony import */ var _StreamVersion7_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\"../../node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.js\");\n/* harmony import */ var _MusepackConentError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\"../../node_modules/music-metadata/lib/musepack/MusepackConentError.js\");\n\n\n\n\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_0__('music-metadata:parser:musepack');\nclass MpcSv7Parser extends _common_BasicParser_js__WEBPACK_IMPORTED_MODULE_1__.BasicParser {\n constructor() {\n super(...arguments);\n this.bitreader = null;\n this.audioLength = 0;\n this.duration = null;\n }\n async parse() {\n const header = await this.tokenizer.readToken(_StreamVersion7_js__WEBPACK_IMPORTED_MODULE_4__.Header);\n if (header.signature !== 'MP+')\n throw new _MusepackConentError_js__WEBPACK_IMPORTED_MODULE_5__.MusepackContentError('Unexpected magic number');\n debug(`stream-version=${header.streamMajorVersion}.${header.streamMinorVersion}`);\n this.metadata.setFormat('container', 'Musepack, SV7');\n this.metadata.setFormat('sampleRate', header.sampleFrequency);\n const numberOfSamples = 1152 * (header.frameCount - 1) + header.lastFrameLength;\n this.metadata.setFormat('numberOfSamples', numberOfSamples);\n this.duration = numberOfSamples / header.sampleFrequency;\n this.metadata.setFormat('duration', this.duration);\n this.bitreader = new _BitReader_js__WEBPACK_IMPORTED_MODULE_3__.BitReader(this.tokenizer);\n this.metadata.setFormat('numberOfChannels', header.midSideStereo || header.intensityStereo ? 2 : 1);\n const version = await this.bitreader.read(8);\n this.metadata.setFormat('codec', (version / 100).toFixed(2));\n await this.skipAudioData(header.frameCount);\n debug(`End of audio stream, switching to APEv2, offset=${this.tokenizer.position}`);\n return _apev2_APEv2Parser_js__WEBPACK_IMPORTED_MODULE_2__.APEv2Parser.tryParseApeHeader(this.metadata, this.tokenizer, this.options);\n }\n async skipAudioData(frameCount) {\n while (frameCount-- > 0) {\n const frameLength = await this.bitreader.read(20);\n this.audioLength += 20 + frameLength;\n await this.bitreader.ignore(frameLength);\n }\n // last frame\n const lastFrameLength = await this.bitreader.read(11);\n this.audioLength += lastFrameLength;\n if (this.duration !== null) {\n this.metadata.setFormat('bitrate', this.audioLength / this.duration);\n }\n }\n}\n//# sourceMappingURL=MpcSv7Parser.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.js?");
44
-
45
- /***/ }),
46
-
47
- /***/ "../../node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.js":
48
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
49
-
50
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Header: () => (/* binding */ Header)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var _common_Util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/Util.js\");\n\n\n/**\n * BASIC STRUCTURE\n */\nconst Header = {\n len: 6 * 4,\n get: (buf, off) => {\n const header = {\n // word 0\n signature: new TextDecoder('latin1').decode(buf.subarray(off, off + 3)),\n // versionIndex number * 1000 (3.81 = 3810) (remember that 4-byte alignment causes this to take 4-bytes)\n streamMinorVersion: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.getBitAllignedNumber(buf, off + 3, 0, 4),\n streamMajorVersion: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.getBitAllignedNumber(buf, off + 3, 4, 4),\n // word 1\n frameCount: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(buf, off + 4),\n // word 2\n maxLevel: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_LE.get(buf, off + 8),\n sampleFrequency: [44100, 48000, 37800, 32000][_common_Util_js__WEBPACK_IMPORTED_MODULE_1__.getBitAllignedNumber(buf, off + 10, 0, 2)],\n link: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.getBitAllignedNumber(buf, off + 10, 2, 2),\n profile: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.getBitAllignedNumber(buf, off + 10, 4, 4),\n maxBand: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.getBitAllignedNumber(buf, off + 11, 0, 6),\n intensityStereo: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.isBitSet(buf, off + 11, 6),\n midSideStereo: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.isBitSet(buf, off + 11, 7),\n // word 3\n titlePeak: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_LE.get(buf, off + 12),\n titleGain: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_LE.get(buf, off + 14),\n // word 4\n albumPeak: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_LE.get(buf, off + 16),\n albumGain: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_LE.get(buf, off + 18),\n // word\n lastFrameLength: (token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(buf, off + 20) >>> 20) & 0x7FF,\n trueGapless: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.isBitSet(buf, off + 23, 0)\n };\n header.lastFrameLength = header.trueGapless ? (token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(buf, 20) >>> 20) & 0x7FF : 0;\n return header;\n }\n};\n//# sourceMappingURL=StreamVersion7.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.js?");
51
-
52
- /***/ }),
53
-
54
- /***/ "../../node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.js":
55
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
56
-
57
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MpcSv8Parser: () => (/* binding */ MpcSv8Parser)\n/* harmony export */ });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var _common_BasicParser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/BasicParser.js\");\n/* harmony import */ var _apev2_APEv2Parser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/apev2/APEv2Parser.js\");\n/* harmony import */ var _common_FourCC_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/FourCC.js\");\n/* harmony import */ var _StreamVersion8_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\"../../node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js\");\n/* harmony import */ var _MusepackConentError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\"../../node_modules/music-metadata/lib/musepack/MusepackConentError.js\");\n\n\n\n\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_0__('music-metadata:parser:musepack');\nclass MpcSv8Parser extends _common_BasicParser_js__WEBPACK_IMPORTED_MODULE_1__.BasicParser {\n constructor() {\n super(...arguments);\n this.audioLength = 0;\n }\n async parse() {\n const signature = await this.tokenizer.readToken(_common_FourCC_js__WEBPACK_IMPORTED_MODULE_3__.FourCcToken);\n if (signature !== 'MPCK')\n throw new _MusepackConentError_js__WEBPACK_IMPORTED_MODULE_5__.MusepackContentError('Invalid Magic number');\n this.metadata.setFormat('container', 'Musepack, SV8');\n return this.parsePacket();\n }\n async parsePacket() {\n const sv8reader = new _StreamVersion8_js__WEBPACK_IMPORTED_MODULE_4__.StreamReader(this.tokenizer);\n do {\n const header = await sv8reader.readPacketHeader();\n debug(`packet-header key=${header.key}, payloadLength=${header.payloadLength}`);\n switch (header.key) {\n case 'SH': { // Stream Header\n const sh = await sv8reader.readStreamHeader(header.payloadLength);\n this.metadata.setFormat('numberOfSamples', sh.sampleCount);\n this.metadata.setFormat('sampleRate', sh.sampleFrequency);\n this.metadata.setFormat('duration', sh.sampleCount / sh.sampleFrequency);\n this.metadata.setFormat('numberOfChannels', sh.channelCount);\n break;\n }\n case 'AP': // Audio Packet\n this.audioLength += header.payloadLength;\n await this.tokenizer.ignore(header.payloadLength);\n break;\n case 'RG': // Replaygain\n case 'EI': // Encoder Info\n case 'SO': // Seek Table Offset\n case 'ST': // Seek Table\n case 'CT': // Chapter-Tag\n await this.tokenizer.ignore(header.payloadLength);\n break;\n case 'SE': // Stream End\n if (this.metadata.format.duration) {\n this.metadata.setFormat('bitrate', this.audioLength * 8 / this.metadata.format.duration);\n }\n return _apev2_APEv2Parser_js__WEBPACK_IMPORTED_MODULE_2__.APEv2Parser.tryParseApeHeader(this.metadata, this.tokenizer, this.options);\n default:\n throw new _MusepackConentError_js__WEBPACK_IMPORTED_MODULE_5__.MusepackContentError(`Unexpected header: ${header.key}`);\n }\n } while (true);\n }\n}\n//# sourceMappingURL=MpcSv8Parser.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.js?");
58
-
59
- /***/ }),
60
-
61
- /***/ "../../node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js":
62
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
63
-
64
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ StreamReader: () => (/* binding */ StreamReader)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var _common_Util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/Util.js\");\n\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_1__('music-metadata:parser:musepack:sv8');\nconst PacketKey = new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(2, 'latin1');\n/**\n * Stream Header Packet part 1\n * Ref: http://trac.musepack.net/musepack/wiki/SV8Specification#StreamHeaderPacket\n */\nconst SH_part1 = {\n len: 5,\n get: (buf, off) => {\n return {\n crc: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(buf, off),\n streamVersion: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 4)\n };\n }\n};\n/**\n * Stream Header Packet part 3\n * Ref: http://trac.musepack.net/musepack/wiki/SV8Specification#StreamHeaderPacket\n */\nconst SH_part3 = {\n len: 2,\n get: (buf, off) => {\n return {\n sampleFrequency: [44100, 48000, 37800, 32000][_common_Util_js__WEBPACK_IMPORTED_MODULE_2__.getBitAllignedNumber(buf, off, 0, 3)],\n maxUsedBands: _common_Util_js__WEBPACK_IMPORTED_MODULE_2__.getBitAllignedNumber(buf, off, 3, 5),\n channelCount: _common_Util_js__WEBPACK_IMPORTED_MODULE_2__.getBitAllignedNumber(buf, off + 1, 0, 4) + 1,\n msUsed: _common_Util_js__WEBPACK_IMPORTED_MODULE_2__.isBitSet(buf, off + 1, 4),\n audioBlockFrames: _common_Util_js__WEBPACK_IMPORTED_MODULE_2__.getBitAllignedNumber(buf, off + 1, 5, 3)\n };\n }\n};\nclass StreamReader {\n constructor(tokenizer) {\n this.tokenizer = tokenizer;\n }\n async readPacketHeader() {\n const key = await this.tokenizer.readToken(PacketKey);\n const size = await this.readVariableSizeField();\n return {\n key,\n payloadLength: size.value - 2 - size.len\n };\n }\n async readStreamHeader(size) {\n const streamHeader = {};\n debug(`Reading SH at offset=${this.tokenizer.position}`);\n const part1 = await this.tokenizer.readToken(SH_part1);\n size -= SH_part1.len;\n Object.assign(streamHeader, part1);\n debug(`SH.streamVersion = ${part1.streamVersion}`);\n const sampleCount = await this.readVariableSizeField();\n size -= sampleCount.len;\n streamHeader.sampleCount = sampleCount.value;\n const bs = await this.readVariableSizeField();\n size -= bs.len;\n streamHeader.beginningOfSilence = bs.value;\n const part3 = await this.tokenizer.readToken(SH_part3);\n size -= SH_part3.len;\n Object.assign(streamHeader, part3);\n // assert.equal(size, 0);\n await this.tokenizer.ignore(size);\n return streamHeader;\n }\n async readVariableSizeField(len = 1, hb = 0) {\n let n = await this.tokenizer.readNumber(token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8);\n if ((n & 0x80) === 0) {\n return { len, value: hb + n };\n }\n n &= 0x7F;\n n += hb;\n return this.readVariableSizeField(len + 1, n << 7);\n }\n}\n//# sourceMappingURL=StreamVersion8.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js?");
65
-
66
- /***/ })
67
-
68
- }]);
@@ -1,82 +0,0 @@
1
- "use strict";
2
- /*
3
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
4
- * This devtool is neither made for production nor for readable output files.
5
- * It uses "eval()" calls to create a separate source file in the browser devtools.
6
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
7
- * or disable the default devtool with "devtool: false".
8
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
9
- */
10
- (this["webpackChunkExamBundle"] = this["webpackChunkExamBundle"] || []).push([["vendors-node_modules_music-metadata_lib_ogg_OggParser_js"],{
11
-
12
- /***/ "../../node_modules/music-metadata/lib/ogg/OggParser.js":
13
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14
-
15
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OggContentError: () => (/* binding */ OggContentError),\n/* harmony export */ OggParser: () => (/* binding */ OggParser),\n/* harmony export */ SegmentTable: () => (/* binding */ SegmentTable)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var strtok3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/strtok3/lib/core.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var _common_Util_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/Util.js\");\n/* harmony import */ var _common_FourCC_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/FourCC.js\");\n/* harmony import */ var _common_BasicParser_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/BasicParser.js\");\n/* harmony import */ var _vorbis_VorbisParser_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.js\");\n/* harmony import */ var _opus_OpusParser_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ogg/opus/OpusParser.js\");\n/* harmony import */ var _speex_SpeexParser_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ogg/speex/SpeexParser.js\");\n/* harmony import */ var _theora_TheoraParser_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ogg/theora/TheoraParser.js\");\n/* harmony import */ var _ParseError_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ParseError.js\");\n\n\n\n\n\n\n\n\n\n\n\nclass OggContentError extends (0,_ParseError_js__WEBPACK_IMPORTED_MODULE_10__.makeUnexpectedFileContentError)('Ogg') {\n}\nconst debug = debug__WEBPACK_IMPORTED_MODULE_2__('music-metadata:parser:ogg');\nclass SegmentTable {\n static sum(buf, off, len) {\n const dv = new DataView(buf.buffer, 0);\n let s = 0;\n for (let i = off; i < off + len; ++i) {\n s += dv.getUint8(i);\n }\n return s;\n }\n constructor(header) {\n this.len = header.page_segments;\n }\n get(buf, off) {\n return {\n totalPageSize: SegmentTable.sum(buf, off, this.len)\n };\n }\n}\n/**\n * Parser for Ogg logical bitstream framing\n */\nclass OggParser extends _common_BasicParser_js__WEBPACK_IMPORTED_MODULE_5__.BasicParser {\n constructor() {\n super(...arguments);\n this.header = null;\n this.pageNumber = 0;\n this.pageConsumer = null;\n }\n /**\n * Parse page\n * @returns {Promise<void>}\n */\n async parse() {\n debug('pos=%s, parsePage()', this.tokenizer.position);\n try {\n let header;\n do {\n header = await this.tokenizer.readToken(OggParser.Header);\n if (header.capturePattern !== 'OggS')\n throw new OggContentError('Invalid Ogg capture pattern');\n this.metadata.setFormat('container', 'Ogg');\n this.header = header;\n this.pageNumber = header.pageSequenceNo;\n debug('page#=%s, Ogg.id=%s', header.pageSequenceNo, header.capturePattern);\n const segmentTable = await this.tokenizer.readToken(new SegmentTable(header));\n debug('totalPageSize=%s', segmentTable.totalPageSize);\n const pageData = await this.tokenizer.readToken(new token_types__WEBPACK_IMPORTED_MODULE_0__.Uint8ArrayType(segmentTable.totalPageSize));\n debug('firstPage=%s, lastPage=%s, continued=%s', header.headerType.firstPage, header.headerType.lastPage, header.headerType.continued);\n if (header.headerType.firstPage) {\n const id = new TextDecoder('ascii').decode(pageData.subarray(0, 7));\n switch (id) {\n case '\\x01vorbis': // Ogg/Vorbis\n debug('Set page consumer to Ogg/Vorbis');\n this.pageConsumer = new _vorbis_VorbisParser_js__WEBPACK_IMPORTED_MODULE_6__.VorbisParser(this.metadata, this.options);\n break;\n case 'OpusHea': // Ogg/Opus\n debug('Set page consumer to Ogg/Opus');\n this.pageConsumer = new _opus_OpusParser_js__WEBPACK_IMPORTED_MODULE_7__.OpusParser(this.metadata, this.options, this.tokenizer);\n break;\n case 'Speex ': // Ogg/Speex\n debug('Set page consumer to Ogg/Speex');\n this.pageConsumer = new _speex_SpeexParser_js__WEBPACK_IMPORTED_MODULE_8__.SpeexParser(this.metadata, this.options, this.tokenizer);\n break;\n case 'fishead':\n case '\\x00theora': // Ogg/Theora\n debug('Set page consumer to Ogg/Theora');\n this.pageConsumer = new _theora_TheoraParser_js__WEBPACK_IMPORTED_MODULE_9__.TheoraParser(this.metadata, this.options, this.tokenizer);\n break;\n default:\n throw new OggContentError(`gg audio-codec not recognized (id=${id})`);\n }\n }\n await this.pageConsumer.parsePage(header, pageData);\n } while (!header.headerType.lastPage);\n }\n catch (err) {\n if (err instanceof Error) {\n if (err instanceof strtok3__WEBPACK_IMPORTED_MODULE_1__.EndOfStreamError) {\n this.metadata.addWarning('Last OGG-page is not marked with last-page flag');\n debug(\"End-of-stream\");\n this.metadata.addWarning('Last OGG-page is not marked with last-page flag');\n if (this.header) {\n this.pageConsumer.calculateDuration(this.header);\n }\n }\n else if (err.message.startsWith('FourCC')) {\n if (this.pageNumber > 0) {\n // ignore this error: work-around if last OGG-page is not marked with last-page flag\n this.metadata.addWarning('Invalid FourCC ID, maybe last OGG-page is not marked with last-page flag');\n await this.pageConsumer.flush();\n }\n }\n }\n else\n throw err;\n }\n }\n}\nOggParser.Header = {\n len: 27,\n get: (buf, off) => {\n return {\n capturePattern: _common_FourCC_js__WEBPACK_IMPORTED_MODULE_4__.FourCcToken.get(buf, off),\n version: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 4),\n headerType: {\n continued: _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBit(buf, off + 5, 0),\n firstPage: _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBit(buf, off + 5, 1),\n lastPage: _common_Util_js__WEBPACK_IMPORTED_MODULE_3__.getBit(buf, off + 5, 2)\n },\n // packet_flag: Token.UINT8.get(buf, off + 5),\n absoluteGranulePosition: Number(token_types__WEBPACK_IMPORTED_MODULE_0__.UINT64_LE.get(buf, off + 6)),\n streamSerialNumber: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(buf, off + 14),\n pageSequenceNo: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(buf, off + 18),\n pageChecksum: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(buf, off + 22),\n page_segments: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 26)\n };\n }\n};\n//# sourceMappingURL=OggParser.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/ogg/OggParser.js?");
16
-
17
- /***/ }),
18
-
19
- /***/ "../../node_modules/music-metadata/lib/ogg/opus/Opus.js":
20
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
21
-
22
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IdHeader: () => (/* binding */ IdHeader),\n/* harmony export */ OpusContentError: () => (/* binding */ OpusContentError)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var _ParseError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ParseError.js\");\n\n\nclass OpusContentError extends (0,_ParseError_js__WEBPACK_IMPORTED_MODULE_1__.makeUnexpectedFileContentError)('Opus') {\n}\n/**\n * Opus ID Header parser\n * Ref: https://wiki.xiph.org/OggOpus#ID_Header\n */\nclass IdHeader {\n constructor(len) {\n this.len = len;\n if (len < 19) {\n throw new OpusContentError('ID-header-page 0 should be at least 19 bytes long');\n }\n }\n get(buf, off) {\n return {\n magicSignature: new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(8, 'ascii').get(buf, off + 0),\n version: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 8),\n channelCount: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 9),\n preSkip: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_LE.get(buf, off + 10),\n inputSampleRate: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(buf, off + 12),\n outputGain: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_LE.get(buf, off + 16),\n channelMapping: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 18)\n };\n }\n}\n//# sourceMappingURL=Opus.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/ogg/opus/Opus.js?");
23
-
24
- /***/ }),
25
-
26
- /***/ "../../node_modules/music-metadata/lib/ogg/opus/OpusParser.js":
27
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
28
-
29
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OpusParser: () => (/* binding */ OpusParser)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var _vorbis_VorbisParser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.js\");\n/* harmony import */ var _Opus_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ogg/opus/Opus.js\");\n\n\n\n\n/**\n * Opus parser\n * Internet Engineering Task Force (IETF) - RFC 6716\n * Used by OggParser\n */\nclass OpusParser extends _vorbis_VorbisParser_js__WEBPACK_IMPORTED_MODULE_1__.VorbisParser {\n constructor(metadata, options, tokenizer) {\n super(metadata, options);\n this.tokenizer = tokenizer;\n this.idHeader = null;\n this.lastPos = -1;\n }\n /**\n * Parse first Opus Ogg page\n * @param {IPageHeader} header\n * @param {Uint8Array} pageData\n */\n parseFirstPage(header, pageData) {\n this.metadata.setFormat('codec', 'Opus');\n // Parse Opus ID Header\n this.idHeader = new _Opus_js__WEBPACK_IMPORTED_MODULE_2__.IdHeader(pageData.length).get(pageData, 0);\n if (this.idHeader.magicSignature !== \"OpusHead\")\n throw new _Opus_js__WEBPACK_IMPORTED_MODULE_2__.OpusContentError(\"Illegal ogg/Opus magic-signature\");\n this.metadata.setFormat('sampleRate', this.idHeader.inputSampleRate);\n this.metadata.setFormat('numberOfChannels', this.idHeader.channelCount);\n }\n async parseFullPage(pageData) {\n const magicSignature = new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(8, 'ascii').get(pageData, 0);\n switch (magicSignature) {\n case 'OpusTags':\n await this.parseUserCommentList(pageData, 8);\n this.lastPos = this.tokenizer.position - pageData.length;\n break;\n default:\n break;\n }\n }\n calculateDuration(header) {\n if (this.metadata.format.sampleRate && header.absoluteGranulePosition >= 0) {\n // Calculate duration\n const pos_48bit = header.absoluteGranulePosition - this.idHeader.preSkip;\n this.metadata.setFormat('numberOfSamples', pos_48bit);\n this.metadata.setFormat('duration', pos_48bit / 48000);\n if (this.lastPos !== -1 && this.tokenizer.fileInfo.size && this.metadata.format.duration) {\n const dataSize = this.tokenizer.fileInfo.size - this.lastPos;\n this.metadata.setFormat('bitrate', 8 * dataSize / this.metadata.format.duration);\n }\n }\n }\n}\n//# sourceMappingURL=OpusParser.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/ogg/opus/OpusParser.js?");
30
-
31
- /***/ }),
32
-
33
- /***/ "../../node_modules/music-metadata/lib/ogg/speex/Speex.js":
34
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35
-
36
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Header: () => (/* binding */ Header)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var _common_Util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/music-metadata/lib/common/Util.js\");\n\n\n/**\n * Speex Header Packet\n * Ref: https://www.speex.org/docs/manual/speex-manual/node8.html#SECTION00830000000000000000\n */\nconst Header = {\n len: 80,\n get: (buf, off) => {\n return {\n speex: new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(8, 'ascii').get(buf, off + 0),\n version: _common_Util_js__WEBPACK_IMPORTED_MODULE_1__.trimRightNull(new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(20, 'ascii').get(buf, off + 8)),\n version_id: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 28),\n header_size: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 32),\n rate: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 36),\n mode: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 40),\n mode_bitstream_version: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 44),\n nb_channels: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 48),\n bitrate: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 52),\n frame_size: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 56),\n vbr: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 60),\n frames_per_packet: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 64),\n extra_headers: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 68),\n reserved1: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 72),\n reserved2: token_types__WEBPACK_IMPORTED_MODULE_0__.INT32_LE.get(buf, off + 76)\n };\n }\n};\n//# sourceMappingURL=Speex.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/ogg/speex/Speex.js?");
37
-
38
- /***/ }),
39
-
40
- /***/ "../../node_modules/music-metadata/lib/ogg/speex/SpeexParser.js":
41
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
42
-
43
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SpeexParser: () => (/* binding */ SpeexParser)\n/* harmony export */ });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var _vorbis_VorbisParser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.js\");\n/* harmony import */ var _Speex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ogg/speex/Speex.js\");\n\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_0__('music-metadata:parser:ogg:speex');\n/**\n * Speex, RFC 5574\n * Ref:\n * - https://www.speex.org/docs/manual/speex-manual/\n * - https://tools.ietf.org/html/rfc5574\n */\nclass SpeexParser extends _vorbis_VorbisParser_js__WEBPACK_IMPORTED_MODULE_1__.VorbisParser {\n constructor(metadata, options, tokenizer) {\n super(metadata, options);\n this.tokenizer = tokenizer;\n }\n /**\n * Parse first Speex Ogg page\n * @param {IPageHeader} header\n * @param {Uint8Array} pageData\n */\n parseFirstPage(header, pageData) {\n debug('First Ogg/Speex page');\n const speexHeader = _Speex_js__WEBPACK_IMPORTED_MODULE_2__.Header.get(pageData, 0);\n this.metadata.setFormat('codec', `Speex ${speexHeader.version}`);\n this.metadata.setFormat('numberOfChannels', speexHeader.nb_channels);\n this.metadata.setFormat('sampleRate', speexHeader.rate);\n if (speexHeader.bitrate !== -1) {\n this.metadata.setFormat('bitrate', speexHeader.bitrate);\n }\n }\n}\n//# sourceMappingURL=SpeexParser.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/ogg/speex/SpeexParser.js?");
44
-
45
- /***/ }),
46
-
47
- /***/ "../../node_modules/music-metadata/lib/ogg/theora/Theora.js":
48
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
49
-
50
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IdentificationHeader: () => (/* binding */ IdentificationHeader)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n\n/**\n * 6.2 Identification Header\n * Ref: https://theora.org/doc/Theora.pdf: 6.2 Identification Header Decode\n */\nconst IdentificationHeader = {\n len: 42,\n get: (buf, off) => {\n return {\n id: new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(7, 'ascii').get(buf, off),\n vmaj: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 7),\n vmin: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 8),\n vrev: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 9),\n vmbw: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_BE.get(buf, off + 10),\n vmbh: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT16_BE.get(buf, off + 17),\n nombr: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT24_BE.get(buf, off + 37),\n nqual: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off + 40)\n };\n }\n};\n//# sourceMappingURL=Theora.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/ogg/theora/Theora.js?");
51
-
52
- /***/ }),
53
-
54
- /***/ "../../node_modules/music-metadata/lib/ogg/theora/TheoraParser.js":
55
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
56
-
57
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TheoraParser: () => (/* binding */ TheoraParser)\n/* harmony export */ });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var _Theora_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ogg/theora/Theora.js\");\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_0__('music-metadata:parser:ogg:theora');\n/**\n * Ref:\n * - https://theora.org/doc/Theora.pdf\n */\nclass TheoraParser {\n constructor(metadata, options, tokenizer) {\n this.metadata = metadata;\n this.tokenizer = tokenizer;\n }\n /**\n * Vorbis 1 parser\n * @param header Ogg Page Header\n * @param pageData Page data\n */\n async parsePage(header, pageData) {\n if (header.headerType.firstPage) {\n await this.parseFirstPage(header, pageData);\n }\n }\n async flush() {\n debug('flush');\n }\n calculateDuration(header) {\n debug('duration calculation not implemented');\n }\n /**\n * Parse first Theora Ogg page. the initial identification header packet\n * @param {IPageHeader} header\n * @param {Buffer} pageData\n */\n async parseFirstPage(header, pageData) {\n debug('First Ogg/Theora page');\n this.metadata.setFormat('codec', 'Theora');\n const idHeader = _Theora_js__WEBPACK_IMPORTED_MODULE_1__.IdentificationHeader.get(pageData, 0);\n this.metadata.setFormat('bitrate', idHeader.nombr);\n }\n}\n//# sourceMappingURL=TheoraParser.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/ogg/theora/TheoraParser.js?");
58
-
59
- /***/ }),
60
-
61
- /***/ "../../node_modules/music-metadata/lib/ogg/vorbis/Vorbis.js":
62
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
63
-
64
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CommonHeader: () => (/* binding */ CommonHeader),\n/* harmony export */ IdentificationHeader: () => (/* binding */ IdentificationHeader),\n/* harmony export */ VorbisPictureToken: () => (/* binding */ VorbisPictureToken)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var _id3v2_ID3v2Token_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/music-metadata/lib/id3v2/ID3v2Token.js\");\n\n\n/**\n * Parse the METADATA_BLOCK_PICTURE\n * Ref: https://wiki.xiph.org/VorbisComment#METADATA_BLOCK_PICTURE\n * Ref: https://xiph.org/flac/format.html#metadata_block_picture\n * // ToDo: move to ID3 / APIC?\n */\nclass VorbisPictureToken {\n static fromBase64(base64str) {\n return VorbisPictureToken.fromBuffer(Uint8Array.from(atob(base64str), c => c.charCodeAt(0)));\n }\n static fromBuffer(buffer) {\n const pic = new VorbisPictureToken(buffer.length);\n return pic.get(buffer, 0);\n }\n constructor(len) {\n this.len = len;\n }\n get(buffer, offset) {\n const type = _id3v2_ID3v2Token_js__WEBPACK_IMPORTED_MODULE_1__.AttachedPictureType[token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buffer, offset)];\n offset += 4;\n const mimeLen = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buffer, offset);\n offset += 4;\n const format = new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(mimeLen, 'utf-8').get(buffer, offset);\n offset += mimeLen;\n const descLen = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buffer, offset);\n offset += 4;\n const description = new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(descLen, 'utf-8').get(buffer, offset);\n offset += descLen;\n const width = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buffer, offset);\n offset += 4;\n const height = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buffer, offset);\n offset += 4;\n const colour_depth = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buffer, offset);\n offset += 4;\n const indexed_color = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buffer, offset);\n offset += 4;\n const picDataLen = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_BE.get(buffer, offset);\n offset += 4;\n const data = Uint8Array.from(buffer.slice(offset, offset + picDataLen));\n return {\n type,\n format,\n description,\n width,\n height,\n colour_depth,\n indexed_color,\n data\n };\n }\n}\n/**\n * Comment header decoder\n * Ref: https://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-620004.2.1\n */\nconst CommonHeader = {\n len: 7,\n get: (buf, off) => {\n return {\n packetType: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(buf, off),\n vorbis: new token_types__WEBPACK_IMPORTED_MODULE_0__.StringType(6, 'ascii').get(buf, off + 1)\n };\n }\n};\n/**\n * Identification header decoder\n * Ref: https://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-630004.2.2\n */\nconst IdentificationHeader = {\n len: 23,\n get: (uint8Array, off) => {\n return {\n version: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(uint8Array, off + 0),\n channelMode: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT8.get(uint8Array, off + 4),\n sampleRate: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(uint8Array, off + 5),\n bitrateMax: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(uint8Array, off + 9),\n bitrateNominal: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(uint8Array, off + 13),\n bitrateMin: token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(uint8Array, off + 17)\n };\n }\n};\n//# sourceMappingURL=Vorbis.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/ogg/vorbis/Vorbis.js?");
65
-
66
- /***/ }),
67
-
68
- /***/ "../../node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js":
69
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
70
-
71
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ VorbisDecoder: () => (/* binding */ VorbisDecoder)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n\nclass VorbisDecoder {\n constructor(data, offset) {\n this.data = data;\n this.offset = offset;\n }\n readInt32() {\n const value = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(this.data, this.offset);\n this.offset += 4;\n return value;\n }\n readStringUtf8() {\n const len = this.readInt32();\n const value = new TextDecoder('utf-8').decode(this.data.subarray(this.offset, this.offset + len));\n this.offset += len;\n return value;\n }\n parseUserComment() {\n const offset0 = this.offset;\n const v = this.readStringUtf8();\n const idx = v.indexOf('=');\n return {\n key: v.slice(0, idx).toUpperCase(),\n value: v.slice(idx + 1),\n len: this.offset - offset0\n };\n }\n}\n//# sourceMappingURL=VorbisDecoder.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js?");
72
-
73
- /***/ }),
74
-
75
- /***/ "../../node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.js":
76
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
77
-
78
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ VorbisContentError: () => (/* binding */ VorbisContentError),\n/* harmony export */ VorbisParser: () => (/* binding */ VorbisParser)\n/* harmony export */ });\n/* harmony import */ var token_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"../../node_modules/token-types/lib/index.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"../../node_modules/debug/src/browser.js\");\n/* harmony import */ var _VorbisDecoder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js\");\n/* harmony import */ var _Vorbis_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ogg/vorbis/Vorbis.js\");\n/* harmony import */ var _ParseError_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\"../../node_modules/music-metadata/lib/ParseError.js\");\n\n\n\n\n\nconst debug = debug__WEBPACK_IMPORTED_MODULE_1__('music-metadata:parser:ogg:vorbis1');\nclass VorbisContentError extends (0,_ParseError_js__WEBPACK_IMPORTED_MODULE_4__.makeUnexpectedFileContentError)('Vorbis') {\n}\n/**\n * Vorbis 1 Parser.\n * Used by OggParser\n */\nclass VorbisParser {\n constructor(metadata, options) {\n this.metadata = metadata;\n this.options = options;\n this.pageSegments = [];\n }\n /**\n * Vorbis 1 parser\n * @param header Ogg Page Header\n * @param pageData Page data\n */\n async parsePage(header, pageData) {\n if (header.headerType.firstPage) {\n this.parseFirstPage(header, pageData);\n }\n else {\n if (header.headerType.continued) {\n if (this.pageSegments.length === 0) {\n throw new VorbisContentError('Cannot continue on previous page');\n }\n this.pageSegments.push(pageData);\n }\n if (header.headerType.lastPage || !header.headerType.continued) {\n // Flush page segments\n if (this.pageSegments.length > 0) {\n const fullPage = VorbisParser.mergeUint8Arrays(this.pageSegments);\n await this.parseFullPage(fullPage);\n }\n // Reset page segments\n this.pageSegments = header.headerType.lastPage ? [] : [pageData];\n }\n }\n if (header.headerType.lastPage) {\n this.calculateDuration(header);\n }\n }\n static mergeUint8Arrays(arrays) {\n const totalSize = arrays.reduce((acc, e) => acc + e.length, 0);\n const merged = new Uint8Array(totalSize);\n arrays.forEach((array, i, _arrays) => {\n const offset = _arrays.slice(0, i).reduce((acc, e) => acc + e.length, 0);\n merged.set(array, offset);\n });\n return merged;\n }\n async flush() {\n await this.parseFullPage(VorbisParser.mergeUint8Arrays(this.pageSegments));\n }\n async parseUserComment(pageData, offset) {\n const decoder = new _VorbisDecoder_js__WEBPACK_IMPORTED_MODULE_2__.VorbisDecoder(pageData, offset);\n const tag = decoder.parseUserComment();\n await this.addTag(tag.key, tag.value);\n return tag.len;\n }\n async addTag(id, value) {\n if (id === 'METADATA_BLOCK_PICTURE' && (typeof value === 'string')) {\n if (this.options.skipCovers) {\n debug(\"Ignore picture\");\n return;\n }\n value = _Vorbis_js__WEBPACK_IMPORTED_MODULE_3__.VorbisPictureToken.fromBase64(value);\n debug(`Push picture: id=${id}, format=${value.format}`);\n }\n else {\n debug(`Push tag: id=${id}, value=${value}`);\n }\n await this.metadata.addTag('vorbis', id, value);\n }\n calculateDuration(header) {\n if (this.metadata.format.sampleRate && header.absoluteGranulePosition >= 0) {\n // Calculate duration\n this.metadata.setFormat('numberOfSamples', header.absoluteGranulePosition);\n this.metadata.setFormat('duration', header.absoluteGranulePosition / this.metadata.format.sampleRate);\n }\n }\n /**\n * Parse first Ogg/Vorbis page\n * @param header\n * @param pageData\n */\n parseFirstPage(header, pageData) {\n this.metadata.setFormat('codec', 'Vorbis I');\n debug('Parse first page');\n // Parse Vorbis common header\n const commonHeader = _Vorbis_js__WEBPACK_IMPORTED_MODULE_3__.CommonHeader.get(pageData, 0);\n if (commonHeader.vorbis !== 'vorbis')\n throw new VorbisContentError('Metadata does not look like Vorbis');\n if (commonHeader.packetType === 1) {\n const idHeader = _Vorbis_js__WEBPACK_IMPORTED_MODULE_3__.IdentificationHeader.get(pageData, _Vorbis_js__WEBPACK_IMPORTED_MODULE_3__.CommonHeader.len);\n this.metadata.setFormat('sampleRate', idHeader.sampleRate);\n this.metadata.setFormat('bitrate', idHeader.bitrateNominal);\n this.metadata.setFormat('numberOfChannels', idHeader.channelMode);\n debug('sample-rate=%s[hz], bitrate=%s[b/s], channel-mode=%s', idHeader.sampleRate, idHeader.bitrateNominal, idHeader.channelMode);\n }\n else\n throw new VorbisContentError('First Ogg page should be type 1: the identification header');\n }\n async parseFullPage(pageData) {\n // New page\n const commonHeader = _Vorbis_js__WEBPACK_IMPORTED_MODULE_3__.CommonHeader.get(pageData, 0);\n debug('Parse full page: type=%s, byteLength=%s', commonHeader.packetType, pageData.byteLength);\n switch (commonHeader.packetType) {\n case 3: // type 3: comment header\n return this.parseUserCommentList(pageData, _Vorbis_js__WEBPACK_IMPORTED_MODULE_3__.CommonHeader.len);\n case 1: // type 1: the identification header\n case 5: // type 5: setup header type\n break; // ignore\n }\n }\n /**\n * Ref: https://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-840005.2\n */\n async parseUserCommentList(pageData, offset) {\n const strLen = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(pageData, offset);\n offset += 4;\n // const vendorString = new Token.StringType(strLen, 'utf-8').get(pageData, offset);\n offset += strLen;\n let userCommentListLength = token_types__WEBPACK_IMPORTED_MODULE_0__.UINT32_LE.get(pageData, offset);\n offset += 4;\n while (userCommentListLength-- > 0) {\n offset += (await this.parseUserComment(pageData, offset));\n }\n }\n}\n//# sourceMappingURL=VorbisParser.js.map\n\n//# sourceURL=webpack://ExamBundle/../../node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.js?");
79
-
80
- /***/ })
81
-
82
- }]);