Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Audio export failing when Tauri save dialog returns object instead of string path
- OpenAPI client generator script now documents the local backend port and avoids an unused loop variable warning
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Expand the changelog entry to include all documentation updates.

The current entry only mentions the generator script, but the PR updates multiple documentation files (README.md, backend/README.md, CONTRIBUTING.md, TROUBLESHOOTING.md) to align port references from 8000 to 17493. Users reading the changelog won't be aware of these important documentation updates.

📝 Suggested expanded entry
-- OpenAPI client generator script now documents the local backend port and avoids an unused loop variable warning
+- Updated local API port references from 8000 to 17493 across documentation (README.md, backend/README.md, CONTRIBUTING.md, TROUBLESHOOTING.md) and OpenAPI client generator script to align with current development workflow
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- OpenAPI client generator script now documents the local backend port and avoids an unused loop variable warning
- Updated local API port references from 8000 to 17493 across documentation (README.md, backend/README.md, CONTRIBUTING.md, TROUBLESHOOTING.md) and OpenAPI client generator script to align with current development workflow
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` at line 58, Update the CHANGELOG entry to list all
documentation files updated in this PR and the specific port change: amend the
line about the OpenAPI client generator to also mention that README.md,
backend/README.md, CONTRIBUTING.md, and TROUBLESHOOTING.md were updated to
change the local backend port reference from 8000 to 17493 and note the removal
of an unused loop variable warning in the generator script; keep the wording
concise and consistent with existing changelog style.


### Added
- **Makefile** - Comprehensive development workflow automation with commands for setup, development, building, testing, and code quality checks
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- **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?

Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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
# Generate speech
curl -X POST http://localhost:8000/generate \
curl -X POST http://localhost:17493/generate \
-H "Content-Type: application/json" \
-d '{"text": "Hello world", "profile_id": "abc123", "language": "en"}'

# List voice profiles
curl http://localhost:8000/profiles
curl http://localhost:17493/profiles

# Create a profile
curl -X POST http://localhost:8000/profiles \
curl -X POST http://localhost:17493/profiles \
-H "Content-Type: application/json" \
-d '{"name": "My Voice", "language": "en"}'
```
Expand All @@ -170,7 +173,7 @@ curl -X POST http://localhost:8000/profiles \
- Voice assistants
- 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.

---

Expand Down
21 changes: 12 additions & 9 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,26 +334,29 @@ python -m backend.main --host 0.0.0.0 --port 8000

## 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

```bash
# 1. Create profile
curl -X POST http://localhost:8000/profiles \
curl -X POST http://localhost:17493/profiles \
-H "Content-Type: application/json" \
-d '{"name": "My Voice", "language": "en"}'

# Response: {"id": "abc-123", ...}

# 2. Add sample
curl -X POST http://localhost:8000/profiles/abc-123/samples \
curl -X POST http://localhost:17493/profiles/abc-123/samples \
-F "file=@sample.wav" \
-F "reference_text=This is my voice sample"
```

### Generating Speech

```bash
curl -X POST http://localhost:8000/generate \
curl -X POST http://localhost:17493/generate \
-H "Content-Type: application/json" \
-d '{
"profile_id": "abc-123",
Expand All @@ -365,13 +368,13 @@ curl -X POST http://localhost:8000/generate \
# Response: {"id": "gen-456", "audio_path": "/path/to/audio.wav", ...}

# Download audio
curl http://localhost:8000/audio/gen-456 -o output.wav
curl http://localhost:17493/audio/gen-456 -o output.wav
```

### Transcribing Audio

```bash
curl -X POST http://localhost:8000/transcribe \
curl -X POST http://localhost:17493/transcribe \
-F "file=@audio.wav" \
-F "language=en"

Expand All @@ -386,12 +389,12 @@ Add multiple samples to a profile for better quality:

```bash
# Add first sample
curl -X POST http://localhost:8000/profiles/abc-123/samples \
curl -X POST http://localhost:17493/profiles/abc-123/samples \
-F "file=@sample1.wav" \
-F "reference_text=First 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 "file=@sample2.wav" \
-F "reference_text=Second sample"

Expand All @@ -412,10 +415,10 @@ Models are lazy-loaded and can be manually unloaded:

```bash
# Unload TTS model
curl -X POST http://localhost:8000/models/unload
curl -X POST http://localhost:17493/models/unload

# 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
Expand Down
6 changes: 3 additions & 3 deletions docs/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ chmod +x voicebox-*.AppImage
**Solutions:**
1. **Check server is running**
```bash
curl http://localhost:8000/health
curl http://localhost:17493/health
```

2. **Check remote mode**
- If connecting remotely, ensure server is started with `--host 0.0.0.0`
- Check firewall settings

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

### CORS errors in browser
Expand Down Expand Up @@ -276,7 +276,7 @@ chmod +x voicebox-*.AppImage

2. **Check OpenAPI endpoint**
```bash
curl http://localhost:8000/openapi.json
curl http://localhost:17493/openapi.json
```

3. **Regenerate client**
Expand Down
12 changes: 6 additions & 6 deletions scripts/generate-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
echo "Generating OpenAPI client..."

# 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..."
cd backend

Expand All @@ -26,19 +26,19 @@ if ! curl -s http://localhost:8000/openapi.json > /dev/null 2>&1; then

# Start backend in background
echo "Starting backend server..."
uvicorn main:app --port 8000 &
uvicorn main:app --port 17493 & # Keep the generator on the app's documented local backend port.
BACKEND_PID=$!

# Wait for server to be ready
echo "Waiting for server to start..."
for i in {1..30}; do
if curl -s http://localhost:8000/openapi.json > /dev/null 2>&1; then
for _ in {1..30}; do
if curl -s http://localhost:17493/openapi.json > /dev/null 2>&1; then
break
fi
sleep 1
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"
kill $BACKEND_PID 2>/dev/null || true
exit 1
Expand All @@ -52,7 +52,7 @@ fi

# Download 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
if ! bunx --bun openapi-typescript-codegen --version > /dev/null 2>&1; then
Expand Down