← Back to PRs

#7258: feat(tts): add Inworld AI TTS provider

by willsinghwilson open 2026-02-02 16:20 View on GitHub →
## Summary This PR adds Inworld AI as a new TTS provider for OpenClaw, offering: - **65 voices** across 15 languages (English, German, Chinese, French, Spanish, etc.) - **Two quality tiers**: `inworld-tts-1` (faster) and `inworld-tts-1-max` (higher quality) - **Multiple output formats**: MP3, WAV, and Opus - **Low latency**: ~130-250ms typical response time - **Competitive pricing**: ~$5-10 per million characters ## Features - Case-insensitive voice lookup - Comprehensive error handling (401, 402, 429, network errors) - Environment variable support (`INWORLD_API_KEY`) - Full unit test coverage (22 tests) ## Configuration Example ```json { "tts": { "provider": "inworld", "inworld": { "voiceId": "Dennis", "modelId": "inworld-tts-1" } } } ``` ## Test Plan - [x] Unit tests pass (22/22) - [x] Integration tests pass (9/9) - [x] Tested with real Inworld API - [x] Verified audio output quality --- 🤖 Co-authored with Claude <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a new Inworld AI Text-to-Speech provider implementation (`src/tts/inworld.ts`), including a voice/model catalog, request construction against Inworld’s `/tts/v1/voice` endpoint, decoding base64 audio content, writing the audio file to a temp directory, and mapping common HTTP/network failures to friendlier error messages. It also adds a Vitest suite intended to cover voice/model validation, API key selection, payload formatting, and several error paths. <h3>Confidence Score: 3/5</h3> - Mostly safe to merge, but fix the broken test import first. - Core provider logic is straightforward and defensive, but the added test file currently imports a non-existent module (`./inworld-provider`), which will fail CI. There are also a couple of type-safety/style issues (`any` casts) that are easy to tighten up. - src/tts/inworld.test.ts (import path + header comment), src/tts/inworld.ts (type consistency, `any` usage) <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs