@sudobility/music_types 0.10.0 → 0.11.0
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/dist/platform/audio.d.ts
CHANGED
|
@@ -24,4 +24,24 @@ export interface AudioCodec {
|
|
|
24
24
|
encodeWav(audio: DecodedAudio): ArrayBuffer;
|
|
25
25
|
encodeMp3(audio: DecodedAudio): ArrayBuffer;
|
|
26
26
|
}
|
|
27
|
+
/** One note to sound in an offline render. */
|
|
28
|
+
export type RenderEvent = {
|
|
29
|
+
midi: number;
|
|
30
|
+
startSec: number;
|
|
31
|
+
durationSec: number;
|
|
32
|
+
/** 0..1, as the synth voices expect. */
|
|
33
|
+
velocity: number;
|
|
34
|
+
midiProgram: number;
|
|
35
|
+
isPercussion: boolean;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Offline audio rendering — the platform-bound half of audio export.
|
|
39
|
+
*
|
|
40
|
+
* Takes events somebody else decided on (`renderEvents` in music_lib works out
|
|
41
|
+
* mute, solo and timing), so everything musical stays testable without an
|
|
42
|
+
* audio context and only the scheduling lives behind this interface.
|
|
43
|
+
*/
|
|
44
|
+
export interface AudioRenderer {
|
|
45
|
+
render(events: readonly RenderEvent[], durationSec: number): Promise<DecodedAudio>;
|
|
46
|
+
}
|
|
27
47
|
//# sourceMappingURL=audio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../src/platform/audio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,YAAY,GAAG;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzE,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAClD,SAAS,CAAC,KAAK,EAAE,YAAY,GAA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