minor examples cleanup
This commit is contained in:
@@ -153,7 +153,6 @@ async def main():
|
|||||||
@transport.event_handler("on_first_participant_joined")
|
@transport.event_handler("on_first_participant_joined")
|
||||||
async def on_first_participant_joined(transport, participant):
|
async def on_first_participant_joined(transport, participant):
|
||||||
logger.debug("First participant joined: {}", participant["id"])
|
logger.debug("First participant joined: {}", participant["id"])
|
||||||
await transport.capture_participant_transcription(participant["id"])
|
|
||||||
|
|
||||||
@transport.event_handler("on_participant_left")
|
@transport.event_handler("on_participant_left")
|
||||||
async def on_participant_left(transport, participant, reason):
|
async def on_participant_left(transport, participant, reason):
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ async def main():
|
|||||||
|
|
||||||
@transport.event_handler("on_first_participant_joined")
|
@transport.event_handler("on_first_participant_joined")
|
||||||
async def on_first_participant_joined(transport, participant):
|
async def on_first_participant_joined(transport, participant):
|
||||||
await transport.capture_participant_transcription(participant["id"])
|
print(f"Participant joined: {participant}")
|
||||||
|
|
||||||
@transport.event_handler("on_participant_left")
|
@transport.event_handler("on_participant_left")
|
||||||
async def on_participant_left(transport, participant, reason):
|
async def on_participant_left(transport, participant, reason):
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ async def main():
|
|||||||
|
|
||||||
@transport.event_handler("on_first_participant_joined")
|
@transport.event_handler("on_first_participant_joined")
|
||||||
async def on_first_participant_joined(transport, participant):
|
async def on_first_participant_joined(transport, participant):
|
||||||
|
print(f"Participant joined: {participant}")
|
||||||
await transport.capture_participant_transcription(participant["id"])
|
await transport.capture_participant_transcription(participant["id"])
|
||||||
|
|
||||||
@transport.event_handler("on_participant_left")
|
@transport.event_handler("on_participant_left")
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ from loguru import logger
|
|||||||
from pipecatcloud.agent import DailySessionArguments
|
from pipecatcloud.agent import DailySessionArguments
|
||||||
from word_list import generate_game_words
|
from word_list import generate_game_words
|
||||||
|
|
||||||
from pipecat.audio.resamplers.soxr_resampler import SOXRAudioResampler
|
from pipecat.audio.utils import create_default_resampler
|
||||||
from pipecat.audio.vad.silero import SileroVADAnalyzer
|
from pipecat.audio.vad.silero import SileroVADAnalyzer
|
||||||
from pipecat.frames.frames import (
|
from pipecat.frames.frames import (
|
||||||
BotStoppedSpeakingFrame,
|
BotStoppedSpeakingFrame,
|
||||||
@@ -524,7 +524,7 @@ async def tts_audio_raw_frame_filter(frame: Frame):
|
|||||||
|
|
||||||
|
|
||||||
# Create a resampler instance once
|
# Create a resampler instance once
|
||||||
resampler = SOXRAudioResampler()
|
resampler = create_default_resampler()
|
||||||
|
|
||||||
|
|
||||||
async def tts_to_input_audio_transformer(frame: Frame):
|
async def tts_to_input_audio_transformer(frame: Frame):
|
||||||
@@ -689,8 +689,6 @@ Important guidelines:
|
|||||||
@transport.event_handler("on_first_participant_joined")
|
@transport.event_handler("on_first_participant_joined")
|
||||||
async def on_first_participant_joined(transport, participant):
|
async def on_first_participant_joined(transport, participant):
|
||||||
logger.info("First participant joined: {}", participant["id"])
|
logger.info("First participant joined: {}", participant["id"])
|
||||||
# Capture the participant's transcription
|
|
||||||
await transport.capture_participant_transcription(participant["id"])
|
|
||||||
# Kick off the conversation
|
# Kick off the conversation
|
||||||
await task.queue_frames([context_aggregator.user().get_context_frame()])
|
await task.queue_frames([context_aggregator.user().get_context_frame()])
|
||||||
# Start the game timer
|
# Start the game timer
|
||||||
|
|||||||
Reference in New Issue
Block a user