Videochat netstream SoundTransform 不适用于音量控制

发布于 2024-12-23 17:52:16 字数 511 浏览 8 评论 0原文

我有一个视频聊天应用程序,可以有 6 名参与者。我想做的是让每个发布者可以选择控制自己的流的音量。我的代码看起来像这样。

[global]
private var volumeTransform:SoundTransform;

[In the init method where ]
outgoingStream = new NetStream( nc );
....
volumeTransform = outgoingStream.soundTransform;

[In adjustVolume method]
....
volumeTransform.volume = event.value;
outgoingStream.soundTransform = volumeTransform;

有什么想法为什么这行不通吗?

-- 编辑可能的解决方案 --
可能的解决方案是这样的:校准滑块并设置麦克风增益,增益为零实际上是静音,增益为 100 是全音量。似乎对我有用。

I have a video chat application where there can be 6 participants. What I would like to do is give the option to each publisher to control their own stream's volume. The code I have looks like this.

[global]
private var volumeTransform:SoundTransform;

[In the init method where ]
outgoingStream = new NetStream( nc );
....
volumeTransform = outgoingStream.soundTransform;

[In adjustVolume method]
....
volumeTransform.volume = event.value;
outgoingStream.soundTransform = volumeTransform;

Any ideas why this would not work?

-- EDIT A POSSIBLE SOLUTION --
A possible solution can be this : Calibrate the slider and set the microphone gain, a gain of zero effectively is mute and a gain of 100 is full volume. Seems to work for me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浮萍、无处依 2024-12-30 17:52:16

我认为您无法执行您所要求的操作,您需要使用 Microphone.gain 属性(如上面编辑的评论中所述)。

您可以编写一些代码来在聊天参与者之间发送消息,从而允许管理员(或所有用户)修改其他人的麦克风增益。

I don't think you can do what you are asking for, you need to use the Microphone.gain property (as noted in the edited comment above).

You could conceivable write some code to send messages between the chat participants allowing an admin (or all users) to modify someone else's mic gain.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文