> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Voice

> Text-to-speech and speech-to-text

# Voice

Voice provides text-to-speech (TTS) and speech-to-text (STT) capabilities.

## Available Providers

| Provider                  | Description                |
| ------------------------- | -------------------------- |
| `OpenAIVoiceProvider`     | OpenAI TTS and Whisper     |
| `ElevenLabsVoiceProvider` | ElevenLabs voice synthesis |

## Quick Start

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { createOpenAIVoice, createElevenLabsVoice } from 'praisonai';

// OpenAI voice
const openaiVoice = createOpenAIVoice({
  apiKey: process.env.OPENAI_API_KEY
});

// ElevenLabs voice
const elevenLabsVoice = createElevenLabsVoice({
  apiKey: process.env.ELEVENLABS_API_KEY
});
```

## Text-to-Speech

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
const audio = await voice.speak({
  text: 'Hello world',
  voice: 'alloy'  // OpenAI voices: alloy, echo, fable, onyx, nova, shimmer
});
```

## Speech-to-Text

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
const text = await voice.listen({
  audio: audioBuffer
});
```

## CLI Usage

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts voice info
praisonai-ts voice providers --json
```
