does anybody know how to use streams in 2025? all issues related are outdated.
function startWave(stream) {
const canvas = document.querySelector("canvas");
const audioCtx = new AudioContext();
const src = audioCtx.createMediaStreamSource(stream);
console.log(src);
console.log(stream);
let wave = new Wave(src, canvas);
wave.addAnimation(new wave.animations.Wave({
lineWidth: 10,
lineColor: "red",
count: 20
}));
console.log("animating?")
};
document.getElementById("share").addEventListener("click", async () => {
const stream = await navigator.mediaDevices.getDisplayMedia({
video: true,
audio: {
echoCancellation: false,
noiseSuppression: false,
sampleRate: 44100
}
});
const audioStream = new MediaStream(stream.getAudioTracks()); //for non chrome users
startWave(audioStream);
});
src and stream log fine look fine but im not seeing any animations
does anybody know how to use streams in 2025? all issues related are outdated.
src and stream log fine look fine but im not seeing any animations