Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

yepher
Copy link
Contributor

@yepher yepher commented Aug 28, 2025

Creates a simple example that demonstrates how to play audio at beginning of call or loops audio after office hours.

…ning of call or loop in a case where office is closed.
@yepher yepher requested a review from ShayneP August 28, 2025 01:54
async def on_enter(self):
try:
audio_frames = load_audio_file(audio_file)
await self.session.say(".", audio=audio_frames, allow_interruptions=False)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should include the full textual context.. so the chat context doesn't look empty

try:
audio_frames = load_audio_file(audio_file)
await self.session.say(".", audio=audio_frames, allow_interruptions=False)
await asyncio.sleep(3)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why sleep and then session.say? versus just including this script in the preroll file itself?


# Keep the audio playing for N seconds then hang up
start_time = datetime.now()
while True:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not await asyncio.sleep(10)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants