在 Chrome 中自动录制语音输入

发布于 2024-12-09 18:03:01 字数 595 浏览 1 评论 0原文

我正在尝试在 Google 的语音输入中自动录制语音(仅适用于 Chrome) 。

事实上,用户必须单击麦克风才能开始录音,但我正在进行一个用户不会与计算机交互的安装。因此我必须以其他方式触发录制。

就看来您无法通过代码访问语音输入功能,即您无法调用函数来开始录音。所以现在我正在考虑模拟鼠标在麦克风上的点击。
我尝试过使用javaScript,但似乎只有事件和事件处理程序受到影响(例如,模拟单击输入字段会触发其单击处理程序,但不会将焦点集中到该字段。)

所以现在我正在考虑模拟Windows系统鼠标点击,我发现一些程序可以做到这一点(主要是间隔时间)并且它可以工作,录制开始。 但问题是我必须从浏览器应用程序激活点击模拟。
到目前为止最好的选择是 AutoHotkey ,它使您能够创建自定义脚本,在我的例子中是模拟鼠标的脚本单击给定位置。因此,如果我可以从浏览器执行这个脚本,我就会安全,但我不知道该怎么做。

欢迎任何想法和/或想法!

I'm trying to automate the recording of speech in Google's speech input (only works in Chrome).

As it is, the user has to click the mic to start the recording but I'm working on an installation where the user won't interact with the computer. Thus I have to trigger the recording some other way.

As far as it seems you can't access the speech input functionality by code, i.e. you can't call a function to start recording. So now I'm looking at simulating mouse click on the mic.
I've tried using javaScript but it seems only events and event handlers are affected (e.g. a simulated click on an input field would fire its click handlers but wouldn't give focus to the field.)

So now I'm looking at simulating Windows system mouse clicks, and I've found some programs that can do that (mostly on intervals) and it works, the recording starts.
But the problem is that I have to activate the click simulation from the browser application.
By best bet so far is AutoHotkey that enables you to create custom scripts, in my case a script that simulates a mouse click at a given position. So, if I could execute this script from the browser I would be safe, but I don't no how to do that.

Any ideas and / or thoughts are welcome!

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

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

发布评论

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

评论(2

今天小雨转甜 2024-12-16 18:03:01

我面临着类似的问题。我们想要开始和停止录音,以测试 google api 与德语语音识别的配合效果。但目前还没有找到解决办法。

html5 功能仍然有限,仅适用于五个输入字段。也许您在这里找到一些信息:
http://lists.w3 .org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html
我们明天再回到这个话题。

I m facing a similar problem. We wanted to start and stop the recording, to test how good google api works with voice recognition in german. But no solution found yet.

The html5 function is still limited and only works on five input fields. Maybe you find some information here:
http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html
We come back to the topic tomorrow.

情话已封尘 2024-12-16 18:03:01

我也遇到过类似的问题,然后我查看了 Mike Pultz 的这个网站 -

http://mikepultz.com/2011/03/accessing-google-speech-api-chrome-11/

基本上,他所做的是他自己创建音频文件,使用Sox 将其转换为 .flac 格式,然后将其发送到 Google Voice Api。因此,您不需要单击麦克风,或者您可以创建自己的麦克风回调。

我还在 - https://github.com/seigneur/Voice-Biometrics
您可以观看此视频以获取更多帮助 - http://www.youtube.com/ watch?v=PA00SPOTL-M

希望有帮助

I had faced the similar problem, then I took a look at this site by Mike Pultz -

http://mikepultz.com/2011/03/accessing-google-speech-api-chrome-11/

Basically, what he does is he creates the audio file himself, uses Sox to convert it into a .flac format and then sends it to the Google Voice Api. So you do not need to click the mike or rather you can create your own mike call back.

I also have created a C# solution at - https://github.com/seigneur/Voice-Biometrics
And you can look at this video for further help - http://www.youtube.com/watch?v=PA00SPOTL-M

Hope it helps

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