Merge pull request #1671 from pipecat-ai/khk/rime-arcana
support for rime arcana model
This commit is contained in:
@@ -5,6 +5,12 @@ All notable changes to **Pipecat** will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added support to `RimeHttpTTSService` for the `arcana` model.
|
||||||
|
|
||||||
## [0.0.66] - 2025-05-02
|
## [0.0.66] - 2025-05-02
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -120,7 +126,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
not a very common case.
|
not a very common case.
|
||||||
|
|
||||||
- Added `RivaSegmentedSTTService`, which allows Riva offline/batch models, such
|
- Added `RivaSegmentedSTTService`, which allows Riva offline/batch models, such
|
||||||
as to be "canary-1b-asr" used in Pipecat.
|
as to be "canary-1b-asr" used in Pipecat.
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection, _: argparse.Namespac
|
|||||||
|
|
||||||
tts = RimeHttpTTSService(
|
tts = RimeHttpTTSService(
|
||||||
api_key=os.getenv("RIME_API_KEY", ""),
|
api_key=os.getenv("RIME_API_KEY", ""),
|
||||||
voice_id="rex",
|
voice_id="luna",
|
||||||
|
model="arcana",
|
||||||
aiohttp_session=session,
|
aiohttp_session=session,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -400,6 +400,13 @@ class RimeHttpTTSService(TTSService):
|
|||||||
payload["modelId"] = self._model_name
|
payload["modelId"] = self._model_name
|
||||||
payload["samplingRate"] = self.sample_rate
|
payload["samplingRate"] = self.sample_rate
|
||||||
|
|
||||||
|
# Arcana does not support PCM audio
|
||||||
|
if payload["modelId"] == "arcana":
|
||||||
|
headers["Accept"] = "audio/wav"
|
||||||
|
need_to_strip_wav_header = True
|
||||||
|
else:
|
||||||
|
need_to_strip_wav_header = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await self.start_ttfb_metrics()
|
await self.start_ttfb_metrics()
|
||||||
|
|
||||||
@@ -420,6 +427,10 @@ class RimeHttpTTSService(TTSService):
|
|||||||
CHUNK_SIZE = 1024
|
CHUNK_SIZE = 1024
|
||||||
|
|
||||||
async for chunk in response.content.iter_chunked(CHUNK_SIZE):
|
async for chunk in response.content.iter_chunked(CHUNK_SIZE):
|
||||||
|
if need_to_strip_wav_header and chunk.startswith(b"RIFF"):
|
||||||
|
chunk = chunk[44:]
|
||||||
|
need_to_strip_wav_header = False
|
||||||
|
|
||||||
if len(chunk) > 0:
|
if len(chunk) > 0:
|
||||||
await self.stop_ttfb_metrics()
|
await self.stop_ttfb_metrics()
|
||||||
frame = TTSAudioRawFrame(chunk, self.sample_rate, 1)
|
frame = TTSAudioRawFrame(chunk, self.sample_rate, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user