-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Volume #24
Comments
Hi! The implementation is similar like adding effect that created from SFMediaStream/example/group-call/browser/streamer.js Lines 79 to 83 in 845df06
You can get the AudioContext with If the AudioNode is created from let gainNode = ScarletsMedia.audioContext.createGain();
// source (stream) -> GainNode -> destination (speaker)
audioStreamer.connect(gainNode);
gainNode.connect(ScarletsMedia.audioContext.destination);
gainNode.gain.value = 0.2; // range 0~1, where 0.2 == 10% |
Thank you! |
Now lets say I want to control the Equalizer parameters... |
To control the equalizer parameters, you can just adjust the frequency's dB value SFMediaStream/src/Plugin/Equalizer.js Lines 35 to 38 in 845df06
And don't forget to connect each node, different connection order may give different result let equalizer = ScarletsMediaEffect.equalizer(/* [32, 64, 125, 250, 500, 1000, 2000, 4000, 8000, 16000] */);
// 32Hz ~16KHz will be set as default frequency which you can control
// source (stream) -> Equalizer -> GainNode -> destination (speaker)
audioStreamer.connect(equalizer.input);
equalizer.output.connect(gainNode);
gainNode.connect(ScarletsMedia.audioContext.destination);
equalizer.frequency(32, 15); // 32Hz, 15dB |
Thank you very much!! |
Hello!
Love this repo!
How can I set a Volume slider () on the audioStreamer?
The text was updated successfully, but these errors were encountered: