@marswave/coli
v0.0.13
Published
A CLI for the Cola
Downloads
1,410
Keywords
Readme
coli
Core library for Cola. Provides essential capabilities commonly used by agents.
CLI Usage
npm install -g @marswave/coliUsage
$ coli <command> [options]
Commands
asr Transcribe an audio file using speech recognition
tts Speak text using text-to-speech (macOS only)
cloud-tts Generate speech using ListenHub OpenAPI
Examples
$ coli asr recording.m4a
$ coli asr -j recording.m4a
$ coli tts "Hello world"
$ coli tts -v Samantha -r 200 "Hello world"
$ coli cloud-tts --language en "Hello world"
$ coli cloud-tts --voice cozy-man-english "Hello world"API Usage
npm install @marswave/coliimport {ensureModels, runAsr, streamAsr, runTts} from '@marswave/coli';
// ASR
await ensureModels();
await runAsr('recording.m4a', {json: false, model: 'sensevoice'});
// Streaming ASR (see docs/asr.md for details)
await streamAsr(audioSource, {
onResult(result) {
console.log(result.text, result.isFinal ? '(final)' : '(partial)');
},
});
// TTS (macOS only)
await runTts('Hello world', {voice: 'Samantha', rate: 200});Documentation
- ASR — Automatic speech recognition
- TTS — Text-to-speech synthesis (macOS only)
- Cloud TTS — Cloud-based TTS via ListenHub OpenAPI
- ListenHub OpenAPI — ListenHub OpenAPI client
License
MIT
