如何循环播放 MP3?
我用它来播放 MP3,但它只播放一次。
我想连续播放 MP3。
/*jslint node: true, vars: true, maxerr: 50, indent: 4 */
(function (console, require, alarm) {
"use strict";
var fs = require("fs");
var lame = require("lame");
var Speaker = require("speaker");
function start() {
var stream = fs.createReadStream("sounds/alarm.mp3");
stream.pipe(new lame.Decoder()).pipe(new Speaker());
}
alarm.start = start;
}(global.console, require, exports));
使用: