usingvarclient=newGeminiClient(apiKey);try{usingvarcts=newCancellationTokenSource(TimeSpan.FromSeconds(30));// Sends PCM audio and verifies audio parts are received in the response.awaitusingvarsession=awaitclient.ConnectLiveAsync(CreateLiveConfig(),cancellationToken:cts.Token);// Generate a short 16-bit PCM 16kHz sine wave (0.5s of 440Hz tone).varsampleRate=16000;varsamples=(int)(sampleRate*0.5);varpcmBytes=newbyte[samples*2];for(inti=0;i<samples;i++){varsample=(short)(Math.Sin(2*Math.PI*440*i/sampleRate)*8000);pcmBytes[i*2]=(byte)(sample&0xFF);pcmBytes[i*2+1]=(byte)((sample>>8)&0xFF);}awaitsession.SendAudioAsync(pcmBytes,cts.Token);// Also send text to ensure a response is triggered.awaitsession.SendTextAsync("Repeat what you heard",cts.Token);boolreceivedAudioParts=false;awaitforeach(varmessageinsession.ReadEventsAsync(cts.Token)){if(message.ServerContent?.ModelTurn?.Partsis{}parts){foreach(varpartinparts){if(part.InlineData?.Datais{Length:>0}){receivedAudioParts=true;}}}if(message.ServerContent?.TurnComplete==true){break;}}}catch(WebSocketExceptionex){}catch(OperationCanceledException){}