Convert tracker music to PCM streams
npm install node-chiptunejavascript
var chiptune = require('node-chiptune');
var speaker = require('speaker');
fs.readFile('file.mod', function(err, data) {
if(err != null) {
console.log(err);
} else {
// Create a chiptune readable stream
var chiptuneStream = chiptune(data, {
channels: 2, // 2 channels (stereo)
sampleRate: 48000 // 48,000 Hz sample rate
});
// We should be able to pipe the the chiptune stream to the speaker
chiptuneStream.pipe(new Speaker());
}
});
`
Supported formats
Basically all the formats supported by libopenmpt, here is the list:
mod s3m xm it mptm stm nst m15 stk wow ult 669 mtm med far mdl ams dsm amf okt dmf ptm psm mt2 dbm digi imf j2b gdm umx plm mo3 xpk ppm mmcmp`