48 lines
1.2 KiB
Markdown
48 lines
1.2 KiB
Markdown
# Serve Command Documentation
|
|
|
|
The `serve` command starts a FastAPI web server that provides both a web interface and HTTP API for text-to-speech generation.
|
|
|
|
## Basic Usage
|
|
|
|
```bash
|
|
uvx pocket-tts serve
|
|
# or if installed manually:
|
|
pocket-tts serve
|
|
```
|
|
|
|
This starts a server on `http://localhost:8000` with the default voice model.
|
|
|
|
## Command Options
|
|
|
|
- `--voice VOICE`: Path to voice prompt audio file (voice to clone) (default: "hf://kyutai/tts-voices/alba-mackenna/casual.wav")
|
|
- `--host HOST`: Host to bind to (default: "localhost")
|
|
- `--port PORT`: Port to bind to (default: 8000)
|
|
- `--reload`: Enable auto-reload for development
|
|
|
|
## Examples
|
|
|
|
### Basic Server
|
|
|
|
```bash
|
|
# Start with default settings
|
|
pocket-tts serve
|
|
|
|
# Custom host and port
|
|
pocket-tts serve --host "localhost" --port 8080
|
|
```
|
|
|
|
### Custom Voice
|
|
|
|
```bash
|
|
# Use different voice
|
|
pocket-tts serve --voice "hf://kyutai/tts-voices/jessica-jian/casual.wav"
|
|
|
|
# Use local voice file
|
|
pocket-tts serve --voice "./my_voice.wav"
|
|
```
|
|
|
|
## Web Interface
|
|
|
|
Once the server is running, navigate to `http://localhost:8000` to access the web interface.
|
|
|
|
For more advanced usage, see the [Python API documentation](python-api.md) for direct integration with the TTS model. |