usingvarclient=newGeminiClient(apiKey);try{usingvarcts=newCancellationTokenSource(TimeSpan.FromSeconds(30));// Connects with a speech config to select a specific voice.varconfig=CreateLiveConfig();config.GenerationConfig!.SpeechConfig=newSpeechConfig{VoiceConfig=newVoiceConfig{PrebuiltVoiceConfig=newPrebuiltVoiceConfig{VoiceName="Kore",},},};awaitusingvarsession=awaitclient.ConnectLiveAsync(config,cancellationToken:cts.Token);// Send a message — voice selection is applied at setup time.awaitsession.SendTextAsync("Say hello",cts.Token);boolreceivedResponse=false;awaitforeach(varmessageinsession.ReadEventsAsync(cts.Token)){if(message.ServerContent?.ModelTurn?.Partsis{Count:>0}){receivedResponse=true;}if(message.ServerContent?.TurnComplete==true){break;}}}catch(WebSocketExceptionex){}catch(OperationCanceledException){}