June 07, 2013

How to play sound in node webkit

For license reason, node-webkit cannot play mp3, but we can do it in other ways.

The wiki gives us two methods to do that.

  1. Copy the copy those media codec files from Chrome.
  2. Just Build your own node-webkit.

The first one doesn’t work at all for me right now. And the second one is too complex for huge compiling a C++ project is a miserable thing as I learnt several years ago.

So I find a solution after thinking for a while.

Include a third party node-module which can play a sound, like play. Then use the api the node-module provide to play sound.


blog comments powered by Disqus