openai / openai-realtime-console

React app for inspecting, building and debugging with the Realtime API
MIT License
2.12k stars 779 forks source link

Add onAudioStart and onAudioStop events to WaveStreamPlayer #45

Open Stevenic opened 1 month ago

Stevenic commented 1 month ago

I need to know when playback of the generated audio stream finishes so I updated my copy of the WaveStreamPlayer class to include onAudioStart and onAudioStop events. It might be useful to just add these to that class. Here's the changes I made:

image

image

khorwood-openai commented 1 month ago

This is helpful! I think the intention would be to open source this library; so let me look into that and update this when there's a decision there.

omgupta-iitk commented 1 week ago

there is a issue with this, I can't make use out of it as ,the .onAudioStop gets intializes multiple times even when there is no audio.