npx claudepluginhub chendren/computer<text to speak> [--voice Voice] [--play]Convert text to speech using Amazon Nova 2 Sonic via Bedrock and play through speakers.
$ARGUMENTS contains the text to speak, optionally with flags:
--voice <name> — choose a voice (default: tiffany). Options: tiffany, matthew, amy, ambre, florian, beatrice, lorenzo, greta, lennart, lupe, carlos--play — auto-play through speakers (default: true)--save <path> — save the WAV file to a pathParse arguments: Extract text and flags from $ARGUMENTS.
/tmp/nova-speak-output.wavGenerate speech: Run via Bash. Replace TEXT, VOICE, and OUTPUT:
cd ~/.claude/plugins/computer && node -e "
import { createNovaSonicBridge } from './server/services/nova-sonic.js';
import { writeFileSync } from 'fs';
const text = process.argv[1];
const voice = process.argv[2] || 'tiffany';
const outPath = process.argv[3] || '/tmp/nova-speak-output.wav';
const bridge = createNovaSonicBridge({ voice, tools: [] });
const chunks = [];
let transcript = '';
bridge.onAudio(pcm => chunks.push(Buffer.from(pcm)));
bridge.onText(t => { transcript += t; });
await bridge.connect();
bridge.sendText(text);
await new Promise(resolve => {
let sil = 0, last = 0;
const check = setInterval(() => {
if (chunks.length === last) { sil++; if ((chunks.length > 0 && sil > 6) || sil > 30) { clearInterval(check); resolve(); } }
else { sil = 0; last = chunks.length; }
}, 500);
});
const combined = Buffer.concat(chunks);
const hdr = Buffer.alloc(44);
hdr.write('RIFF',0); hdr.writeUInt32LE(36+combined.length,4);
hdr.write('WAVE',8); hdr.write('fmt ',12); hdr.writeUInt32LE(16,16);
hdr.writeUInt16LE(1,20); hdr.writeUInt16LE(1,22);
hdr.writeUInt32LE(24000,24); hdr.writeUInt32LE(48000,28);
hdr.writeUInt16LE(2,32); hdr.writeUInt16LE(16,34);
hdr.write('data',36); hdr.writeUInt32LE(combined.length,40);
writeFileSync(outPath, Buffer.concat([hdr, combined]));
console.log(JSON.stringify({
voice, duration: (combined.length/48000).toFixed(1),
chunks: chunks.length, transcript, file: outPath
}));
bridge.close();
process.exit(0);
" -- "TEXT" "VOICE" "OUTPUT"
--save specified):afplay OUTPUT_PATH
| Voice | Language | Gender | Notes |
|---|---|---|---|
| tiffany | Polyglot | Feminine | Recommended — speaks all languages |
| matthew | English (US) | Masculine | Clear, authoritative |
| amy | English (GB) | Feminine | British accent |
| ambre | French | Feminine | |
| florian | French | Masculine | |
| beatrice | Italian | Feminine | |
| lorenzo | Italian | Masculine | |
| greta | German | Feminine | |
| lennart | German | Masculine | |
| lupe | Spanish | Feminine | |
| carlos | Spanish | Masculine |
/computer:nova-speak Hello Captain, all systems nominal/computer:nova-speak --voice matthew Warp core online, shields at maximum/computer:nova-speak --save ~/Desktop/alert.wav Red alert, battle stations