chore: update dependencies

This commit is contained in:
Simon Chan 2025-01-25 04:23:57 +08:00
parent 01f812ea97
commit 7ad568d1b5
19 changed files with 256 additions and 257 deletions

View file

@ -30,7 +30,7 @@
"prepublishOnly": "npm run build"
},
"devDependencies": {
"@types/audioworklet": "^0.0.65",
"@types/audioworklet": "^0.0.67",
"@yume-chan/eslint-config": "workspace:^",
"@yume-chan/tsconfig": "workspace:^",
"prettier": "^3.4.2",

View file

@ -33,15 +33,13 @@ abstract class SourceProcessor<T>
this.channelCount = options.outputChannelCount![0]!;
this.#readBuffer = new Float32Array(this.channelCount);
this.port.onmessage = (event) => {
this.port.onmessage = ({ data }: MessageEvent<ArrayBuffer[]>) => {
while (this.#totalSampleCount > 0.35 * 48000) {
this.#chunks.shift();
const count = this.#chunkSampleCounts.shift()!;
this.#totalSampleCount -= count;
}
// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1860
const { data } = event as MessageEvent<ArrayBuffer[]>;
const [source, length] = this.createSource(data);
this.#chunks.push(source);
this.#chunkSampleCounts.push(length);