unspeech
v0.1.11
Published
Client SDK for unSpeech
Readme
unSpeech TypeScript Client
Your Text-to-Speech Services, All-in-One.
Install
npm i unspeechGetting Started
List voices
Besides of the /audio/speech endpoint, we support listing all the available voices from providers as well:
import { createUnSpeech, listVoices } from 'unspeech'
const unspeech = createUnSpeech('YOUR_EXTERNAL_PROVIDER_API_KEY', 'http://localhost:5933/v1/')
const voices = await listVoices(
unspeech.voice({ backend: 'elevenlabs' })
)Speech synthesis
For general purpose /audio/speech requests, @xsai/generate-speech or xsAI can be used as it's compatible:
npm i @xsai/generate-speechimport { generateSpeech } from '@xsai/generate-speech'
import { createUnSpeech } from 'unspeech'
const unspeech = createUnSpeech('YOUR_EXTERNAL_PROVIDER_API_KEY', 'http://localhost:5933/v1/')
const speech = await generateSpeech({
...unspeech.speech('elevenlabs/eleven_multilingual_v2'),
input: 'Hello, World!',
voice: '9BWtsMINqrJLrRacOk9x',
})For the other providers, you can import them as needed
import {
createUnAlibabaCloud,
createUnElevenLabs,
createUnMicrosoft,
createUnSpeech,
createUnVolcengine,
} from 'unspeech'When using
- Microsoft / Azure AI Speech service
- Alibaba Cloud Model Studio / 阿里云百炼 / CosyVoice
- Volcano Engine / 火山引擎语音技术
- ElevenLabs
providers, SSML is supported to control in fine grain level for pitch, volume, rate, etc.
Related Projects
Looking for something like unSpeech, but for local TTS? check it out:
Or to use free Edge TTS:
