| # Inflect-Micro-v2 C++ SDK for AX650 | |
| ## Build | |
| ```bash | |
| export AX_RUNTIME_ROOT=/path/to/ax650_bsp | |
| mkdir build && cd build | |
| cmake .. && make | |
| ``` | |
| Produces: | |
| - `libinflect_tts.a` — TTS engine library | |
| - `tts_cli` — Command-line TTS tool | |
| - `tts_server` — OpenAI-compatible HTTP server | |
| ## CLI | |
| ```bash | |
| ./tts_cli --text "Hello world" --output speech.wav | |
| ./tts_cli --text "Faster speech" --speed 1.5 --output fast.wav | |
| ``` | |
| ## HTTP Server (OpenAI-compatible) | |
| ```bash | |
| ./tts_server --port 8000 | |
| ``` | |
| ```bash | |
| # Test | |
| curl -X POST http://localhost:8000/v1/audio/speech \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"model":"tts-1","input":"Hello world"}' \ | |
| --output speech.wav | |
| ``` | |
| For full HTTP support, install cpp-httplib and nlohmann/json, | |
| uncomment `USE_CPPHTTPLIB` in CMakeLists.txt. | |
| ## API | |
| | Endpoint | Method | Description | | |
| |----------|--------|-------------| | |
| | `/health` | GET | Health check | | |
| | `/v1/models` | GET | List models | | |
| | `/v1/audio/speech` | POST | OpenAI TTS API | | |
| Request body for `/v1/audio/speech`: | |
| ```json | |
| { | |
| "model": "tts-1", | |
| "input": "Hello world", | |
| "voice": "default", | |
| "speed": 1.0, | |
| "response_format": "wav" | |
| } | |
| ``` | |