I am trying to get the user's audio output that is heard in the user's speaker and not from the user's microphone. I currently get's audio input from the microphone with this code
startRecording.onclick = function() {
navigator.getUserMedia({
audio: true
}, function(stream) {
recordAudio = RecordRTC(stream, {
type: 'audio',
mimeType: 'audio/webm',
sampleRate: 44100,
desiredSampRate: 16000,
recorderType: StereoAudioRecorder,
numberOfAudioChannels: 1,
timeSlice: 4000,
ondataavailable: function(blob) {
console.log('ondataavailable');
var stream = ss.createStream();
ss(socket).emit('stream-media', stream, {
name: 'stream.wav',
size: blob.size
});
ss.createBlobReadStream(blob).pipe(stream);
}
});
recordAudio.startRecording();
}, function(error) {
console.error(JSON.stringify(error));
});
};
the code above works fine to get the audio input from the microphone but how can I get user's audio output separate from the microphone input?