Skip to content

Commit ff0eedf

Browse files
committed
Add stopConversation example to OpenAI realtime snippet
1 parent de74629 commit ff0eedf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,15 @@ final class RealtimeManager {
10311031
self.audioPCMPlayer = audioPCMPlayer
10321032
self.realtimeSession = realtimeSession
10331033
}
1034+
1035+
func stopConversation() {
1036+
self.microphonePCMSampleVendor?.stop()
1037+
self.audioPCMPlayer?.interruptPlayback()
1038+
self.realtimeSession?.disconnect()
1039+
self.microphonePCMSampleVendor = nil
1040+
self.audioPCMPlayer = nil
1041+
self.realtimeSession = nil
1042+
}
10341043
}
10351044
```
10361045

0 commit comments

Comments
 (0)