spc-converter
v1.0.0
Published
🎮🎶 Node.js library and command line program to convert Super Nintendo SPC files to WAV or PCM audio.
Downloads
8
Readme
Node.js library and command line program to convert Super Nintendo SPC files to WAV files or PCM data.
Use as a command line program
Install
npm i -g spc-converterUse
Convert to WAV file
spc-converter file.spcOutputs file.wav
Use in Node.js
Install
npm i spc-converterUse
Convert a SPC file to a WAV file in your own Node.js script:
const fs = require('fs')
const file = 'file.spc'
// initialize SPCPlayer module
const SPCPlayer = await require('spc-converter')()
// convert SPC file to WAV Buffer
const wavBuffer = await SPCPlayer.renderToWavBlob(file)
// write to file
const outputFileName = file.split('.spc')[0] + '.wav'
fs.writeFileSync(outputFileName, wavBuffer)You can also use this library to convert a SPC file directly to PCM audio:
const file = 'file.spc'
// initialize SPCPlayer module
const SPCPlayer = await require('spc-converter')()
// convert SPC file to PCM Buffer
const pcmBuffer = await SPCPlayer.renderToPCMBuffer(file)
console.log(pcmBuffer) // then you can do something with the PCM audio dataDevelopment
Run tests
- Clone this repo
npm cinpm t
Background
This project is a heavily-modified hard fork of https://codeberg.org/Telinc1/smwcentral-spc-player to repurpose it as a generic converter for SPC files to WAV or PCM audio data.
