Play audio with Node.JS

前端 未结 7 2203
故里飘歌
故里飘歌 2021-02-01 15:52

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 exc

7条回答
  •  长情又很酷
    2021-02-01 16:41

    I would suggest using node-speaker, which outputs raw PCM data to your speakers (so basically, it plays audio).

    If you're playing something like mp3 files you might need to decode it first to PCM data, which is exactly what node-lame does.

    Hope that helps.

提交回复
热议问题