Update
Browse files102 unmodified lines1031041051061061071081081091101117 unmodified lines11912012112212212312412546 unmodified lines17217317417517517617717817918018118218218318418511 unmodified lines197198199200200201202203102 unmodified lines self.all_output_data = audio_array else: self.all_output_data = np.concatenate((self.all_output_data, audio_array))
while self.all_output_data.shape[-1] >= self.output_frame_size: yield (self.output_sample_rate, yield (self.output_sample_rate, self.all_output_data[:self.output_frame_size].reshape(1, -1)) self.all_output_data = self.all_output_data[self.output_frame_size:]
7 unmodified lines try: message = self.ws.recv(timeout=5) msg = json.loads(message)
if 'serverContent' in msg: content = msg['serverContent'].get('modelTurn', {}) yield from self._process_server_content(content)46 unmodified lines <p>Speak with Gemini using real-time audio streaming</p> </div> """)
webrtc = WebRTC( label="Conversation", modality="audio", mode="send-receive", rtc_configuration=get_twilio_turn_credentials() )
webrtc.stream( GeminiHandler(), inputs=[webrtc],11 unmodified lines return chat.demo
# This is what will be imported by app.pydemo = demo()demo = demo()
if __name__ == "__main__": demo.launch(server_name="0.0.0.0")app_gemini_voice.py+9-6