Class: GKVoiceChatService
Overview
The GKVoiceChatService class allows your application to connect two iOS devices into a voice chat.
Instance Attribute Summary (collapse)
-
- client
An object that the voice chat service uses to communicate with remote participants.
-
- inputMeteringEnabled
A Boolean value that indicates whether the microphone’s sound level is being monitored.
-
- inputMeterLevel
readonly
The volume, in decibels (db), being received by the microphone.
-
- microphoneMuted
A Boolean value that determines whether the user’s microphone is muted.
-
- outputMeteringEnabled
A Boolean value that indicates whether the voice level of remote participants is monitored.
-
- outputMeterLevel
readonly
The volume, in decibels (db), being received from all other participants.
-
- remoteParticipantVolume
A float that scales the volume of all remote participants.
Class Method Summary (collapse)
-
+ defaultVoiceChatService
Retrieves the singleton chat service.
-
+ isVoIPAllowed
Returns whether voice chat is allowed to be used on the device.
Instance Method Summary (collapse)
-
- 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..
-
- startVoiceChatWithParticipantID:error:
Sends a request to another participant to join the voice chat.
-
- stopVoiceChatWithParticipantID:
Ends a previously established voice chat.
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Attribute Details
- (Object) client
An object that the voice chat service uses to communicate with remote participants. The client’s chief responsibility is to provide a network connection that the voice chat service can use to connect to another participant.
- (Boolean) inputMeteringEnabled
A Boolean value that indicates whether the microphone’s sound level is being monitored. If YES, your application can read the inputMeterLevel property to monitor the sound level of the microphone. If NO, the value of the inputMeterLevel property is undefined. Default is NO. When your application doesn’t need to monitor the microphone, it should set this property to NO to improve performance.
- (Float) inputMeterLevel (readonly)
The volume, in decibels (db), being received by the microphone. (read-only) The value of this property is undefined if inputMeteringEnabled is set to NO.
- (Boolean) microphoneMuted
A Boolean value that determines whether the user’s microphone is muted. YES if the user’s microphone is turned off; NO if the user’s speech is being transmitted to remote participants. The default is NO.
- (Boolean) outputMeteringEnabled
A Boolean value that indicates whether the voice level of remote participants is monitored. If YES, your application can read the outputMeterLevel property to monitor sound level of remote participants. If NO, the value of the outputMeterLevel property is undefined. Default is NO. When your application doesn’t need to monitor remote participants, it should set this property to NO to improve performance.
- (Float) outputMeterLevel (readonly)
The volume, in decibels (db), being received from all other participants. (read-only) The value of this property is undefined if outputMeteringEnabled is set to NO.The volume level is the aggregate volume of all remote participants, modified by the remoteParticipantVolume property.
- (Float) remoteParticipantVolume
A float that scales the volume of all remote participants. The value should be between 0.0 (muted) and 1.0 (full volume). The default is 1.0.
Class Method Details
+ (GKVoiceChatService) defaultVoiceChatService
Retrieves the singleton chat service.
+ (Boolean) isVoIPAllowed
Returns whether voice chat is allowed to be used on the device. Some countries or phone carriers may restrict the availability of voice over IP services. Before retrieving the shared voice chat service object, your application should check to see whether voice chat is available.
Instance Method Details
- (Boolean) acceptCallID(callID, error:error)
Accepts a request from a remote user to establish a voice chat. When a remote user requests a voice chat, the voice chat service calls the client’s voiceChatService:didReceiveInvitationFromParticipantID:callID: method. The client calls this method to accept the request or denyCallID: to reject it.
- (Object) denyCallID(callID)
Rejects a request to establish a voice chat. When a remote user requests a voice chat, the voice chat service calls the client’s voiceChatService:didReceiveInvitationFromParticipantID:callID: method. The client calls this method to reject the request or acceptCallID:error: to accept it.
- (Object) receivedData(arbitraryData, fromParticipantID:participantID)
Called by the client to deliver new data received from a remote participant. The voice chat service uses a network connection provided by the client to exchange information between the participants. When the client receives information intended for the voice chat service, it should call this method to transfer it.
- (Object) receivedRealTimeData(audio, fromParticipantID:participantID)
Called by the client to deliver voice data received from a remote participant.. The voice chat service uses a network connection provided by the client to exchange information between the participants. When the client receives information intended for the voice chat service, it should call this method to transfer it.
- (Boolean) startVoiceChatWithParticipantID(participantID, error:error)
Sends a request to another participant to join the voice chat. The voice chat service calls the client’s voiceChatService:sendData:toParticipantID: method to send the connection request to the remote participant.
- (Object) stopVoiceChatWithParticipantID(participantID)
Ends a previously established voice chat. When this method is called, the client’s voiceChatService:didStopWithParticipantID:error: method is called.