@mimium/mimium-webaudio 4.0.4 → 4.1.1
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 +14 -0
- package/dist/audioprocessor.mjs +1 -1
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +105 -81
- package/dist/index.mjs.map +1 -1
- package/dist/mimium_web-BcVt_FZc.js +827 -0
- package/dist/mimium_web-BcVt_FZc.js.map +1 -0
- package/package.json +2 -2
- package/dist/mimium_web-45qAhlDr.js +0 -794
- package/dist/mimium_web-45qAhlDr.js.map +0 -1
package/Readme.md
CHANGED
|
@@ -57,10 +57,24 @@ setupMimiumAudioWorklet(
|
|
|
57
57
|
moduleBaseUrl?: string;
|
|
58
58
|
}
|
|
59
59
|
): Promise<MimiumProcessorNode>
|
|
60
|
+
|
|
61
|
+
transpileMimiumToRust(
|
|
62
|
+
src: string,
|
|
63
|
+
options?: {
|
|
64
|
+
libBaseUrl?: string;
|
|
65
|
+
moduleBaseUrl?: string;
|
|
66
|
+
samplerate?: number;
|
|
67
|
+
buffersize?: number;
|
|
68
|
+
direct?: boolean;
|
|
69
|
+
}
|
|
70
|
+
): Promise<string>
|
|
60
71
|
```
|
|
61
72
|
|
|
62
73
|
- `libBaseUrl`: Base URL for standard mimium libraries (default: `https://raw.githubusercontent.com/mimium-org/mimium-rs/main/lib/`).
|
|
63
74
|
- `moduleBaseUrl`: Base URL for user modules resolved by `mod` / `include` (default: current page base URL).
|
|
75
|
+
- `samplerate`: Sample rate used for transpile context (default: `44100`).
|
|
76
|
+
- `buffersize`: Buffer size used for transpile context (default: `128`).
|
|
77
|
+
- `direct`: Use synchronous transpile (`emit_rust_direct`) path (default: `false`).
|
|
64
78
|
|
|
65
79
|
For code that uses standard library modules (`use osc::sinwave`, etc.), calling `preloadMimiumLibCache` before `setupMimiumAudioWorklet` is recommended.
|
|
66
80
|
|
package/dist/audioprocessor.mjs
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import "./textencoder-B0AgIAQT.js";
|
|
5
|
-
import { initSync as f, Config as w, Context as y } from "./mimium_web-
|
|
5
|
+
import { initSync as f, Config as w, Context as y } from "./mimium_web-BcVt_FZc.js";
|
|
6
6
|
const _ = [
|
|
7
7
|
"core.mmm",
|
|
8
8
|
"delay.mmm",
|
package/dist/index.d.mts
CHANGED
|
@@ -5,5 +5,11 @@ type SetupOptions = {
|
|
|
5
5
|
libBaseUrl?: string;
|
|
6
6
|
moduleBaseUrl?: string;
|
|
7
7
|
};
|
|
8
|
+
export type TranspileToRustOptions = SetupOptions & {
|
|
9
|
+
samplerate?: number;
|
|
10
|
+
buffersize?: number;
|
|
11
|
+
direct?: boolean;
|
|
12
|
+
};
|
|
8
13
|
export declare function preloadMimiumLibCache(options?: Pick<SetupOptions, "libBaseUrl">): Promise<void>;
|
|
14
|
+
export declare function transpileMimiumToRust(src: string, options?: TranspileToRustOptions): Promise<string>;
|
|
9
15
|
export declare function setupMimiumAudioWorklet(ctx: AudioContext, src: string, MimiumProcessorUrl: string, options?: SetupOptions): Promise<MimiumProcessorNode>;
|