feat: TTS 服务功能完善(任务管理、配置优化、客户端实现)
This commit is contained in:
@@ -2,7 +2,37 @@ package com.emotion.service;
|
||||
|
||||
public interface TtsEngineClient {
|
||||
|
||||
TtsEngineResult synthesize(String text, String voice, String outputPath);
|
||||
TtsEngineResult synthesize(String text, String voice, String outputPath, SynthesisOptions options);
|
||||
|
||||
class SynthesisOptions {
|
||||
private final Double speechRate;
|
||||
private final Double pitch;
|
||||
private final String emotion;
|
||||
|
||||
public SynthesisOptions(Double speechRate, Double pitch, String emotion) {
|
||||
this.speechRate = speechRate;
|
||||
this.pitch = pitch;
|
||||
this.emotion = emotion;
|
||||
}
|
||||
|
||||
public Double getSpeechRate() {
|
||||
return speechRate;
|
||||
}
|
||||
|
||||
public Double getPitch() {
|
||||
return pitch;
|
||||
}
|
||||
|
||||
public String getEmotion() {
|
||||
return emotion;
|
||||
}
|
||||
|
||||
public String cacheKey() {
|
||||
return "rate=" + (speechRate == null ? "" : speechRate)
|
||||
+ ";pitch=" + (pitch == null ? "" : pitch)
|
||||
+ ";emotion=" + (emotion == null ? "" : emotion);
|
||||
}
|
||||
}
|
||||
|
||||
class TtsEngineResult {
|
||||
private final boolean success;
|
||||
|
||||
Reference in New Issue
Block a user