使用Node.JS播放音频 [英] Play audio with Node.JS

查看:1169
本文介绍了使用Node.JS播放音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在使用 child_process 和命令行mplayer播放音频在我的Node.JS应用程序上的本地计算机上.这行得通,但这并不是一个很好的解决方案.我最大的问题是从启动mplayer到开始播放音频需要500毫秒.

I'm currently using child_process and command-line mplayer to play audio on the local machine, with my Node.JS application. This works, but it's not really an excellent solution. My biggest issue is that it takes 500ms from mplayer is started to audio starts playing.

还有更好的播放音频的方法吗?最好是压缩音频,但我会尽力而为.

Are there better ways to play audio? Preferably compressed audio, but I'll take what I can get.

推荐答案

我想您问的是,nodejs生态系统中是否有任何适用于音频的良好模块?

I think what you asking is there any good modules that work with audio in the nodejs ecosystem?

每当您遇到此类问题时,都应首先进入 npmjs ,然后输入适当的关键字.

Whenever you have this type of question you should first go the npmjs and just type a appropiate keyword.

这是我在npmjs网站上找到的与音频相关的模块列表.

Here is list of modules that related to audio I found on the npmjs site.

substacks的 baudio 对我来说很好.

substacks's baudio looks good to me.

这篇关于使用Node.JS播放音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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