@modplayjs/fmt-mo3 0.0.0-stage → 0.2.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.
package/README.md CHANGED
@@ -1,3 +1,39 @@
1
- # Temporary Holding Version
1
+ # @modplayjs/fmt-mo3
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Un4seen MO3 container plugin** for `@modplayjs/core` — MO3 v1–v5
4
+ wrapping XM/IT/S3M/MOD/MTM inner formats. Ported 1:1 from OpenMPT's
5
+ `Load_mo3.cpp` plus unmo3's LZ depacker:
6
+
7
+ - Container + Lempel-Ziv depacker: **byte-exact** vs the C reference
8
+ - Uncompressed / delta / delta-prediction samples: exact decoders
9
+ - **Ogg-compressed samples: bit-exact** via `@modplayjs/stb-vorbis`
10
+ (incl. MO3 v5 shared-Ogg-header remux)
11
+ - MP3-compressed samples via the bundled minimp3 Layer-3 port (correct
12
+ playback; decoder-internal rounding differs from the C reference's
13
+ mpg123 path)
14
+ - OpenMPT semantic glue: effTrans CMD table, envelope mapping, note
15
+ conventions, InstrumentSynth pitch mapping
16
+
17
+ ## Install
18
+
19
+ ```sh
20
+ npm install @modplayjs/fmt-mo3
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ```ts
26
+ import { CorePlayer } from '@modplayjs/core';
27
+ import { plugin as mo3Plugin } from '@modplayjs/fmt-mo3';
28
+
29
+ const core = new CorePlayer();
30
+ core.registries.registerFormat(mo3Plugin);
31
+ core.loadModule(bytes); // .mo3 file
32
+ ```
33
+
34
+ ## Also exports
35
+
36
+ `mp3decInit` / `mp3decDecodeFrame` — the raw minimp3 L3 decoder (used by
37
+ `@modplayjs/stream-audio` for MP3 files).
38
+
39
+ Part of the [modplayjs monorepo](../../README.md). BSD-3-Clause.
@@ -0,0 +1,3 @@
1
+ export { mo3Test, mo3Load, plugin } from './mo3.js';
2
+ export { mp3decInit, mp3decDecodeFrame, type Mp3Dec, type Mp3FrameInfo } from './minimp3.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ // SPDX-License-Identifier: BSD-3-Clause
2
+ // Copyright (c) 2026 Bitti09 — modplayjs contributors
3
+ // @modplayjs/fmt-mo3 — Un4seen MO3 container (XM/IT/S3M/MOD/MTM inner).
4
+ export { mo3Test, mo3Load, plugin } from './mo3.js';
5
+ // Shared MP3 decoder used by @modplayjs/stream-audio.
6
+ export { mp3decInit, mp3decDecodeFrame } from './minimp3.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,sDAAsD;AACtD,wEAAwE;AAExE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACpD,sDAAsD;AACtD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAkC,MAAM,cAAc,CAAC"}
@@ -0,0 +1,18 @@
1
+ export interface Mp3Dec {
2
+ mdctOverlap: Float32Array[];
3
+ qmfState: Float32Array;
4
+ reserv: number;
5
+ freeFormatBytes: number;
6
+ header: Uint8Array;
7
+ reservBuf: Uint8Array;
8
+ }
9
+ export declare function mp3decInit(dec: Mp3Dec): void;
10
+ export interface Mp3FrameInfo {
11
+ frameBytes: number;
12
+ channels: number;
13
+ hz: number;
14
+ layer: number;
15
+ bitrateKbps: number;
16
+ }
17
+ export declare function mp3decDecodeFrame(dec: Mp3Dec, mp3: Uint8Array, mp3Bytes: number, pcm: Int16Array, info: Mp3FrameInfo): number;
18
+ //# sourceMappingURL=minimp3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minimp3.d.ts","sourceRoot":"","sources":["../src/minimp3.ts"],"names":[],"mappings":"AAiMA,MAAM,WAAW,MAAM;IACrB,WAAW,EAAE,YAAY,EAAE,CAAC;IAC5B,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,UAAU,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAO5C;AA+2BD,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAiE7H"}