Has anyone seen this? Gemini Speech Sensitivity?

UCMUserAZ

Customer
Joined
Dec 19, 2023
Messages
163
Reaction score
248
I have been testing a few gemini call scripts with 3cx this week. Very powerful and awesome I have to say. It seems the speech sensitivity once connected with Gemini is really touchy. Testing without speakerphone it works really good. When on speakerphone (iOS latest; 17pro) Gemini can interrupt sometimes. I tested with just a simple greeting and it sometimes repeats. If I put speakerphone on with the mic muted, it works 100%. Not sure if the iphone mic is picking up the speakerphone audio or what or an iphone issue. I don't think this is anything on the 3cx side, but just how Gemini is listening. I see gemini has some realtime_input_config settings around: https://aistudio.google.com/docs/live-api/capabilities
  • activityHandling (NO_INTERRUPTION)
  • automaticActivityDetection.startOfSpeechSensitivity
  • automaticActivityDetection.endOfSpeechSensitivity
  • automaticActivityDetection.silenceDurationMs
I do not think 3cx exposes these settings through StartGeminiVoiceSessionAsync() or global parameters. Do you think it would be possible to add support for passing realtimeInputConfig when initializing the Gemini Live session? Only reason I ask, I know some of our callers use speakerphone and we would hear this feedback from them on the Ai voice agent. Not sure if Grok or OpenAi also have this kind of sensitivity.

If anyone out there has a gemini call script, I would be curious if speakerphone produces the same? It is just odd where if I mute the mic on speakerphone it works perfect so would not think anything in my prompt.

Thanks in advance!
 
The mute test is a good clue.

Please clarify the call route; is the iOS making an incoming call through the PSTN network? Is it caling as an extension? Can we have an explicit description of the call route end-to-end?

Try the same greeting at low and high speaker volume, then repeat it on a second (different model, ideally not iOS) phone using the same call route and Gemini model.

If the interruptions get more frequent as the volume goes up, that would point toward speaker audio feeding back into the mic.

If different model phones give different experiences, that adds hints towards noise cancellation settings.
 
  • Like
Reactions: KyriacosS_3CX
The mute test is a good clue.

Please clarify the call route; is the iOS making an incoming call through the PSTN network? Is it caling as an extension? Can we have an explicit description of the call route end-to-end?

Try the same greeting at low and high speaker volume, then repeat it on a second (different model, ideally not iOS) phone using the same call route and Gemini model.

If the interruptions get more frequent as the volume goes up, that would point toward speaker audio feeding back into the mic.

If different model phones give different experiences, that adds hints towards noise cancellation settings.
Call Flow: on iphone, Call DID, comes thru our SIP trunk at teleco, enable speakerphone, call hits SBC, 3cx runs call script from that DID, gemini live plays first greeting, then will repeat it. Almost like it heard itself. I just tested the base callscript with no mods and it repeats when on Speaker. Mic muted works fine and without speakerphone works fine. I will test some other phones. Thanks.
 
Some additional testing, same on Samsung speaker. Also, not sure if intended. Does barge in work for others testing these scripts? Like if the Ai agent is talking and you interrupt it. I am finding it wants to finish what it is saying before allowing you to interrupt if it is answering a question. Not sure if others have seen that. Thanks.
 
To provide some additional feedback on the callscripts. Tested the callscript using OpenAi voice Shimmer. Tested a variety of the gpt-realtime models. The gpt-realtime-2.1 seems to perform the best. Barge in works, but it seems still a little sensitive on speakerphone (iphone and Samsung tested). It does not repeat the greeting or anything like Gemini so it seems to perform better from that standpoint than Gemini. OpenAi also exposes some params when setting up the connection around VAD threshold, silence duration, prefix padding, and interruption control. These are not currently available in the 3cx callscripts. Maybe for good reason, but here would be possible example params that might assist with the sensitivity if 3cx supported. I realize this would be an enhancement so just wanted to share feedback. But I do have to say, this callscript functionality is awesome. I added the google grounded search, offering to text the info, knowledge lookup, and not heavy hours and hours of coding. The way 3cx implemented this callscript functionality is great! I love that 3cx is c# based. Very user friendly.

For OpenAi call script
await MyCall.StartOpenAiVoiceSessionAsync(
apiKey: Optional(ApiKeyOverride),
model: Optional(ModelOverride),
customInstructions: AgentInstructions,
voiceName: VoiceName,
agentName: AgentName,

// Proposed new optional parameters
vadThreshold: 0.7,
vadPrefixPaddingMs: 300,
vadSilenceDurationMs: 600,
interruptResponse: true,
createResponse: true
);

For Gemini call script
await MyCall.StartGeminiVoiceSessionAsync(
apiKey: Optional(ApiKeyOverride),
model: Optional(ModelOverride),
customInstructions: AgentInstructions,
voiceName: VoiceName,
agentName: AgentName,

// Proposed new optional VAD parameters
automaticActivityDetection: true,
startOfSpeechSensitivity: "START_SENSITIVITY_LOW",
endOfSpeechSensitivity: "END_SENSITIVITY_LOW",
prefixPaddingMs: 300,
silenceDurationMs: 700,
activityHandling: "START_OF_ACTIVITY_INTERRUPTS"
);
 
Also, it seems Barge In works when on a call with OpenAi, but not Gemini Live. Not sure if others see that. I tested without speakerphone and when Gemini is talking back to me, if I interrupt it keeps talking thru even though it heard my request. Just testing various things comparing. Thanks.
 
Hello, we are looking into improving how Gemini handles this scenario on our end and we will revert. Until we have something ready you have the following options:

As you found out, avoid the speakerphone on affected devices or switch (only the voice class) to one of the other AI providers as they do not have this issue.
 
Hello, we are looking into improving how Gemini handles this scenario on our end and we will revert. Until we have something ready you have the following options:

As you found out, avoid the speakerphone on affected devices or switch (only the voice class) to one of the other AI providers as they do not have this issue.
Thank you. You are leading in this space in my opinion. Have not tested grok. The users prefer the Gemini voice. Although OpenAi (realtime 2.1) was better in speakerphone, it did pickup some noise where it would say "what was that", etc. The pricing for Gemini was way more cost effective as well. We will await the 3cx enhancement tweaks. Will be happy to test our few call scripts if needed once ready. Thanks again for being on top of all this. Great stuff!
 

Latest Posts

Forum statistics

Threads
112,567
Messages
593,345
Members
165,787
Latest member
SteveBMG