反应天然 - 麦克风语音波

发布于 2025-02-06 13:56:11 字数 107 浏览 2 评论 0原文

我目前正在在正在处理的应用程序中实现录音机。 一切都很好,但是我找不到捕获麦克风声波的方法,这会使应用看起来更好。 你们中有人知道我可以使用的库,还是一个本机解决方案来找到这些值?我可以自己制作动画。

I am currently implementing an audio recorder in the app I am working on.
Everything works great, but I cannot find a way to capture the sound waves of the microphone, which would make the app look even better.
Do any one of you guys know a library that I could use, or a Native solution to find these values? I can make the animations myself.

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

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

发布评论

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

评论(1

执手闯天涯 2025-02-13 13:56:11

解决方案非常简单,有一个名为Hark的库,可以帮助您收听音频流和发射事件(说话/不说话),

这是带有NPM的库链接: https://www.npmjs.com/package/hark

示例:

import hark from 'hark';

var speech = hark(stream, options); // stream is the sound coming from user's mic
speech.on('speaking', function() {
   setSpeaking(true);
});

speechEvents.on('stopped_speaking', function() {
  setSpeaking(false);
});

The solution is very easy, there is a library called hark which can help you to listen to audio streams and emit events (speaking / not speaking)

Here is the library link with NPM: https://www.npmjs.com/package/hark

Example:

import hark from 'hark';

var speech = hark(stream, options); // stream is the sound coming from user's mic
speech.on('speaking', function() {
   setSpeaking(true);
});

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