Merge pull request #1159 from jdanford/update-standardized-audio-context

Update standardized-audio-context, fix little lint errors
This commit is contained in:
Yotam Mann 2023-01-26 17:51:11 -05:00 committed by GitHub
commit 47d464487e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 73 additions and 72 deletions

View file

@ -5,7 +5,7 @@ module.exports = {
rules: {
"prefer-rest-params": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/ban-ts-comment" : "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "off",
"jsdoc/check-alignment": 1,
"jsdoc/check-param-names": ["error"],

View file

@ -200,7 +200,7 @@ export class TickSource<TypeName extends "bpm" | "hertz"> extends ToneWithContex
if (lastState.state === "started" && e.state !== "started") {
elapsedTicks += this.frequency.getTicksAtTime(e.time) - this.frequency.getTicksAtTime(periodStartTime);
// do not memoize the temporary event
if (e.time != tmpEvent.time) {
if (e.time !== tmpEvent.time) {
eventToMemoize = { state: e.state, time: e.time, ticks: elapsedTicks };
}
}
@ -275,7 +275,7 @@ export class TickSource<TypeName extends "bpm" | "hertz"> extends ToneWithContex
if (lastState.state === "started" && e.state !== "started") {
elapsedSeconds += e.time - periodStartTime;
// do not memoize the temporary event
if (e.time != tmpEvent.time) {
if (e.time !== tmpEvent.time) {
eventToMemoize = { state: e.state, time: e.time, seconds: elapsedSeconds };
}
}

View file

@ -42,7 +42,7 @@ export class Ticker {
this._callback = callback;
this._type = type;
this._minimumUpdateInterval = Math.max( 128/(contextSampleRate || 44100), .001 );
this._minimumUpdateInterval = Math.max(128/(contextSampleRate || 44100), .001);
this.updateInterval = updateInterval;
// create the clock source for the first time

View file

@ -1,3 +1,4 @@
/* eslint-disable key-spacing */
import { getContext } from "../Global";
import { intervalToFrequencyRatio, mtof } from "./Conversions";
import { ftom, getA4, setA4 } from "./Conversions";

View file

@ -32,7 +32,7 @@ type ToneObject = {
* Bind the TimeBaseClass to the context
*/
function bindTypeClass(context: Context, type) {
return (...args: any[]) => new type(context, ...args);
return (...args: unknown[]) => new type(context, ...args);
}
/**

View file

@ -709,12 +709,12 @@ describe("Player", () => {
setTimeout(() => {
player.restart(undefined, undefined, 1);
const checkStopTimes = new Set();
player["_activeSources"].forEach(source => {
checkStopTimes.add(source["_stopTime"]);
player._activeSources.forEach(source => {
checkStopTimes.add(source._stopTime);
});
getContext().lookAhead = originalLookAhead;
// ensure each source has a different stopTime
expect(checkStopTimes.size).to.equal(player["_activeSources"].size);
expect(checkStopTimes.size).to.equal(player._activeSources.size);
done();
}, 250);
},

88
package-lock.json generated
View file

@ -9,7 +9,7 @@
"version": "14.8.0",
"license": "MIT",
"dependencies": {
"standardized-audio-context": "^25.3.29",
"standardized-audio-context": "^25.3.37",
"tslib": "^2.3.1"
},
"devDependencies": {
@ -417,20 +417,20 @@
}
},
"node_modules/@babel/runtime": {
"version": "7.18.9",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz",
"integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==",
"version": "7.20.13",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.13.tgz",
"integrity": "sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==",
"dependencies": {
"regenerator-runtime": "^0.13.4"
"regenerator-runtime": "^0.13.11"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/runtime/node_modules/regenerator-runtime": {
"version": "0.13.9",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
},
"node_modules/@babel/template": {
"version": "7.18.10",
@ -1544,15 +1544,15 @@
"dev": true
},
"node_modules/automation-events": {
"version": "4.0.20",
"resolved": "https://registry.npmjs.org/automation-events/-/automation-events-4.0.20.tgz",
"integrity": "sha512-ALTOLrB4vTyXOsLPia8OKM1qZKtlsGC+3VDe3jcCGUpvgKTbqlzvaJU3HqDhU6jlVEMMBqT01XZv3K/3Z5g29w==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/automation-events/-/automation-events-5.0.0.tgz",
"integrity": "sha512-SkYa2YBwgRUJNsR5v6GxeJwP5IGnYtOMW37coplTOWMUpDYYrk5j8gGOhYa765rchRln/HssFzMAck/2P6zTFw==",
"dependencies": {
"@babel/runtime": "^7.18.9",
"tslib": "^2.4.0"
"@babel/runtime": "^7.20.7",
"tslib": "^2.4.1"
},
"engines": {
"node": ">=12.20.1"
"node": ">=14.15.4"
}
},
"node_modules/available-typed-arrays": {
@ -8780,13 +8780,13 @@
"dev": true
},
"node_modules/standardized-audio-context": {
"version": "25.3.29",
"resolved": "https://registry.npmjs.org/standardized-audio-context/-/standardized-audio-context-25.3.29.tgz",
"integrity": "sha512-5RqrvuaphiR3W2t8nd8PRBhQKXTTf0gHu8I0BukH3A11C9ZHQQmeE9WywBe68TcYBj9DCm42db8OWTw1PluLUA==",
"version": "25.3.37",
"resolved": "https://registry.npmjs.org/standardized-audio-context/-/standardized-audio-context-25.3.37.tgz",
"integrity": "sha512-lr0+RH/IJXYMts95oYKIJ+orTmstOZN3GXWVGmlkbMj8OLahREkRh7DhNGLYgBGDkBkhhc4ev5pYGSFN3gltHw==",
"dependencies": {
"@babel/runtime": "^7.18.9",
"automation-events": "^4.0.20",
"tslib": "^2.4.0"
"@babel/runtime": "^7.20.7",
"automation-events": "^5.0.0",
"tslib": "^2.4.1"
}
},
"node_modules/statuses": {
@ -9427,9 +9427,9 @@
}
},
"node_modules/tslib": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA=="
},
"node_modules/tsutils": {
"version": "3.21.0",
@ -10650,17 +10650,17 @@
"dev": true
},
"@babel/runtime": {
"version": "7.18.9",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz",
"integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==",
"version": "7.20.13",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.13.tgz",
"integrity": "sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==",
"requires": {
"regenerator-runtime": "^0.13.4"
"regenerator-runtime": "^0.13.11"
},
"dependencies": {
"regenerator-runtime": {
"version": "0.13.9",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
}
}
},
@ -11552,12 +11552,12 @@
"dev": true
},
"automation-events": {
"version": "4.0.20",
"resolved": "https://registry.npmjs.org/automation-events/-/automation-events-4.0.20.tgz",
"integrity": "sha512-ALTOLrB4vTyXOsLPia8OKM1qZKtlsGC+3VDe3jcCGUpvgKTbqlzvaJU3HqDhU6jlVEMMBqT01XZv3K/3Z5g29w==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/automation-events/-/automation-events-5.0.0.tgz",
"integrity": "sha512-SkYa2YBwgRUJNsR5v6GxeJwP5IGnYtOMW37coplTOWMUpDYYrk5j8gGOhYa765rchRln/HssFzMAck/2P6zTFw==",
"requires": {
"@babel/runtime": "^7.18.9",
"tslib": "^2.4.0"
"@babel/runtime": "^7.20.7",
"tslib": "^2.4.1"
}
},
"available-typed-arrays": {
@ -17292,13 +17292,13 @@
"dev": true
},
"standardized-audio-context": {
"version": "25.3.29",
"resolved": "https://registry.npmjs.org/standardized-audio-context/-/standardized-audio-context-25.3.29.tgz",
"integrity": "sha512-5RqrvuaphiR3W2t8nd8PRBhQKXTTf0gHu8I0BukH3A11C9ZHQQmeE9WywBe68TcYBj9DCm42db8OWTw1PluLUA==",
"version": "25.3.37",
"resolved": "https://registry.npmjs.org/standardized-audio-context/-/standardized-audio-context-25.3.37.tgz",
"integrity": "sha512-lr0+RH/IJXYMts95oYKIJ+orTmstOZN3GXWVGmlkbMj8OLahREkRh7DhNGLYgBGDkBkhhc4ev5pYGSFN3gltHw==",
"requires": {
"@babel/runtime": "^7.18.9",
"automation-events": "^4.0.20",
"tslib": "^2.4.0"
"@babel/runtime": "^7.20.7",
"automation-events": "^5.0.0",
"tslib": "^2.4.1"
}
},
"statuses": {
@ -17781,9 +17781,9 @@
}
},
"tslib": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA=="
},
"tsutils": {
"version": "3.21.0",

View file

@ -103,7 +103,7 @@
"yargs": "^17.3.0"
},
"dependencies": {
"standardized-audio-context": "^25.3.29",
"standardized-audio-context": "^25.3.37",
"tslib": "^2.3.1"
},
"prettier": {