mateclaw/mateclaw-server/src/main/java/vip/mate/tts/TtsProvider.java

44 lines
973 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package vip.mate.tts;
import vip.mate.system.model.SystemSettingsDTO;
import java.util.List;
/**
* TTS 语音合成提供商接口
*
* @author MateClaw Team
*/
public interface TtsProvider {
/** 提供商唯一 ID如 "edge-tts"、"openai"、"dashscope" */
String id();
/** 显示名称 */
String label();
/** 是否需要 API Key */
boolean requiresCredential();
/** 自动探测排序优先级(升序),免费 Provider 优先 */
int autoDetectOrder();
/** 判断该 provider 在当前配置下是否可用 */
boolean isAvailable(SystemSettingsDTO config);
/** 可用语音列表 */
List<String> availableVoices();
/** 默认语音 */
String defaultVoice();
/**
* 合成语音
*
* @param request 请求参数
* @param config 系统配置
* @return 合成结果(含音频字节)
*/
TtsResult synthesize(TtsRequest request, SystemSettingsDTO config);
}