I'm trying to get the output of the speaker and then do what ever I want with this stream .
I tried to use this to get the speaker's stream:
var mySpeakerStream = new MediaStream();
navigator.mediaDevices.getUserMedia({audio: {deviceId : {exact: mySpeakerId} } }).then(s => {
myStream.addTrack(s.getAudioTracks()[0]);
}).catch( console.log('failed') );
I expected to get the speaker but I did not , then I realised that the getUserMedia method returns a MediaStream of an input device only. Is there any way to get a stream of the speaker's output?