如何在PEERJS中使用sdptransform进行高质量的音频比特率

发布于 2025-01-20 14:33:32 字数 149 浏览 5 评论 0原文

  1. 我使用peerjs模块实现了一个视频聊天应用程序 一切都很好,但没有获得良好的音频质量。

  2. 如何使用 sdpTransform 设置比特率。谁能请给一个 PeerJS 中 sdpTranform 的完整示例。

  1. I have implemented a video chat application using peerjs module
    everything is okay , but not getting a good audio quality .

  2. How to use sdpTransform for setting the bitrate. can anyone please give a
    complete example of sdpTranform in PeerJS.

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

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

发布评论

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

评论(1

黑色毁心梦 2025-01-27 14:33:32

也许您可以尝试一下,

let videoConstraints = {
     height: { min: 640, ideal: 1920, max: 1920 },
     width: { min: 400, ideal: 1080 },
     frameRate: { max: 30 }
   };

let audioConstraints = {
    channelCount: 1,
    sampleRate: <YOUR VALUE>,
    sampleSize: <YOUR VALUE>,
    volume: 1,
    latency: 0.003,
    echoCancellation: true,
    noiseSuppression: true,
    autoGainControl: true,
  };
  constraints = { audio: audioConstraints, video: videoConstraints };

用法,

navigator.mediaDevices
      .getUserMedia(constraints)
...

Maybe you can try this,

let videoConstraints = {
     height: { min: 640, ideal: 1920, max: 1920 },
     width: { min: 400, ideal: 1080 },
     frameRate: { max: 30 }
   };

let audioConstraints = {
    channelCount: 1,
    sampleRate: <YOUR VALUE>,
    sampleSize: <YOUR VALUE>,
    volume: 1,
    latency: 0.003,
    echoCancellation: true,
    noiseSuppression: true,
    autoGainControl: true,
  };
  constraints = { audio: audioConstraints, video: videoConstraints };

Usage,

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