tone 15.2.9 → 15.2.10
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/core/context/Context.test.ts +2 -0
- package/Tone/core/context/Context.ts +5 -1
- package/Tone/version.ts +1 -1
- package/build/Tone.js +1 -1
- package/build/Tone.js.map +1 -1
- package/build/esm/core/context/Context.d.ts +1 -0
- package/build/esm/core/context/Context.js +4 -1
- package/build/esm/core/context/Context.js.map +1 -1
- package/build/esm/version.js +1 -1
- package/build/esm/version.js.map +1 -1
- package/package.json +1 -1
|
@@ -74,11 +74,13 @@ describe("Context", () => {
|
|
|
74
74
|
latencyHint: "playback",
|
|
75
75
|
lookAhead: 0.2,
|
|
76
76
|
updateInterval: 0.1,
|
|
77
|
+
sampleRate: 32000,
|
|
77
78
|
});
|
|
78
79
|
expect(ctx.lookAhead).to.equal(0.2);
|
|
79
80
|
expect(ctx.updateInterval).to.equal(0.1);
|
|
80
81
|
expect(ctx.latencyHint).to.equal("playback");
|
|
81
82
|
expect(ctx.clockSource).to.equal("timeout");
|
|
83
|
+
expect(ctx.sampleRate).to.equal(32000);
|
|
82
84
|
ctx.dispose();
|
|
83
85
|
return ctx.close();
|
|
84
86
|
});
|
|
@@ -23,6 +23,7 @@ export interface ContextOptions {
|
|
|
23
23
|
lookAhead: Seconds;
|
|
24
24
|
updateInterval: Seconds;
|
|
25
25
|
context: AnyAudioContext;
|
|
26
|
+
sampleRate: number;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export interface ContextTimeoutEvent {
|
|
@@ -116,7 +117,10 @@ export class Context extends BaseContext {
|
|
|
116
117
|
// custom context provided, latencyHint unknown (unless explicitly provided in options)
|
|
117
118
|
this._latencyHint = arguments[0]?.latencyHint || "";
|
|
118
119
|
} else {
|
|
119
|
-
this._context = createAudioContext({
|
|
120
|
+
this._context = createAudioContext(options.sampleRate ? {
|
|
121
|
+
latencyHint: options.latencyHint,
|
|
122
|
+
sampleRate: options.sampleRate,
|
|
123
|
+
} : {
|
|
120
124
|
latencyHint: options.latencyHint,
|
|
121
125
|
});
|
|
122
126
|
this._latencyHint = options.latencyHint;
|
package/Tone/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version: string = "15.2.
|
|
1
|
+
export const version: string = "15.2.10";
|