fix errors
This commit is contained in:
@@ -45,9 +45,13 @@ class TimestampLogger(FrameProcessor):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
async def process_frame(self, frame: Frame, direction: FrameDirection):
|
async def process_frame(self, frame: Frame, direction: FrameDirection):
|
||||||
|
await super().process_frame(frame, direction)
|
||||||
|
|
||||||
if isinstance(frame, TTSTextFrame):
|
if isinstance(frame, TTSTextFrame):
|
||||||
pts_str = format_pts(frame.pts) if frame.pts else "no PTS"
|
pts_str = format_pts(frame.pts) if frame.pts else "no PTS"
|
||||||
logger.info(f"🎯 Word timestamp: '{frame.text}' at {pts_str}")
|
logger.info(f"🎯 Word timestamp: '{frame.text}' at {pts_str}")
|
||||||
|
|
||||||
|
# Always push all frames through
|
||||||
await self.push_frame(frame, direction)
|
await self.push_frame(frame, direction)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ try:
|
|||||||
FormatPcm,
|
FormatPcm,
|
||||||
PostedUtterance,
|
PostedUtterance,
|
||||||
PostedUtteranceVoiceWithId,
|
PostedUtteranceVoiceWithId,
|
||||||
TimestampType,
|
|
||||||
)
|
)
|
||||||
except ModuleNotFoundError as e: # pragma: no cover - import-time guidance
|
except ModuleNotFoundError as e: # pragma: no cover - import-time guidance
|
||||||
logger.error(f"Exception: {e}")
|
logger.error(f"Exception: {e}")
|
||||||
@@ -208,7 +207,7 @@ class HumeTTSService(WordTTSService):
|
|||||||
format=pcm_fmt,
|
format=pcm_fmt,
|
||||||
instant_mode=True,
|
instant_mode=True,
|
||||||
version=version,
|
version=version,
|
||||||
include_timestamp_types=[TimestampType.WORD],
|
include_timestamp_types=["word"],
|
||||||
):
|
):
|
||||||
# Check if this is a timestamp chunk
|
# Check if this is a timestamp chunk
|
||||||
chunk_type = getattr(chunk, "type", None)
|
chunk_type = getattr(chunk, "type", None)
|
||||||
|
|||||||
Reference in New Issue
Block a user