This is a slightly improved version of Commodore SAM based off discordier's SAM JS port
I wanted to incorporate SAM into my discord bot, MediaForge, but the C ports are too limiting as they're essentially instruction-for-instruction clones of software from the 80s: i.e. memory limits everywhere. discordier's JS port has no such limitations, but also didn't have everything I wanted it to. hence: this project which is used by my sam-cli project
SamJs.renderwav()
: like a mix between the existingbuf8
anddownload
options: generates the full data for a valid WAV file and simply passes back the data for you to handle- advanced pronunciation: new
moderncmu
option which, when enabled, uses The Carnegie Mellon University Pronouncing Dictionary (CMUDict) and to-words to pronounce words more accurately. CMUdict is used to get correct pronunciation _ and stress patterns_ for over 100k english words, while to-words allows SAM to fully read out any number - unlimited speech: this isn't something unique to this project (comes from discordier's port), but it's worth mentioning since the C ports dont have it.
should be completely backwards compatible with discordier's port: usage for that is documented here
worth mentioning are the config options, since they aren't mentioned in
the original readme. pass these as a dict into the new SamJs()
constructor
/**
* @param {Boolean} [options.phonetic] Default false.
* @param {Boolean} [options.singmode] Default false.
* @param {Boolean} [options.moderncmu] Default false.
* @param {Boolean} [options.debug] Default false.
* @param {Number} [options.pitch] Default 64.
* @param {Number} [options.speed] Default 72.
* @param {Number} [options.mouth] Default 128.
* @param {Number} [options.throat] Default 128.
*/