feat(#404): add speech settings page with provider config
All checks were successful
ci/woodpecker/push/web Pipeline was successful
All checks were successful
ci/woodpecker/push/web Pipeline was successful
Implements the SpeechSettings component with four sections: - STT settings (enable/disable, language preference) - TTS settings (enable/disable, voice selector, tier preference, auto-play, speed control) - Voice preview with test button - Provider status with health indicators Also adds Slider UI component and getHealthStatus API client function. 30 unit tests covering all sections, toggles, voice loading, and PDA-friendly design. Fixes #404 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,12 +6,16 @@
|
||||
import { apiGet } from "./client";
|
||||
import { API_BASE_URL } from "../config";
|
||||
|
||||
export type SpeechTier = "default" | "premium" | "fallback";
|
||||
|
||||
export interface VoiceInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
language: string;
|
||||
gender?: string;
|
||||
preview_url?: string;
|
||||
tier?: SpeechTier;
|
||||
isDefault?: boolean;
|
||||
}
|
||||
|
||||
export interface SynthesizeOptions {
|
||||
@@ -26,11 +30,31 @@ export interface VoicesResponse {
|
||||
data: VoiceInfo[];
|
||||
}
|
||||
|
||||
export interface ProviderHealth {
|
||||
available: boolean;
|
||||
}
|
||||
|
||||
export interface HealthResponse {
|
||||
data: {
|
||||
stt: ProviderHealth;
|
||||
tts: ProviderHealth;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch available TTS voices
|
||||
* Optionally filter by tier (default, premium, fallback)
|
||||
*/
|
||||
export async function getVoices(): Promise<VoicesResponse> {
|
||||
return apiGet<VoicesResponse>("/api/speech/voices");
|
||||
export async function getVoices(tier?: SpeechTier): Promise<VoicesResponse> {
|
||||
const endpoint = tier ? `/api/speech/voices?tier=${tier}` : "/api/speech/voices";
|
||||
return apiGet<VoicesResponse>(endpoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch health status of speech providers (STT and TTS)
|
||||
*/
|
||||
export async function getHealthStatus(): Promise<HealthResponse> {
|
||||
return apiGet<HealthResponse>("/api/speech/health");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user