ScarletsFiction/SFMediaStream

Effect not working

Closed this issue · 8 comments

I just tried
presenterMedia.disconnect(presenterMedia.destination);
ppDelay = ScarletsMediaEffect.pingPongDelay();

ppDelay.mix(20);


audioStreamer.connect(ppDelay.input);
ppDelay.output.connect(presenterMedia.destination);

this. Am I wrong? it is not working

You're trying to connect the Effect like this:
Streamer -> Effect -> Presenter's Destination

It's just like you want to stream the sound from someone and then apply the effect and send it to presenter to record it again. Have you try to connect the streamer to the speaker instead to check if the streamer instance was working properly?

You can check with this example or just change your code:
presenterMedia.destination with ScarletsMedia.audioContext.destination.

I just tried playStream() and it work well. with connect(presenterMedia.destination) but it send with orignal. why it is send with orignal? It is bug?

So the effect is working?
It's not a bug, it's expected because the original Presenter instance still connecting the microphone to it's destination.

Presenter's microphone -> Presenter's destination

That's why you need to disconnect the presenter itself from it's destination.
I think we have talk about this on the issue #16

https://pastebin.pl/view/5a4c7256
I just tried this code. Effect work perfect but it send with original.

Hmm, maybe the streamer's instance is also playing the original audio stream.

Can you try to disconnect it with?
audioStreamer.disconnect(ScarletsMedia.audioContext.destination)

If it's not working, try to refresh the browser with CTRL + F5 because maybe the browser was cached your old script.

I think it is play in client. I muted edit browser.

And I tried that code. but it have error

I fixed Thank you. I have to disconnect presenterMedia.destination when onRecordingReady