-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid cutting off the beginning of the audio #1008
base: main
Are you sure you want to change the base?
Conversation
this.botAudio.onplaying = async (event) => { | ||
this.log("onplaying") | ||
this.log("Will send the audio message to play the audio at the next tick") | ||
this.dailyCallObject.sendAppMessage("playable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "onplaying" event is supposed to trigger only after playback has started (spec here). While it helps, it does not completely solve the issue.
To avoid any audio clipping, if we rely only on this approach, we would still need to add a timeout of at least 1 second before sending the app message.
return | ||
await task.queue_frames( | ||
[ | ||
SilenceFrame(duration=0.5), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid adding a timeout on the client side, we are sending a silence frame before the TTSSpeakFrame
. During testing, this approach feels more natural and seems to work better than adding a sleep on the client side.
An example of signaling using an app message to avoid avoid cutting off the beginning of the audio.