javascript - 无法使用 Screen Capture API 录制音频
问题描述
所以我正在尝试使用 Screen Capture API 来录制音频,我有这样的东西:
const stream = await navigator.mediaDevices.getDisplayMedia({
video: {
frameRate: 1,
},
audio: {
echoCancellation: { ideal: true },
noiseSuppression: { ideal: true },
},
});
但生成的流只有一个视频轨道,没有音频。知道我做错了什么吗?
解决方案
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.
推荐阅读
- c# - 如何在数据库优先方法中配置全局查询过滤器?
- r - 列 `x`、`y` 必须是一维原子向量或列表
- xamarin - Xamarin Forms Iphone X 删除填充
- java - 正在使用 Kotlin Pair 但方法需要 android.util.Pair
- asp.net-core - 为 AddHttpsRedirection 设置 RedirectStatusCode 没有任何效果
- google-apps-script - Google Apps Standalone Script 使用 Google Apps Script API 更新许多绑定脚本
- python - 如何使用 python 在表格中显示多个 jpeg 图像?
- node.js - AWS nodejs lambda在JavaScript对象中持久化异步调用的输出
- java - 我正在尝试使用一种方法来打印另一种方法
- git - 克隆/签出运行到 100% 后 Git/TortoiseGit 挂起