HttpSpeech.h header

#include <ew/app/HttpSpeech.h>

Namespace ew::app

AiSpeechResult struct

struct ew::app::AiSpeechResult

The result of a text-to-speech request: the synthesized audio bytes (when ok) or an error.

Members

bool ew::app::AiSpeechResult::ok = false

True when the model returned audio; false when the request errored.

QByteArray ew::app::AiSpeechResult::audioData

The synthesized audio bytes (in the requested format), when ok.

QString ew::app::AiSpeechResult::error

A human-readable error message (when not ok).

Functions

AiSpeechResult ew::app::generateSpeech(const AiSettings &settings, const QString &text)

Synthesizes text to speech via the configured speech endpoint (see AiSettings), reusing the chat API key, and returns the audio bytes or an error. Self-contained and blocking (a private network manager plus a local event loop), so it is safe to call off the GUI thread. Returns an error without touching the network when voice generation is not configured or text is empty. Provider-agnostic: any OpenAI-compatible audio/speech endpoint.