mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:10:42 +00:00
feat(tts): resolve channel account config generically
This commit is contained in:
@@ -185,6 +185,7 @@ describe("dispatchOutbound", () => {
|
||||
text: "read this aloud",
|
||||
cfg: {},
|
||||
channel: "qqbot",
|
||||
accountId: "qq-main",
|
||||
});
|
||||
expect(audioFileToSilkBase64Mock).toHaveBeenCalledWith("/tmp/openclaw-qqbot/tts.wav");
|
||||
expect(sendVoiceMessageMock).toHaveBeenCalledWith(
|
||||
|
||||
@@ -57,7 +57,12 @@ export interface GatewayPluginRuntime {
|
||||
};
|
||||
};
|
||||
tts: {
|
||||
textToSpeech: (params: { text: string; cfg: unknown; channel: string }) => Promise<{
|
||||
textToSpeech: (params: {
|
||||
text: string;
|
||||
cfg: unknown;
|
||||
channel: string;
|
||||
accountId?: string;
|
||||
}) => Promise<{
|
||||
success: boolean;
|
||||
audioPath?: string;
|
||||
provider?: string;
|
||||
|
||||
@@ -37,7 +37,12 @@ import {
|
||||
/** TTS provider interface — injected from the outer layer. */
|
||||
export interface TTSProvider {
|
||||
/** Framework TTS: text → audio file path. */
|
||||
textToSpeech(params: { text: string; cfg: unknown; channel: string }): Promise<{
|
||||
textToSpeech(params: {
|
||||
text: string;
|
||||
cfg: unknown;
|
||||
channel: string;
|
||||
accountId?: string;
|
||||
}): Promise<{
|
||||
success: boolean;
|
||||
audioPath?: string;
|
||||
provider?: string;
|
||||
@@ -406,6 +411,7 @@ export async function sendTextAsVoiceReply(
|
||||
text: ttsText,
|
||||
cfg,
|
||||
channel: "qqbot",
|
||||
accountId: account.accountId,
|
||||
});
|
||||
if (!ttsResult.success || !ttsResult.audioPath) {
|
||||
log?.error(`TTS failed: ${ttsResult.error ?? "unknown"}`);
|
||||
|
||||
Reference in New Issue
Block a user