@webgal-tools/voice
Version:
WebGAL GPT-SoVITS语音合成应用
105 lines • 2.49 kB
TypeScript
import { VoiceGenerationConfig } from './request.js';
export interface CharacterVoiceConfig {
character_name: string;
auto?: boolean;
gpt: string;
sovits: string;
ref_audio: string;
ref_text: string;
prompt?: string;
translate_to?: string;
inferrence_config?: VoiceGenerationConfig;
}
export interface TranslateConfig {
check: boolean;
model_type: 'ollama' | 'openai' | 'anthropic' | 'google' | 'mistral' | 'cohere' | 'custom';
base_url: string;
api_key?: string;
model_name: string;
context_size?: number;
additional_prompt?: string;
temperature?: number;
max_tokens?: number;
}
export interface VoiceConfig {
volume: number;
gpt_sovits_url: string;
gpt_sovits_path: string;
model_version: string;
translate?: TranslateConfig;
characters: CharacterVoiceConfig[];
}
export declare class VoiceConfigManager {
private config;
private configPath;
constructor(workDirectory: string);
/**
* 加载语音配置文件
*/
loadConfig(): VoiceConfig;
/**
* 验证配置文件格式
*/
private validateConfig;
/**
* 验证翻译配置
*/
private validateTranslateConfig;
/**
* 检查是否需要API密钥
*/
private requiresApiKey;
/**
* 验证推理配置
*/
private validateInferenceConfig;
/**
* 获取角色配置
*/
getCharacterConfig(characterName: string): CharacterVoiceConfig | null;
/**
* 获取所有角色名称
*/
getAllCharacterNames(): string[];
/**
* 获取默认音量设置
*/
getDefaultVolume(): number;
/**
* 检查角色是否已配置
*/
hasCharacterConfig(characterName: string): boolean;
/**
* 获取配置文件路径
*/
getConfigPath(): string;
/**
* 获取GPT-SoVITS服务URL
*/
getGptSovitsUrl(): string;
/**
* 获取GPT-SoVITS项目路径
*/
getGptSovitsPath(): string;
/**
* 获取模型版本
*/
getModelVersion(): string;
/**
* 获取翻译配置
*/
getTranslateConfig(): TranslateConfig;
/**
* 检查是否启用翻译
*/
isTranslateEnabled(): boolean;
/**
* 获取角色的翻译目标语言
*/
getCharacterTranslateTarget(characterName: string): string | null;
/**
* 重新加载配置
*/
reloadConfig(): VoiceConfig;
}
//# sourceMappingURL=config.d.ts.map