Describe The Problem To Be Solved
The property srcObject on HTMLAudioElement is of type MediaProvider, however the type for src in the audio package restricts only to a subset, that is MediaSource.
For example, this is perfectly valid:
const destination:MediaStreamAudioDestinationNode = context.createMediaStreamDestination();
const bufferSource:AudioBufferSourceNode = context.createBufferSource();
bufferSource.buffer = buffer;
bufferSource.start(0);
bufferSource.connect(context.destination);
state.player.srcObject = destination.stream satisfies MediaStream;
However, destination.stream is not a valid AudioSource according the declaration.
Suggest A Solution
Change
type AudioSource = string | undefined | HTMLAudioElement | MediaSource | (string & MediaSource);
to
type AudioSource = string | undefined | HTMLAudioElement | MediaProvider | (string & MediaProvider);
Describe The Problem To Be Solved
The property
srcObjectonHTMLAudioElementis of typeMediaProvider, however the type forsrcin the audio package restricts only to a subset, that isMediaSource.For example, this is perfectly valid:
However,
destination.streamis not a validAudioSourceaccording the declaration.Suggest A Solution
Change
to