Class

GKVoiceChatService

The GKVoiceChatService class allows your application to connect two iOS devices into a voice chat.

Declaration

@interface GKVoiceChatService : NSObject

Overview

Before you can use voice chat, your application must configure an audio session that allows for both play and recording (kAudioSessionCategory_PlayAndRecord). For more information on audio sessions, see Audio Session Programming Guide.

The voice chat service uses a client implemented by your application to find and connect to other participants. Each participant in the chat is identified by a unique participant identifier string. The client provides a participant identifier for the local user and translates other participant identifiers into connections to other users. The format and mechanism used to translate participant identifiers into network connections is defined by the client. See Game Center Programming Guide for a more complete discussion.

Your application can configure the voice chat service to control the volume level of both local and remote participants and to detect when someone is speaking.

To use the voice chat service, your application retrieves the default service and attaches a client to it, then either connects to another participant or waits for them to start a connection.

Topics

Determining Whether Voice Chat Is Available

+ isVoIPAllowed

Returns whether voice chat is allowed to be used on the device.

Getting the Shared Voice Chat Service

+ defaultVoiceChatService

Retrieves the singleton chat service.

Setting the Client

client

An object that the voice chat service uses to communicate with remote participants.

Establishing a Voice Chat

- startVoiceChatWithParticipantID:error:

Sends a request to another participant to join the voice chat.

Adjusting Audio Properties

microphoneMuted

A Boolean value that determines whether the user’s microphone is muted.

remoteParticipantVolume

A float that scales the volume of all remote participants.

Monitoring the Audio Level

inputMeteringEnabled

A Boolean value that indicates whether the microphone’s sound level is being monitored.

inputMeterLevel

The volume, in decibels (db), being received by the microphone.

outputMeteringEnabled

A Boolean value that indicates whether the voice level of remote participants is monitored.

outputMeterLevel

The volume, in decibels (db), being received from all other participants.

Ending a Voice Chat

- stopVoiceChatWithParticipantID:

Ends a previously established voice chat.

Methods Called by the Client

- acceptCallID:error:

Accepts a request from a remote user to establish a voice chat.

- denyCallID:

Rejects a request to establish a voice chat.

- receivedData:fromParticipantID:

Called by the client to deliver new data received from a remote participant.

- receivedRealTimeData:fromParticipantID:

Called by the client to deliver voice data received from a remote participant..

Constants

Voice Chat Service Error Domain

The GKVoiceChatService error domain.

GKVoiceChatServiceError

Error codes for the GKVoiceChatService error domain.

Relationships

Inherits From

See Also

Voice Chat

GKVoiceChatClient

The GKVoiceChatClient protocol is implemented to control the behavior of the GKVoiceChatService object. The voice chat client has a number of responsibilities:

Deprecated