Skip to content

Commit e1f6fbd

Browse files
authored
Remove create_speech() from rime synthesizer (#6)
1 parent 69df5bc commit e1f6fbd

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

vocode/streaming/synthesizer/rime_synthesizer.py

-35
Original file line numberDiff line numberDiff line change
@@ -142,38 +142,3 @@ def get_request_body(self, text):
142142
body["modelId"] = self.model_id
143143

144144
return body
145-
146-
async def create_speech(
147-
self,
148-
message: BaseMessage,
149-
chunk_size: int,
150-
is_first_text_chunk: bool = False,
151-
is_sole_text_chunk: bool = False,
152-
) -> SynthesisResult:
153-
headers = {
154-
"Authorization": self.api_key,
155-
"Content-Type": "application/json",
156-
}
157-
158-
body = self.get_request_body(message.text)
159-
160-
async with self.async_requestor.get_session().post(
161-
self.base_url,
162-
headers=headers,
163-
json=body,
164-
timeout=aiohttp.ClientTimeout(total=15),
165-
) as response:
166-
if not response.ok:
167-
raise Exception(f"Rime API error: {response.status}, {await response.text()}")
168-
data = await response.json()
169-
170-
audio_file = io.BytesIO(base64.b64decode(data.get("audioContent")))
171-
172-
result = self.create_synthesis_result_from_wav(
173-
synthesizer_config=self.synthesizer_config,
174-
file=audio_file,
175-
message=message,
176-
chunk_size=chunk_size,
177-
)
178-
179-
return result

0 commit comments

Comments
 (0)