Closed krolig closed 4 years ago
To reduce bandwidth and CPU usage, you shouldn't add effect from the presenter. But add it on the streamer.
Just like the PingPongDelay on the music player's example.
var streamer = new ScarletsAudioStreamer();
var pitchShift = ScarletsMediaEffect.pitchShift();
streamer.connect(pitchShift.input);
pitchShift.output.connect(ScarletsMedia.audioContext.destination);
If you want to combine effect, you can connect the output to another effect's input.
pitchShift.output.connect(ppDelay.input)
Then don't forget to connect it to the speaker/destination.
ppDelay.output.connect(ScarletsMedia.audioContext.destination)
Thank you for your answer.
I would like to enable users of the voice chat could change your (self) voice. Not everyone wants to hear their real voices.
I need to change it for the microphone, and not the receptor.
I see.. Below haven't been compiled to distributable js, but could you try it from there? (As I can't test it right now)
You can change the scope
with your presenter's variable and add the effect just like the streamer
from my last comment.
I see.. Below haven't been compiled to distributable js, but could you try it from there? (As I can't test it right now)
You can change the
scope
with your presenter's variable and add the effect just like thestreamer
from my last comment.
It works on himself, but not sent to the server.
Hmm, maybe you connect the effect directly into the speaker. But because of that I realized if it's possible.
I just updated the library and the example, and you can use presenter.destination
instead of ScarletsMedia.audioContext.destination
.
Yes, now the effect pitchShift is sent to the server, but along with it is sent the raw sound of the voice. Can I somehow disable it?
Maybe the presenter still have connection to it's own destination. Can you disconnect it first?
presenter.disconnect(presenter.destination)
Thank you so much!
presenter.disconnect(presenter.destination)
- exactly what was needed.
Now everything works as I wanted.
Sure, good luck with your project
Hi! How to connect pitchShift effect to ScarletsMediaPresenter?