tone 15.1.15 → 15.1.16
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/Tone/component/channel/Recorder.test.ts +13 -0
- package/Tone/component/channel/Recorder.ts +6 -3
- package/Tone/version.ts +1 -1
- package/build/Tone.js +1 -1
- package/build/Tone.js.map +1 -1
- package/build/esm/component/channel/Recorder.d.ts +1 -1
- package/build/esm/component/channel/Recorder.js +7 -2
- package/build/esm/component/channel/Recorder.js.map +1 -1
- package/build/esm/version.js +1 -1
- package/package.json +1 -1
|
@@ -68,6 +68,19 @@ describe("Recorder", () => {
|
|
|
68
68
|
rec.dispose();
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
+
it("can be resumed after pausing", async () => {
|
|
72
|
+
const rec = new Recorder();
|
|
73
|
+
rec.start();
|
|
74
|
+
expect(rec.state).to.equal("started");
|
|
75
|
+
await wait(100);
|
|
76
|
+
rec.pause();
|
|
77
|
+
expect(rec.state).to.equal("paused");
|
|
78
|
+
await wait(100);
|
|
79
|
+
rec.start();
|
|
80
|
+
expect(rec.state).to.equal("started");
|
|
81
|
+
rec.dispose();
|
|
82
|
+
});
|
|
83
|
+
|
|
71
84
|
it("can be stopped after starting", async () => {
|
|
72
85
|
const rec = new Recorder();
|
|
73
86
|
rec.start();
|
|
@@ -107,7 +107,7 @@ export class Recorder extends ToneAudioNode<RecorderOptions> {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* Start the Recorder. Returns a promise which resolves
|
|
110
|
+
* Start/Resume the Recorder. Returns a promise which resolves
|
|
111
111
|
* when the recorder has started.
|
|
112
112
|
*/
|
|
113
113
|
async start() {
|
|
@@ -121,8 +121,11 @@ export class Recorder extends ToneAudioNode<RecorderOptions> {
|
|
|
121
121
|
|
|
122
122
|
this._recorder.addEventListener("start", handleStart, false);
|
|
123
123
|
});
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
if(this.state === "stopped") {
|
|
125
|
+
this._recorder.start();
|
|
126
|
+
} else {
|
|
127
|
+
this._recorder.resume();
|
|
128
|
+
}
|
|
126
129
|
return await startPromise;
|
|
127
130
|
}
|
|
128
131
|
|
package/Tone/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version: string = "15.1.
|
|
1
|
+
export const version: string = "15.1.16";
|