Skip to content

Commit 14baae9

Browse files
RhoninRhonin
authored andcommitted
fix(provider): read StepFun ASR audio off loop
1 parent 604ecd8 commit 14baae9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

astrbot/core/provider/sources/stepfun_asr_source.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import asyncio
12
import base64
23
import json
34
import uuid
@@ -173,7 +174,8 @@ async def prepare_audio_input(
173174
source_path = converted_path
174175
audio_type = "wav"
175176

176-
encoded_audio = base64.b64encode(source_path.read_bytes()).decode("utf-8")
177+
raw_audio = await asyncio.to_thread(source_path.read_bytes)
178+
encoded_audio = base64.b64encode(raw_audio).decode("utf-8")
177179
return encoded_audio, build_audio_format(audio_type), cleanup_paths
178180

179181

0 commit comments

Comments
 (0)