首页 > 解决方案 > 无法使用 Screen Capture API 录制音频

问题描述

所以我正在尝试使用 Screen Capture API 来录制音频,我有这样的东西:

const stream = await navigator.mediaDevices.getDisplayMedia({
  video: {
    frameRate: 1,
  },
  audio: {
    echoCancellation: { ideal: true },
    noiseSuppression: { ideal: true },
  },
});

但生成的流只有一个视频轨道,没有音频。知道我做错了什么吗?

标签: javascriptscreen-capture

解决方案


I was testing screen capture API, i needed, on browser, to select the option "Share audio", which is only available on some capture options, and it depends of the browser that you're using. In my tests, on Microsoft Edge, i can record audio on entire screen and edge tabs, on Chrome i can record only on chrome tabs.


推荐阅读