mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-03 00:55:14 -07:00
docs: align local API port examples with current dev flow
This commit is contained in:
+1
-1
@@ -407,7 +407,7 @@ See [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) for common issues and sol
|
|||||||
|
|
||||||
- **Backend won't start:** Check Python version (3.11+), ensure venv is activated, install dependencies
|
- **Backend won't start:** Check Python version (3.11+), ensure venv is activated, install dependencies
|
||||||
- **Tauri build fails:** Ensure Rust is installed, clean build with `cd tauri/src-tauri && cargo clean`
|
- **Tauri build fails:** Ensure Rust is installed, clean build with `cd tauri/src-tauri && cargo clean`
|
||||||
- **OpenAPI client generation fails:** Ensure backend is running, check `curl http://localhost:8000/openapi.json`
|
- **OpenAPI client generation fails:** Ensure backend is running, check `curl http://localhost:17493/openapi.json`
|
||||||
|
|
||||||
## Questions?
|
## Questions?
|
||||||
|
|
||||||
|
|||||||
@@ -147,17 +147,20 @@ Create multi-voice narratives, podcasts, and conversations with a timeline-based
|
|||||||
|
|
||||||
Voicebox exposes a full REST API, so you can integrate voice synthesis into your own apps.
|
Voicebox exposes a full REST API, so you can integrate voice synthesis into your own apps.
|
||||||
|
|
||||||
|
For the current local app and development workflow, the backend is typically available at `http://localhost:17493`.
|
||||||
|
If you launch the backend manually with a different host or port, use that address instead.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Generate speech
|
# Generate speech
|
||||||
curl -X POST http://localhost:8000/generate \
|
curl -X POST http://localhost:17493/generate \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"text": "Hello world", "profile_id": "abc123", "language": "en"}'
|
-d '{"text": "Hello world", "profile_id": "abc123", "language": "en"}'
|
||||||
|
|
||||||
# List voice profiles
|
# List voice profiles
|
||||||
curl http://localhost:8000/profiles
|
curl http://localhost:17493/profiles
|
||||||
|
|
||||||
# Create a profile
|
# Create a profile
|
||||||
curl -X POST http://localhost:8000/profiles \
|
curl -X POST http://localhost:17493/profiles \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"name": "My Voice", "language": "en"}'
|
-d '{"name": "My Voice", "language": "en"}'
|
||||||
```
|
```
|
||||||
@@ -170,7 +173,7 @@ curl -X POST http://localhost:8000/profiles \
|
|||||||
- Voice assistants
|
- Voice assistants
|
||||||
- Content creation automation
|
- Content creation automation
|
||||||
|
|
||||||
Full API documentation available at `http://localhost:8000/docs` when running.
|
Full API documentation is available at `http://localhost:17493/docs` in the default local workflow, or at `/docs` on whatever server address you configured.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
+12
-9
@@ -334,18 +334,21 @@ python -m backend.main --host 0.0.0.0 --port 8000
|
|||||||
|
|
||||||
## Usage Examples
|
## Usage Examples
|
||||||
|
|
||||||
|
The desktop app, web client, and current development workflow use `http://localhost:17493` by default.
|
||||||
|
If you launch the backend manually with a different host or port, substitute that address in the examples below.
|
||||||
|
|
||||||
### Creating a Voice Profile
|
### Creating a Voice Profile
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. Create profile
|
# 1. Create profile
|
||||||
curl -X POST http://localhost:8000/profiles \
|
curl -X POST http://localhost:17493/profiles \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"name": "My Voice", "language": "en"}'
|
-d '{"name": "My Voice", "language": "en"}'
|
||||||
|
|
||||||
# Response: {"id": "abc-123", ...}
|
# Response: {"id": "abc-123", ...}
|
||||||
|
|
||||||
# 2. Add sample
|
# 2. Add sample
|
||||||
curl -X POST http://localhost:8000/profiles/abc-123/samples \
|
curl -X POST http://localhost:17493/profiles/abc-123/samples \
|
||||||
-F "[email protected]" \
|
-F "[email protected]" \
|
||||||
-F "reference_text=This is my voice sample"
|
-F "reference_text=This is my voice sample"
|
||||||
```
|
```
|
||||||
@@ -353,7 +356,7 @@ curl -X POST http://localhost:8000/profiles/abc-123/samples \
|
|||||||
### Generating Speech
|
### Generating Speech
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -X POST http://localhost:8000/generate \
|
curl -X POST http://localhost:17493/generate \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{
|
-d '{
|
||||||
"profile_id": "abc-123",
|
"profile_id": "abc-123",
|
||||||
@@ -365,13 +368,13 @@ curl -X POST http://localhost:8000/generate \
|
|||||||
# Response: {"id": "gen-456", "audio_path": "/path/to/audio.wav", ...}
|
# Response: {"id": "gen-456", "audio_path": "/path/to/audio.wav", ...}
|
||||||
|
|
||||||
# Download audio
|
# Download audio
|
||||||
curl http://localhost:8000/audio/gen-456 -o output.wav
|
curl http://localhost:17493/audio/gen-456 -o output.wav
|
||||||
```
|
```
|
||||||
|
|
||||||
### Transcribing Audio
|
### Transcribing Audio
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -X POST http://localhost:8000/transcribe \
|
curl -X POST http://localhost:17493/transcribe \
|
||||||
-F "[email protected]" \
|
-F "[email protected]" \
|
||||||
-F "language=en"
|
-F "language=en"
|
||||||
|
|
||||||
@@ -386,12 +389,12 @@ Add multiple samples to a profile for better quality:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Add first sample
|
# Add first sample
|
||||||
curl -X POST http://localhost:8000/profiles/abc-123/samples \
|
curl -X POST http://localhost:17493/profiles/abc-123/samples \
|
||||||
-F "[email protected]" \
|
-F "[email protected]" \
|
||||||
-F "reference_text=First sample"
|
-F "reference_text=First sample"
|
||||||
|
|
||||||
# Add second sample
|
# Add second sample
|
||||||
curl -X POST http://localhost:8000/profiles/abc-123/samples \
|
curl -X POST http://localhost:17493/profiles/abc-123/samples \
|
||||||
-F "[email protected]" \
|
-F "[email protected]" \
|
||||||
-F "reference_text=Second sample"
|
-F "reference_text=Second sample"
|
||||||
|
|
||||||
@@ -412,10 +415,10 @@ Models are lazy-loaded and can be manually unloaded:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Unload TTS model
|
# Unload TTS model
|
||||||
curl -X POST http://localhost:8000/models/unload
|
curl -X POST http://localhost:17493/models/unload
|
||||||
|
|
||||||
# Load specific model size
|
# Load specific model size
|
||||||
curl -X POST "http://localhost:8000/models/load?model_size=0.6B"
|
curl -X POST "http://localhost:17493/models/load?model_size=0.6B"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Error Handling
|
## Error Handling
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ chmod +x voicebox-*.AppImage
|
|||||||
**Solutions:**
|
**Solutions:**
|
||||||
1. **Check server is running**
|
1. **Check server is running**
|
||||||
```bash
|
```bash
|
||||||
curl http://localhost:8000/health
|
curl http://localhost:17493/health
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Check remote mode**
|
2. **Check remote mode**
|
||||||
@@ -170,7 +170,7 @@ chmod +x voicebox-*.AppImage
|
|||||||
- Check firewall settings
|
- Check firewall settings
|
||||||
|
|
||||||
3. **Check port availability**
|
3. **Check port availability**
|
||||||
- Default port is 8000
|
- The current local app and dev workflow uses port 17493 by default
|
||||||
- Ensure no other service is using it
|
- Ensure no other service is using it
|
||||||
|
|
||||||
### CORS errors in browser
|
### CORS errors in browser
|
||||||
@@ -276,7 +276,7 @@ chmod +x voicebox-*.AppImage
|
|||||||
|
|
||||||
2. **Check OpenAPI endpoint**
|
2. **Check OpenAPI endpoint**
|
||||||
```bash
|
```bash
|
||||||
curl http://localhost:8000/openapi.json
|
curl http://localhost:17493/openapi.json
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Regenerate client**
|
3. **Regenerate client**
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ set -e
|
|||||||
echo "Generating OpenAPI client..."
|
echo "Generating OpenAPI client..."
|
||||||
|
|
||||||
# Check if backend is running
|
# Check if backend is running
|
||||||
if ! curl -s http://localhost:8000/openapi.json > /dev/null 2>&1; then
|
if ! curl -s http://localhost:17493/openapi.json > /dev/null 2>&1; then
|
||||||
echo "Backend not running. Starting backend..."
|
echo "Backend not running. Starting backend..."
|
||||||
cd backend
|
cd backend
|
||||||
|
|
||||||
@@ -26,19 +26,19 @@ if ! curl -s http://localhost:8000/openapi.json > /dev/null 2>&1; then
|
|||||||
|
|
||||||
# Start backend in background
|
# Start backend in background
|
||||||
echo "Starting backend server..."
|
echo "Starting backend server..."
|
||||||
uvicorn main:app --port 8000 &
|
uvicorn main:app --port 17493 &
|
||||||
BACKEND_PID=$!
|
BACKEND_PID=$!
|
||||||
|
|
||||||
# Wait for server to be ready
|
# Wait for server to be ready
|
||||||
echo "Waiting for server to start..."
|
echo "Waiting for server to start..."
|
||||||
for i in {1..30}; do
|
for i in {1..30}; do
|
||||||
if curl -s http://localhost:8000/openapi.json > /dev/null 2>&1; then
|
if curl -s http://localhost:17493/openapi.json > /dev/null 2>&1; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
if ! curl -s http://localhost:8000/openapi.json > /dev/null 2>&1; then
|
if ! curl -s http://localhost:17493/openapi.json > /dev/null 2>&1; then
|
||||||
echo "Error: Backend failed to start"
|
echo "Error: Backend failed to start"
|
||||||
kill $BACKEND_PID 2>/dev/null || true
|
kill $BACKEND_PID 2>/dev/null || true
|
||||||
exit 1
|
exit 1
|
||||||
@@ -52,7 +52,7 @@ fi
|
|||||||
|
|
||||||
# Download OpenAPI schema
|
# Download OpenAPI schema
|
||||||
echo "Downloading OpenAPI schema..."
|
echo "Downloading OpenAPI schema..."
|
||||||
curl -s http://localhost:8000/openapi.json > app/openapi.json
|
curl -s http://localhost:17493/openapi.json > app/openapi.json
|
||||||
|
|
||||||
# Check if openapi-typescript-codegen is installed
|
# Check if openapi-typescript-codegen is installed
|
||||||
if ! bunx --bun openapi-typescript-codegen --version > /dev/null 2>&1; then
|
if ! bunx --bun openapi-typescript-codegen --version > /dev/null 2>&1; then
|
||||||
|
|||||||
Reference in New Issue
Block a user