Open hughfenghen opened 1 year ago
音频类似:
const codecs = ["mp4a.40.2", "mp3"];
const configs = [];
for (const codec of codecs) {
configs.push({
codec,
sampleRate: 48000,
numberOfChannels: 1,
not_supported_field: 123,
});
}
for (const config of configs) {
const support = await AudioEncoder.isConfigSupported(config);
console.log(
`AudioEncoder's config ${JSON.stringify(support.config)} support: ${
support.supported
}`
);
}
代码来源: https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/isConfigSupported_static
可复制代码在浏览器控制台中验证当前浏览器的支持情况
编码
输出示例
解码
输出示例