GWDevHub TTS API

Free text-to-speech service for Guild Wars

v1.0 · No API key required

Getting Started

Usage

# Start server on port 9919 using "myapikey" to access ElevenLabs' TTS API GWDecode.exe --server 9919 --elevenlabs-api-key "myapikey"
API Documentation: Once the server is running, visit http://localhost:9919/ for these API docs.

Overview

The GWDevHub TTS API is a free text-to-speech service specifically designed for Guild Wars players. This API converts Guild Wars dialog text (both encoded and decoded) into natural-sounding MP3 audio files.

Note: This service is provided free of charge for the Guild Wars community. No API key required!

Endpoint

POST /decode.mp3

Generates an MP3 audio file from Guild Wars dialog text.

Request Headers

Header Value Required
Content-Type application/json Yes
Accept audio/mpeg Recommended

Request Body Parameters

Parameter Type Required Description
encoded array[integer] Yes Array of integers representing the encoded Guild Wars message string (UTF-16 code points)
decoded array[integer] No Array of integers representing the decoded/readable message string (UTF-16 code points)
language integer Yes Guild Wars language code (enum value)
speaker_gender string Yes Gender of the speaking NPC. Valid values: "m" (male), "f" (female)
speaker_race string Yes Race of the speaking NPC (e.g., "Human", "Dwarf", "Charr", "Norn", "Asura")
player_gender string Yes Gender of the player character. Valid values: "m" (male), "f" (female)
Important: The encoded and decoded arrays contain UTF-16 code points (unsigned 16-bit integers). Each element represents one character from the original wide string (wchar_t).

Response

Success Response

Error Response

Example Request

Here's an example of how the client makes a request:

{ "encoded": [33026, 28378, 56845, 57638, 29327], "language": 0, "speaker_gender": "m", "speaker_race": "Human", "player_gender": "f" }
Note: The example above shows simplified integer arrays. In practice, these arrays may contain multi-byte Unicode characters represented as UTF-16 code points (values > 255).

Implementation Details

Character Encoding

The client converts wide character strings (wchar_t*) to arrays of unsigned 32-bit integers, where each integer represents a UTF-16 code point:

// C++ client-side conversion example: nlohmann::json encoded_array = nlohmann::json::array(); for (const auto& c : audio->encoded_message) { encoded_array.push_back(static_cast<uint32_t>(c)); }

Language Codes

The language parameter uses Guild Wars internal language enum values:

Test the API

Use this form to test the /decode.mp3 endpoint directly from your browser:

Enter space-separated hex values with 0x prefix (e.g., 0x123 0xaff 0x3fa)