# Send SAM TTS to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "sam-tts",
    "name": "SAM TTS",
    "source": "tencent",
    "type": "skill",
    "category": "通讯协作",
    "sourceUrl": "https://clawhub.ai/fourthdensity/sam-tts",
    "canonicalUrl": "https://clawhub.ai/fourthdensity/sam-tts",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/sam-tts",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=sam-tts",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "package-lock.json",
      "package.json",
      "scripts/sam-tts-wrapper.js",
      "scripts/sam-tts.js"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "sam-tts",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-01T05:41:30.424Z",
      "expiresAt": "2026-05-08T05:41:30.424Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=sam-tts",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=sam-tts",
        "contentDisposition": "attachment; filename=\"sam-tts-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "sam-tts"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/sam-tts"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/sam-tts",
    "downloadUrl": "https://openagent3.xyz/downloads/sam-tts",
    "agentUrl": "https://openagent3.xyz/skills/sam-tts/agent",
    "manifestUrl": "https://openagent3.xyz/skills/sam-tts/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/sam-tts/agent.md"
  }
}
```
## Documentation

### SAM TTS - Software Automatic Mouth

Generate WAV audio files using the classic SAM text-to-speech engine -- the iconic robotic voice from the Commodore 64 era.

### Requirements

Node.js 18+
Run npm install in the skill directory to install dependencies

### SAM Mode Toggle

State file: memory/sam-mode.json

### /sam on -- Enable SAM Mode

When SAM mode is enabled, ALL text responses are converted to SAM voice messages.

Implementation:

Set enabled: true in memory/sam-mode.json
Confirm with voice message: "SAM mode enabled. I will now speak in robotic voice."

### /sam off -- Disable SAM Mode

Return to normal text-to-text communication.

Implementation:

Set enabled: false in memory/sam-mode.json
Confirm with text: "SAM mode disabled. Back to text."

### Check current mode

Read memory/sam-mode.json at session start to know current state.

### When SAM mode is ON:

Generate response text as normal
Convert to SAM TTS: node scripts/sam-tts-wrapper.js "response" --output=/tmp/sam-XXX.wav --quiet
Send the generated WAV file as audio output
Include brief text caption if helpful

### When SAM mode is OFF:

Respond with normal text (default behavior).

### /sam <text>

Generate a one-time voice message using SAM TTS (works regardless of SAM mode state).

Implementation:

Extract text after /sam 
Generate WAV: node scripts/sam-tts-wrapper.js "text" --output=/tmp/sam-XXX.wav --quiet
Return the WAV file as audio output

### /sam on

Enable SAM mode for all responses.

### /sam off

Disable SAM mode.

### /sam status

Report current SAM mode state (text response).

### Voice Parameters

All parameters accept 0-255 range values. Store defaults in memory/sam-mode.json:

ParameterDefaultEffectpitch64Voice pitch (higher = higher pitch)speed72Speech speed (lower = faster)mouth128Mouth cavity size (affects resonance)throat128Throat size (affects timbre)

### /sam pitch <number>

Set pitch parameter (0-255).

### /sam speed <number>

Set speed parameter (1-255, lower is faster).

### /sam mouth <number>

Set mouth parameter (0-255).

### /sam throat <number>

Set throat parameter (0-255).

### scripts/sam-tts-wrapper.js

Primary wrapper script. Outputs JSON metadata for automation.

node scripts/sam-tts-wrapper.js "Hello world" --output=/tmp/out.wav --quiet
node scripts/sam-tts-wrapper.js "Hello world" --output=/tmp/out.wav --quiet --pitch=80 --speed=60

Options:

--output=PATH (required) - Output WAV file path
--quiet - Suppress debug output, output only JSON
--pitch=N, --speed=N, --mouth=N, --throat=N - Voice parameters
--phonetic - Input is phonetic notation

Output format:

{"success":true,"outputPath":"/tmp/sam.wav","duration":1.44,"size":31741}

### scripts/sam-tts.js

Standalone CLI tool with human-readable output.

node scripts/sam-tts.js "Hello world" output.wav --pitch=80 --speed=60

### File: memory/sam-mode.json

{
  "enabled": false,
  "pitch": 64,
  "speed": 72,
  "mouth": 128,
  "throat": 128
}

Read at session start. Update when user toggles mode or changes parameters. Create the memory/ directory if it doesn't exist.

### Enable SAM mode

User: /sam on
Agent: [Voice: "SAM mode enabled. I will now speak in robotic voice."]

### Normal conversation in SAM mode

User: "What's the weather?"
Agent: [Voice: "Current temperature is 72 degrees with partly cloudy skies."]

### Disable SAM mode

User: /sam off
Agent: SAM mode disabled. Back to text.

### One-time voice (even when mode is off)

User: /sam Hello there
Agent: [Voice: "Hello there"]

### Custom voice parameters

User: /sam pitch 100
Agent: Pitch set to 100.

User: /sam Testing higher pitch
Agent: [Voice with pitch=100: "Testing higher pitch"]

### Phonetic Notation

For precise pronunciation, use --phonetic flag:

Vowels: IY (bee), IH (bit), EY (bay), AE (bat), AA (father), AH (bought), AO (hot), OW (boat), UH (book), UW (boot), ER (bird), AX (about)
Numbers 1-8 indicate stress: HEH4LOW (emphasized second syllable)

See references/phonemes.md for the full phoneme chart.

### Output Format

Format: WAV (RIFF/WAVE PCM)
Sample rate: 22050 Hz
Bit depth: 8-bit
Channels: Mono

### Directory Structure

sam-tts/
+-- SKILL.md
+-- package.json
+-- scripts/
|   +-- sam-tts-wrapper.js
|   +-- sam-tts.js
+-- references/
|   +-- phonemes.md
+-- memory/
    +-- sam-mode.json

### Platform Integration

The skill outputs WAV format by default. Some messaging platforms require different audio formats.

### Format Conversion (Optional)

(Warning): Before installing ffmpeg or any conversion tools, the agent MUST ask the user for confirmation. Do not auto-install dependencies.

Example agent prompt:

"This platform requires OGG/OPUS format. I need to install ffmpeg for audio conversion. Would you like me to proceed with the installation?"

Only proceed with installation after explicit user approval.

### Telegram / WhatsApp (OGG/OPUS)

ffmpeg -i input.wav -c:a libopus -b:a 24k output.ogg

### Discord (MP3/OGG)

ffmpeg -i input.wav -c:a libmp3lame -b:a 64k output.mp3

### Web / Direct Playback

WAV works directly -- no conversion needed.

Note: The agent should detect the target platform and handle format conversion as needed, but always with user consent for any new dependencies.

### Credits

Skill by: fourthdensity

Active Dependency: sam-js by discordier

The npm package used for TTS synthesis (JavaScript/Node.js port)

Historical Lineage: sam-js builds upon earlier community ports:

SAM by Stefan Macke (C adaptation)
SAM by Vidar Hokstad (refactoring)
SAM by 8BitPimp (refactoring)

Original SAM (Software Automatic Mouth) (c) 1982 Don't Ask Software (now SoftVoice, Inc.)

License Note: The original SAM software is considered abandonware. The JavaScript adaptation is provided as-is. See the sam-js repository for full license details.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: fourthdensity
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-01T05:41:30.424Z
- Expires at: 2026-05-08T05:41:30.424Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/sam-tts)
- [Send to Agent page](https://openagent3.xyz/skills/sam-tts/agent)
- [JSON manifest](https://openagent3.xyz/skills/sam-tts/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/sam-tts/agent.md)
- [Download page](https://openagent3.xyz/downloads/sam-tts)