const path = require('path')
const child_process = require('child_process');
let pathStr = path.join("C:/Program Files (x86)/Tencent/QQMusic/QQMusic.exe")
var p = path.join(__dirname, 'foo.mp3')
console.log(p)
var sound = child_process.spawn(pathStr, ["--play-and-exit", p]);
sound.on('exit', function () {
console.log('played');
});
网友评论