Closed Tuner32 closed 3 years ago
Solved
Ehh really!? That's nice!
I haven't finished improving the library, and sadly the MediaRecorder must have a MediaStream as the parameter. So I should do some workaround to make it possible to not recording the mic/camera/screen.
Yes, you are right, I have to make mediastream , So I just used captureStream to change mediastream and loop with autoplay and I put on mediaGranted. I think it is not way to disable mic, But it work well.
The AudioStreamer on v1.3.0 now expose the audio element. I haven't test it for your case, but you can now use the audio element directly from AudioStreamer's instance and pass it into the Presenter to be recorded.
The code below can also be a workaround too. Maybe some line can be removed from my code.
var instance = new ScarletsAudioStreamer(...);
var streamerElement = instance.element;
var audioContext = ScarletsMedia.audioContext;
// Maybe this is not necessary
// Mute from current device, but don't mute for the recorder
var gainNode = audioContext.createGain();
gainNode.gain.value = 0;
instance.connect(gainNode);
gainNode.connect(audioContext.destination);
var presenter = new ScarletsMediaPresenter({
element: streamerElement
});
...
That is cool. I think it is really useful to receive and stream again
https://github.com/ScarletsFiction/SFMediaStream/blob/v1/src/MediaPresenter.js line 171 How can I edit to request notting. I need to only send a audio node. I just have a problem on host computer. There are no mic, and I can't install virtual mic.