S.A.M. (Software Automatic Mouth) is an old TTS (Text-To-Speech) program published in 1982 by Don't Ask Software (now SoftVoice, Inc.).
The official manual is available in the docs directory of the repo (as both .pdf and .md files).
This repo houses a port of the Commodore C64 version of S.A.M. in Javascript for the Deno runtime.
This repo was forked from this port by discordier, with additional functionality taken from a different fork of the same repo by reticivis-net.
//The latest release
import SamJs from 'https://raw.githubusercontent.com/ozaner/sam/0.5.0/src/index.js';
//The most recent commit
// import SamJs from "https://raw.githubusercontent.com/ozaner/sam/refs/heads/master/src/index.js";
//A specific commit
// import SamJs from "https://raw.githubusercontent.com/ozaner/sam/<HASH>/src/index.js";
let text = "Hello world";
// Initialize new SamJS w/ default settings
let sam = new SamJs();
// Render the passed text as a buffer of PCM w/ samples of type u8
const buf8 = sam.pcmU8(text); //returns a Uint8Array
// Render the passed text as a buffer of PCM w/ samples of type f32
const buf32 = sam.buf32(text); //returns a Float32Array
// Render the passed text as a buffer containing a valid wav (uses u8 samples)
const bufWav = sam.wav(text); //returns a Uint8Array
DESCRIPTION | SPEED | PITCH | THROAT | MOUTH |
---|---|---|---|---|
Elf | 72 | 64 | 110 | 160 |
Little Robot | 92 | 60 | 190 | 190 |
Stuffy Guy | 82 | 72 | 110 | 105 |
Little Old Lady | 82 | 32 | 145 | 145 |
Extra-Terrestrial | 100 | 64 | 150 | 200 |
SAM | 72 | 64 | 128 | 128 |
To access debug log values, make use of the @std/log package and listen to DEBUG/ERROR levels under the namespace "sam-js". Here's an example:
import * as log from "jsr:@std/log";
//prints to DEBUG log level and above to console
log.setup({
handlers: {
console: new log.ConsoleHandler("DEBUG"),
},
loggers: {
"sam-js": {
level: "DEBUG",
handlers: ["console"],
},
},
});
This software is a reverse-engineered version of a commercial software published more than 30 years ago. The current copyright holder is SoftVoice, Inc.
Any attempt to contact the company failed. The website was last updated in the year 2009. The status of the original software can therefore best be described as Abandonware.
As a result, and as with all other non-clean-room reverse-engineerings of this software, this code probably can't be put under any specific open source software license.
(But if you ask me, it doesn't really matter...)