将chrome.tabcapture.capture转换为音频文件? [英] Turn chrome.tabcapture.capture into an audio file?

查看:211
本文介绍了将chrome.tabcapture.capture转换为音频文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用chrome API https://developers.chrome.com/extensions/tabCapture . 如何从中获取音频文件.例如,如果我正在观看youtube并想将我正在播放的歌曲导出到音频文件MP3,wav等中,我知道那里有一些chrome扩展名可以做到这一点,但是我想知道是否存在API. 谢谢!

解决方案

使用 desktopCapture 带有DesktopCaptureSourceType音频"的API

保存信息流可能更具挑战性.您可以创建Web音频API音频上下文,然后调用 decodeAudioData ()获取原始PCM数据(例如.wav文件).通过MP3编码,您可以找到某种 Emscripten模块. /p>

或者,看起来好像有一个媒体记录器API(演示)我不确定这在许多浏览器中是否稳定,但是我只是在Chrome中尝试过,它似乎可以正常工作.

I"m trying to use the chrome API https://developers.chrome.com/extensions/tabCapture. How do I get a audio file out of it. For example, if I'm watching youtube and want to export whatever song I'm doing into an audio file MP3, wav, etc. I know there are some chrome extensions out there that does this but I want to know if there is an API. Thanks!

解决方案

Use the desktopCapture API with DesktopCaptureSourceType "audio"

Saving the stream may be more challenging. You could create a Web Audio API Audio context and call decodeAudioData() to get raw PCM data (e.g. .wav file). MP3 encoding you might be able to find some kind of Emscripten module for.

Alternatively, it looks like there is a media recorder API (demo) I'm not sure if this is stable in many browsers yet, but I just tried in Chrome and it seemed to work.

这篇关于将chrome.tabcapture.capture转换为音频文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆