chrisguttandin / standardized-audio-context

A cross-browser wrapper for the Web Audio API which aims to closely follow the standard.
MIT License
679 stars 33 forks source link

`AudioWorkletNode` TypeError: The superclass is not a constructor. #998

Closed maximedupre closed 1 year ago

maximedupre commented 1 year ago

This might be a bad bug ticket, because I'm not sure it's easily reproducible, so feel free to close it right away. I'm simply taking a chance in case you have a solution 😁

On Safari iOS 16.2 → export class WAMController extends AudioWorkletNode causes this error message:

Error: Uncaught (in promise): TypeError: The superclass is not a constructor.

When I log AudioWorkletNode I get undefined.

import { AudioWorkletNode } from 'standardized-audio-context';

console.log(AudioWorkletNode); // undefined

When I log the whole module, funny enough, only the AudioWorkletNode is missing 😅🤷🏻‍♂️

image

I'm not sure if this has something to do with the Angular build chain, or the fact that I'm using Tone.js (uses standardized-audio-context as a dep)

Anyway, thanks for reading 😁

Edit

addAudioWorkletModule is also missing 🤔

maximedupre commented 1 year ago

Found the issue - AudioWorklet only works in a secure context 🥲 So when using localhost, you need to serve your app via HTTPS (self-signed certificates).

chrisguttandin commented 1 year ago

Yes, I was just going to reply exactly that. :-) But normally localhost is considered to be a secure context.