I added voice chat to my iOS app using GameKit connection as a base and the delay in transmission (over bluetooth) appears to be about 4 seconds, which translates to 8 seconds to receive a reply to a question.
While I'm not entirely sure what is causing such large delay, I have a couple of suspects.
First, I noticed that it's using a method voiceChatService:sendData:toParticipantID:
from GKVoiceChatClient
while there is also voiceChatService:sendRealTimeData:toParticipantID:
available. Yet I do not see any obvious way to make it use RealTimeData
version of the method instead, even if I implement it. How can I do that and is it likely to help?
Also, I changed the data mode to GKSendDataUnreliable
as with GKSendDataReliable
I would sometimes hear the same thing twice as the app likely re-sent the unconfirmed bits. This removed the echo-like effect, but did not improve the lag.
What else can I do to improve real time performance?