Fix xfyun asr tts error

This commit is contained in:
Xin Wang
2026-05-21 16:27:24 +08:00
parent 404381c818
commit 7d36735c04
2 changed files with 110 additions and 12 deletions

View File

@@ -25,6 +25,7 @@ from pipecat.frames.frames import (
VADUserStoppedSpeakingFrame,
)
from pipecat.processors.frame_processor import FrameDirection
from pipecat.services.settings import STTSettings
from pipecat.services.stt_service import STTService
from pipecat.transcriptions.language import Language
from pipecat.utils.time import time_now_iso8601
@@ -54,7 +55,11 @@ class XfyunASRService(STTService):
open_timeout: float = 10.0,
**kwargs,
) -> None:
super().__init__(sample_rate=sample_rate, **kwargs)
super().__init__(
sample_rate=sample_rate,
settings=STTSettings(model=None, language=language),
**kwargs,
)
self._app_id = app_id or os.environ.get("XFYUN_APP_ID", "")
self._api_key = api_key or os.environ.get("XFYUN_API_KEY", "")
self._api_secret = api_secret or os.environ.get("XFYUN_API_SECRET", "")