@opendaw/studio-core 0.0.24 → 0.0.25
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/AudioOfflineRenderer.d.ts +8 -0
- package/dist/AudioOfflineRenderer.d.ts.map +1 -0
- package/dist/AudioOfflineRenderer.js +88 -0
- package/dist/AudioWorklets.d.ts +1 -1
- package/dist/AudioWorklets.d.ts.map +1 -1
- package/dist/AudioWorklets.js +3 -2
- package/dist/FilePickerAcceptTypes.d.ts +8 -0
- package/dist/FilePickerAcceptTypes.d.ts.map +1 -0
- package/dist/FilePickerAcceptTypes.js +27 -0
- package/dist/MidiDevices.d.ts +2 -1
- package/dist/MidiDevices.d.ts.map +1 -1
- package/dist/MidiDevices.js +12 -1
- package/dist/WorkerAgents.d.ts +1 -1
- package/dist/WorkerAgents.d.ts.map +1 -1
- package/dist/WorkerAgents.js +3 -3
- package/dist/capture/CaptureAudio.d.ts.map +1 -1
- package/dist/capture/CaptureAudio.js +7 -2
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/processors.js +2 -2
- package/dist/processors.js.map +4 -4
- package/dist/project/Project.d.ts +1 -1
- package/dist/project/Project.d.ts.map +1 -1
- package/dist/project/Project.js +3 -3
- package/dist/project/ProjectEnv.d.ts +0 -7
- package/dist/project/ProjectEnv.d.ts.map +1 -1
- package/dist/samples/OpenSampleAPI.d.ts +14 -0
- package/dist/samples/OpenSampleAPI.d.ts.map +1 -0
- package/dist/samples/OpenSampleAPI.js +109 -0
- package/dist/samples/SampleAPI.d.ts +10 -0
- package/dist/samples/SampleAPI.d.ts.map +1 -0
- package/dist/samples/SampleAPI.js +1 -0
- package/dist/samples/SampleImporter.d.ts +11 -0
- package/dist/samples/SampleImporter.d.ts.map +1 -0
- package/dist/samples/SampleImporter.js +1 -0
- package/dist/workers.js +2 -2
- package/dist/workers.js.map +4 -4
- package/package.json +14 -14
@@ -0,0 +1,8 @@
|
|
1
|
+
import { int, Option } from "@opendaw/lib-std";
|
2
|
+
import { ExportStemsConfiguration } from "@opendaw/studio-adapters";
|
3
|
+
import { Project } from "./project/Project";
|
4
|
+
import { ProjectMeta } from "./project/ProjectMeta";
|
5
|
+
export declare namespace AudioOfflineRenderer {
|
6
|
+
const start: (source: Project, meta: ProjectMeta, optExportConfiguration: Option<ExportStemsConfiguration>, sampleRate?: int) => Promise<void>;
|
7
|
+
}
|
8
|
+
//# sourceMappingURL=AudioOfflineRenderer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AudioOfflineRenderer.d.ts","sourceRoot":"","sources":["../src/AudioOfflineRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,GAAG,EAAE,MAAM,EAAmC,MAAM,kBAAkB,CAAA;AAItG,OAAO,EAAC,wBAAwB,EAAC,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AAIjD,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,KAAK,GAAU,QAAQ,OAAO,EACf,MAAM,WAAW,EACjB,wBAAwB,MAAM,CAAC,wBAAwB,CAAC,EACxD,aAAY,GAAY,KAAG,OAAO,CAAC,IAAI,CA4BlE,CAAA;CA6CJ"}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import { DefaultObservableValue, panic, RuntimeNotifier, TimeSpan } from "@opendaw/lib-std";
|
2
|
+
import { PPQN } from "@opendaw/lib-dsp";
|
3
|
+
import { AnimationFrame, Errors, Files } from "@opendaw/lib-dom";
|
4
|
+
import { Promises, Wait } from "@opendaw/lib-runtime";
|
5
|
+
import { ExportStemsConfiguration } from "@opendaw/studio-adapters";
|
6
|
+
import { encodeWavFloat } from "./Wav";
|
7
|
+
import { AudioWorklets } from "./AudioWorklets";
|
8
|
+
export var AudioOfflineRenderer;
|
9
|
+
(function (AudioOfflineRenderer) {
|
10
|
+
AudioOfflineRenderer.start = async (source, meta, optExportConfiguration, sampleRate = 48_000) => {
|
11
|
+
const project = source.copy();
|
12
|
+
const numStems = ExportStemsConfiguration.countStems(optExportConfiguration);
|
13
|
+
const progress = new DefaultObservableValue(0.0);
|
14
|
+
const dialog = RuntimeNotifier.progress({ headline: "Rendering...", progress });
|
15
|
+
project.boxGraph.beginTransaction();
|
16
|
+
project.timelineBox.loopArea.enabled.setValue(false);
|
17
|
+
project.boxGraph.endTransaction();
|
18
|
+
const durationInPulses = project.timelineBox.durationInPulses.getValue();
|
19
|
+
const numSamples = PPQN.pulsesToSamples(durationInPulses, project.bpm, sampleRate);
|
20
|
+
const context = new OfflineAudioContext(numStems * 2, numSamples, sampleRate);
|
21
|
+
const durationInSeconds = numSamples / sampleRate;
|
22
|
+
const worklets = await AudioWorklets.install(context);
|
23
|
+
const engineWorklet = worklets.createEngine(project, optExportConfiguration.unwrapOrUndefined());
|
24
|
+
engineWorklet.play();
|
25
|
+
engineWorklet.connect(context.destination);
|
26
|
+
await engineWorklet.isReady();
|
27
|
+
while (!await engineWorklet.queryLoadingComplete()) {
|
28
|
+
await Wait.timeSpan(TimeSpan.seconds(1));
|
29
|
+
}
|
30
|
+
const terminable = AnimationFrame.add(() => progress.setValue(context.currentTime / durationInSeconds));
|
31
|
+
const buffer = await context.startRendering();
|
32
|
+
terminable.terminate();
|
33
|
+
dialog.terminate();
|
34
|
+
project.terminate();
|
35
|
+
if (optExportConfiguration.isEmpty()) {
|
36
|
+
await saveWavFile(buffer, meta);
|
37
|
+
}
|
38
|
+
else {
|
39
|
+
await saveZipFile(buffer, meta, Object.values(optExportConfiguration.unwrap()).map(({ fileName }) => fileName));
|
40
|
+
}
|
41
|
+
};
|
42
|
+
const saveWavFile = async (buffer, meta) => {
|
43
|
+
const approved = await RuntimeNotifier.approve({
|
44
|
+
headline: "Save Wav-File",
|
45
|
+
message: "",
|
46
|
+
approveText: "Save"
|
47
|
+
});
|
48
|
+
if (!approved) {
|
49
|
+
return;
|
50
|
+
}
|
51
|
+
const wavFile = encodeWavFloat(buffer);
|
52
|
+
const suggestedName = `${meta.name}.wav`;
|
53
|
+
const saveResult = await Promises.tryCatch(Files.save(wavFile, { suggestedName }));
|
54
|
+
if (saveResult.status === "rejected" && !Errors.isAbort(saveResult.error)) {
|
55
|
+
panic(String(saveResult.error));
|
56
|
+
}
|
57
|
+
};
|
58
|
+
const saveZipFile = async (buffer, meta, trackNames) => {
|
59
|
+
const { default: JSZip } = await import("jszip");
|
60
|
+
const dialog = RuntimeNotifier.progress({ headline: "Creating Zip File..." });
|
61
|
+
const numStems = buffer.numberOfChannels >> 1;
|
62
|
+
const zip = new JSZip();
|
63
|
+
for (let stemIndex = 0; stemIndex < numStems; stemIndex++) {
|
64
|
+
const l = buffer.getChannelData(stemIndex * 2);
|
65
|
+
const r = buffer.getChannelData(stemIndex * 2 + 1);
|
66
|
+
const file = encodeWavFloat({ channels: [l, r], sampleRate: buffer.sampleRate, numFrames: buffer.length });
|
67
|
+
zip.file(`${trackNames[stemIndex]}.wav`, file, { binary: true });
|
68
|
+
}
|
69
|
+
const arrayBuffer = await zip.generateAsync({
|
70
|
+
type: "arraybuffer",
|
71
|
+
compression: "DEFLATE",
|
72
|
+
compressionOptions: { level: 6 }
|
73
|
+
});
|
74
|
+
dialog.terminate();
|
75
|
+
const approved = await RuntimeNotifier.approve({
|
76
|
+
headline: "Save Zip",
|
77
|
+
message: `Size: ${arrayBuffer.byteLength >> 20}M`,
|
78
|
+
approveText: "Save"
|
79
|
+
});
|
80
|
+
if (!approved) {
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
const saveResult = await Promises.tryCatch(Files.save(arrayBuffer, { suggestedName: `${meta.name}.zip` }));
|
84
|
+
if (saveResult.status === "rejected") {
|
85
|
+
panic(String(saveResult.error));
|
86
|
+
}
|
87
|
+
};
|
88
|
+
})(AudioOfflineRenderer || (AudioOfflineRenderer = {}));
|
package/dist/AudioWorklets.d.ts
CHANGED
@@ -6,7 +6,7 @@ import { MeterWorklet } from "./MeterWorklet";
|
|
6
6
|
import { RecordingWorklet } from "./RecordingWorklet";
|
7
7
|
export declare class AudioWorklets {
|
8
8
|
#private;
|
9
|
-
static install(context: BaseAudioContext
|
9
|
+
static install(context: BaseAudioContext): Promise<AudioWorklets>;
|
10
10
|
static get(context: BaseAudioContext): AudioWorklets;
|
11
11
|
constructor(context: BaseAudioContext);
|
12
12
|
get context(): BaseAudioContext;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AudioWorklets.d.ts","sourceRoot":"","sources":["../src/AudioWorklets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAC,wBAAwB,EAAa,MAAM,0BAA0B,CAAA;AAC7E,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;
|
1
|
+
{"version":3,"file":"AudioWorklets.d.ts","sourceRoot":"","sources":["../src/AudioWorklets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAC,wBAAwB,EAAa,MAAM,0BAA0B,CAAA;AAC7E,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAKnD,qBAAa,aAAa;;WACT,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;IAQvE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,gBAAgB,GAAG,aAAa;gBAMxC,OAAO,EAAE,gBAAgB;IAErC,IAAI,OAAO,IAAI,gBAAgB,CAAuB;IAEtD,WAAW,CAAC,gBAAgB,EAAE,GAAG,GAAG,YAAY;IAIhD,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,CAAC,EAAE,wBAAwB,GAAG,aAAa;IAI7F,eAAe,CAAC,gBAAgB,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,GAAG,gBAAgB;CAOlG"}
|
package/dist/AudioWorklets.js
CHANGED
@@ -3,9 +3,10 @@ import { EngineWorklet } from "./EngineWorklet";
|
|
3
3
|
import { MeterWorklet } from "./MeterWorklet";
|
4
4
|
import { RecordingWorklet } from "./RecordingWorklet";
|
5
5
|
import { RenderQuantum } from "./RenderQuantum";
|
6
|
+
const WorkletsUrl = new URL("./processors.js", import.meta.url);
|
6
7
|
export class AudioWorklets {
|
7
|
-
static async install(context
|
8
|
-
return context.audioWorklet.addModule(
|
8
|
+
static async install(context) {
|
9
|
+
return context.audioWorklet.addModule(WorkletsUrl).then(() => {
|
9
10
|
const worklets = new AudioWorklets(context);
|
10
11
|
this.#map.set(context, worklets);
|
11
12
|
return worklets;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export declare namespace FilePickerAcceptTypes {
|
2
|
+
const WavFiles: FilePickerOptions;
|
3
|
+
const ProjectSyncLog: FilePickerOptions;
|
4
|
+
const ProjectFileType: FilePickerAcceptType;
|
5
|
+
const ProjectBundleFileType: FilePickerAcceptType;
|
6
|
+
const DawprojectFileType: FilePickerAcceptType;
|
7
|
+
}
|
8
|
+
//# sourceMappingURL=FilePickerAcceptTypes.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FilePickerAcceptTypes.d.ts","sourceRoot":"","sources":["../src/FilePickerAcceptTypes.ts"],"names":[],"mappings":"AAAA,yBAAiB,qBAAqB,CAAC;IAC5B,MAAM,QAAQ,EAAE,iBAKtB,CAAA;IACM,MAAM,cAAc,EAAE,iBAK5B,CAAA;IAEM,MAAM,eAAe,EAAE,oBAG7B,CAAA;IAEM,MAAM,qBAAqB,EAAE,oBAGnC,CAAA;IAEM,MAAM,kBAAkB,EAAE,oBAGhC,CAAA;CACJ"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
export var FilePickerAcceptTypes;
|
2
|
+
(function (FilePickerAcceptTypes) {
|
3
|
+
FilePickerAcceptTypes.WavFiles = {
|
4
|
+
types: [{
|
5
|
+
description: "wav-file",
|
6
|
+
accept: { "audio/wav": [".wav"] }
|
7
|
+
}]
|
8
|
+
};
|
9
|
+
FilePickerAcceptTypes.ProjectSyncLog = {
|
10
|
+
types: [{
|
11
|
+
description: "openDAW sync-log-file",
|
12
|
+
accept: { "application/octet-stream": [".odsl"] }
|
13
|
+
}]
|
14
|
+
};
|
15
|
+
FilePickerAcceptTypes.ProjectFileType = {
|
16
|
+
description: "openDAW project",
|
17
|
+
accept: { "application/octet-stream": [".od"] }
|
18
|
+
};
|
19
|
+
FilePickerAcceptTypes.ProjectBundleFileType = {
|
20
|
+
description: "openDAW project bundle",
|
21
|
+
accept: { "application/octet-stream": [".odb"] }
|
22
|
+
};
|
23
|
+
FilePickerAcceptTypes.DawprojectFileType = {
|
24
|
+
description: "dawproject",
|
25
|
+
accept: { "application/octet-stream": [".dawproject"] }
|
26
|
+
};
|
27
|
+
})(FilePickerAcceptTypes || (FilePickerAcceptTypes = {}));
|
package/dist/MidiDevices.d.ts
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
import { MutableObservableValue, ObservableOption, Option } from "@opendaw/lib-std";
|
1
|
+
import { byte, MutableObservableValue, ObservableOption, Observer, Option, Subscription } from "@opendaw/lib-std";
|
2
2
|
export declare class MidiDevices {
|
3
3
|
#private;
|
4
4
|
static canRequestMidiAccess(): boolean;
|
5
5
|
static requestPermission(): Promise<undefined>;
|
6
6
|
static get(): ObservableOption<MIDIAccess>;
|
7
|
+
static subscribeMessageEvents(observer: Observer<MIDIMessageEvent>, channel?: byte): Subscription;
|
7
8
|
static inputs(): Option<ReadonlyArray<MIDIInput>>;
|
8
9
|
static outputs(): Option<ReadonlyArray<MIDIOutput>>;
|
9
10
|
static panic(): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MidiDevices.d.ts","sourceRoot":"","sources":["../src/MidiDevices.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"MidiDevices.d.ts","sourceRoot":"","sources":["../src/MidiDevices.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,IAAI,EAGJ,sBAAsB,EAEtB,gBAAgB,EAEhB,QAAQ,EACR,MAAM,EACN,YAAY,EAGf,MAAM,kBAAkB,CAAA;AAKzB,qBAAa,WAAW;;IACpB,MAAM,CAAC,oBAAoB,IAAI,OAAO;WAEzB,iBAAiB;IAiB9B,MAAM,CAAC,GAAG,IAAI,gBAAgB,CAAC,UAAU,CAAC;IAE1C,MAAM,CAAC,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,EAAE,IAAI,GAAG,YAAY;IAWjG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAIjD,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAInD,MAAM,CAAC,KAAK,IAAI,IAAI;IAkBpB,MAAM,CAAC,SAAS,IAAI,sBAAsB,CAAC,OAAO,CAAC;CAqCtD"}
|
package/dist/MidiDevices.js
CHANGED
@@ -7,9 +7,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
9
|
};
|
10
|
-
import { Lazy, MutableObservableOption, MutableObservableValue, Notifier, warn } from "@opendaw/lib-std";
|
10
|
+
import { Lazy, MutableObservableOption, MutableObservableValue, Notifier, Terminator, warn } from "@opendaw/lib-std";
|
11
11
|
import { MidiData } from "@opendaw/lib-midi";
|
12
12
|
import { Promises } from "@opendaw/lib-runtime";
|
13
|
+
import { MIDIMessageSubscriber } from "@opendaw/app-studio/src/midi/devices/MIDIMessageSubscriber";
|
13
14
|
export class MidiDevices {
|
14
15
|
static canRequestMidiAccess() { return "requestMIDIAccess" in navigator; }
|
15
16
|
static async requestPermission() {
|
@@ -29,6 +30,16 @@ export class MidiDevices {
|
|
29
30
|
}
|
30
31
|
}
|
31
32
|
static get() { return this.#midiAccess; }
|
33
|
+
static subscribeMessageEvents(observer, channel) {
|
34
|
+
return this.get().match({
|
35
|
+
none: () => {
|
36
|
+
const terminator = new Terminator();
|
37
|
+
terminator.own(this.available().subscribe(() => terminator.own(this.subscribeMessageEvents(observer, channel))));
|
38
|
+
return terminator;
|
39
|
+
},
|
40
|
+
some: midi => MIDIMessageSubscriber.subscribeMessageEvents(midi, observer, channel)
|
41
|
+
});
|
42
|
+
}
|
32
43
|
static inputs() {
|
33
44
|
return this.get().map(({ inputs }) => Array.from(inputs.values()));
|
34
45
|
}
|
package/dist/WorkerAgents.d.ts
CHANGED
@@ -2,7 +2,7 @@ import { Option } from "@opendaw/lib-std";
|
|
2
2
|
import type { OpfsProtocol, SamplePeakProtocol } from "@opendaw/lib-fusion";
|
3
3
|
import { Messenger } from "@opendaw/lib-runtime";
|
4
4
|
export declare class WorkerAgents {
|
5
|
-
static install(
|
5
|
+
static install(): void;
|
6
6
|
static messenger: Option<Messenger>;
|
7
7
|
static get Peak(): SamplePeakProtocol;
|
8
8
|
static get Opfs(): OpfsProtocol;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WorkerAgents.d.ts","sourceRoot":"","sources":["../src/WorkerAgents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,EAAY,MAAM,kBAAkB,CAAA;AACzE,OAAO,KAAK,EAAC,YAAY,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAA;AAEzE,OAAO,EAAe,SAAS,EAAC,MAAM,sBAAsB,CAAA;
|
1
|
+
{"version":3,"file":"WorkerAgents.d.ts","sourceRoot":"","sources":["../src/WorkerAgents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,EAAY,MAAM,kBAAkB,CAAA;AACzE,OAAO,KAAK,EAAC,YAAY,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAA;AAEzE,OAAO,EAAe,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAI5D,qBAAa,YAAY;IACrB,MAAM,CAAC,OAAO,IAAI,IAAI;IAItB,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAc;IAGjD,MAAM,KAAK,IAAI,IAAI,kBAAkB,CAapC;IAGD,MAAM,KAAK,IAAI,IAAI,YAAY,CAS9B;CACJ"}
|
package/dist/WorkerAgents.js
CHANGED
@@ -9,10 +9,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
};
|
10
10
|
import { Lazy, Option } from "@opendaw/lib-std";
|
11
11
|
import { Communicator, Messenger } from "@opendaw/lib-runtime";
|
12
|
+
const WorkerUrl = new URL("./workers.js", import.meta.url);
|
12
13
|
export class WorkerAgents {
|
13
|
-
static install(
|
14
|
-
|
15
|
-
this.messenger = Option.wrap(Messenger.for(new Worker(workerURL, { type: "module" })));
|
14
|
+
static install() {
|
15
|
+
this.messenger = Option.wrap(Messenger.for(new Worker(WorkerUrl, { type: "module" })));
|
16
16
|
}
|
17
17
|
static messenger = Option.None;
|
18
18
|
static get Peak() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CaptureAudio.d.ts","sourceRoot":"","sources":["../../src/capture/CaptureAudio.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,uBAAuB,EACvB,MAAM,EAEN,UAAU,EAEb,MAAM,kBAAkB,CAAA;A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AC,MAAM,CAAC,CAEnC;IAED,IAAI,KAAK,IAAI,MAAM,CAAsE;IAEzF,IAAI,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,CAA+D;IAEhG,IAAI,gBAAgB,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAE/C;IAEK,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBvC,cAAc,IAAI,UAAU;CA+D/B"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { abort, isDefined, isUndefined, MutableObservableOption, Option,
|
1
|
+
import { abort, isDefined, isUndefined, MutableObservableOption, Option, RuntimeNotifier, Terminable, warn } from "@opendaw/lib-std";
|
2
2
|
import { Promises } from "@opendaw/lib-runtime";
|
3
3
|
import { Capture } from "./Capture";
|
4
4
|
import { RecordAudio } from "./RecordAudio";
|
@@ -43,7 +43,12 @@ export class CaptureAudio extends Capture {
|
|
43
43
|
const { project } = this.manager;
|
44
44
|
const { env: { audioContext } } = project;
|
45
45
|
if (isUndefined(audioContext.outputLatency)) {
|
46
|
-
const approved =
|
46
|
+
const approved = RuntimeNotifier.approve({
|
47
|
+
headline: "Warning",
|
48
|
+
message: "Your browser does not support 'output latency'. This will cause timing issue while recording.",
|
49
|
+
approveText: "Ignore",
|
50
|
+
cancelText: "Cancel"
|
51
|
+
});
|
47
52
|
if (!approved) {
|
48
53
|
return abort("Recording cancelled");
|
49
54
|
}
|
package/dist/index.d.ts
CHANGED
@@ -4,6 +4,9 @@ export * from "./sync-log/SyncLogWriter";
|
|
4
4
|
export * from "./samples/SampleStorage";
|
5
5
|
export * from "./samples/MainThreadSampleLoader";
|
6
6
|
export * from "./samples/MainThreadSampleManager";
|
7
|
+
export * from "./samples/OpenSampleAPI";
|
8
|
+
export * from "./samples/SampleAPI";
|
9
|
+
export * from "./samples/SampleImporter";
|
7
10
|
export * from "./samples/SampleProvider";
|
8
11
|
export * from "./capture/Capture";
|
9
12
|
export * from "./capture/CaptureAudio";
|
@@ -22,6 +25,7 @@ export * from "./project/ProjectMeta";
|
|
22
25
|
export * from "./project/ProjectPaths";
|
23
26
|
export * from "./project/ProjectProfile";
|
24
27
|
export * from "./AudioDevices";
|
28
|
+
export * from "./AudioOfflineRenderer";
|
25
29
|
export * from "./AudioUnitOrdering";
|
26
30
|
export * from "./ColorCodes";
|
27
31
|
export * from "./Colors";
|
@@ -31,6 +35,7 @@ export * from "./EffectFactories";
|
|
31
35
|
export * from "./Engine";
|
32
36
|
export * from "./EngineFacade";
|
33
37
|
export * from "./EngineWorklet";
|
38
|
+
export * from "./FilePickerAcceptTypes";
|
34
39
|
export * from "./InstrumentBox";
|
35
40
|
export * from "./InstrumentFactories";
|
36
41
|
export * from "./InstrumentFactory";
|
@@ -40,6 +45,7 @@ export * from "./MeterWorklet";
|
|
40
45
|
export * from "./MidiDevices";
|
41
46
|
export * from "./Mixer";
|
42
47
|
export * from "./PeaksWriter";
|
48
|
+
export * from "./RenderQuantum";
|
43
49
|
export * from "./Wav";
|
44
50
|
export * from "./WorkerAgents";
|
45
51
|
export * from "./AudioWorklets";
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AAExC,cAAc,yBAAyB,CAAA;AACvC,cAAc,kCAAkC,CAAA;AAChD,cAAc,mCAAmC,CAAA;AACjD,cAAc,0BAA0B,CAAA;AAExC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AAEnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAE7C,cAAc,mBAAmB,CAAA;AACjC,cAAc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,iCAAiC,CAAA;AAC/C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAE7C,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AAExC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,OAAO,CAAA;AACrB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
@@ -4,6 +4,9 @@ export * from "./sync-log/SyncLogWriter";
|
|
4
4
|
export * from "./samples/SampleStorage";
|
5
5
|
export * from "./samples/MainThreadSampleLoader";
|
6
6
|
export * from "./samples/MainThreadSampleManager";
|
7
|
+
export * from "./samples/OpenSampleAPI";
|
8
|
+
export * from "./samples/SampleAPI";
|
9
|
+
export * from "./samples/SampleImporter";
|
7
10
|
export * from "./samples/SampleProvider";
|
8
11
|
export * from "./capture/Capture";
|
9
12
|
export * from "./capture/CaptureAudio";
|
@@ -22,6 +25,7 @@ export * from "./project/ProjectMeta";
|
|
22
25
|
export * from "./project/ProjectPaths";
|
23
26
|
export * from "./project/ProjectProfile";
|
24
27
|
export * from "./AudioDevices";
|
28
|
+
export * from "./AudioOfflineRenderer";
|
25
29
|
export * from "./AudioUnitOrdering";
|
26
30
|
export * from "./ColorCodes";
|
27
31
|
export * from "./Colors";
|
@@ -31,6 +35,7 @@ export * from "./EffectFactories";
|
|
31
35
|
export * from "./Engine";
|
32
36
|
export * from "./EngineFacade";
|
33
37
|
export * from "./EngineWorklet";
|
38
|
+
export * from "./FilePickerAcceptTypes";
|
34
39
|
export * from "./InstrumentBox";
|
35
40
|
export * from "./InstrumentFactories";
|
36
41
|
export * from "./InstrumentFactory";
|
@@ -40,6 +45,7 @@ export * from "./MeterWorklet";
|
|
40
45
|
export * from "./MidiDevices";
|
41
46
|
export * from "./Mixer";
|
42
47
|
export * from "./PeaksWriter";
|
48
|
+
export * from "./RenderQuantum";
|
43
49
|
export * from "./Wav";
|
44
50
|
export * from "./WorkerAgents";
|
45
51
|
export * from "./AudioWorklets";
|