question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

AudioWorkletProcessor type definition is missing

See original GitHub issue

TypeScript Version: 3.2.0-dev.201xxxxx

Search Terms: AudioWorkletProcessor

You guys have type definitions for AudioWorkletNode and such but missed the definition for AudioWorkletProcessor as per: https://webaudio.github.io/web-audio-api/#audioworkletprocessor

This is what I have for now:

interface AudioWorkletProcessor {
    readonly port: MessagePort;
    process(inputs: Float32Array[][], outputs: Float32Array[][], parameters: Map<string, Float32Array>): void;
}

declare var AudioWorkletProcessor: {
    prototype: AudioWorkletProcessor;
    new(options?: AudioWorkletNodeOptions): AudioWorkletProcessor;
}

Cheers

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:24
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
roddyprattcommented, Feb 5, 2022

I think the typescript DOM lib generator publishes this to package @types/audioworklet but that needs to be manually added to your package.json

10reactions
joanrieucommented, Jun 28, 2020

The definition of registerProcessor was missing as well.

Iโ€™m using the following definitions:

interface AudioWorkletProcessor {
  readonly port: MessagePort;
  process(
    inputs: Float32Array[][],
    outputs: Float32Array[][],
    parameters: Record<string, Float32Array>
  ): boolean;
}

declare var AudioWorkletProcessor: {
  prototype: AudioWorkletProcessor;
  new (options?: AudioWorkletNodeOptions): AudioWorkletProcessor;
};

declare function registerProcessor(
  name: string,
  processorCtor: (new (
    options?: AudioWorkletNodeOptions
  ) => AudioWorkletProcessor) & {
    parameterDescriptors?: AudioParamDescriptor[];
  }
);


EDIT: added the parameter descriptors to the registerProcessor() declaration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript web audio API missing definitions
I'm defining my audio context like this: var audioCtx: AudioContext; It works as the AudioContext definition is present in the lib.d.ts fileย ...
Read more >
types/audioworklet
@types/audioworklet. TypeScript icon, indicating that this package has built-in type declarations ยท Keywords.
Read more >
AudioWorkletProcessor.process() - Web APIs | MDN
A node that transforms its input, but has a so-called tail-time โ€” this means that it will produce an output for some time...
Read more >
Finding + Fixing a AudioWorkletProcessor Performance Pitfall
Clicking and popping audio is this kind of situation is usually due to the DSP code overrunning its time budget and missing frames...
Read more >
Web Audio API
An AudioWorkletProcessor interface, representing a single node instance ... An event of type Event will be dispatched to the event handler,ย ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found