3

Can any one tell me how can i implement voice chat in iphone sdk . Game is used for voice chat over bluetooth .. i want my app to have voice chat option over the internet

Thanks Yasir

Yasir
  • 31
  • 2

2 Answers2

2

Apple's GameKit framework provides evertyhing you need to implement in-game chat.

The full documentation is here:

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/AddingVoiceChattoaMatch/AddingVoiceChattoaMatch.html#//apple_ref/doc/uid/TP40008304-CH11-SW11

Assuming you have allready connected the App to one or more other players using GameKit, you can start the voice chat like so:

-(void) startInGameChat {
//Set up audio session
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:myErr];
[audioSession setActive: YES error: myErr];

GKMatch* match;
GKVoiceChat *teamChannel = [[match voiceChatWithName:@"redTeam"] retain];
GKVoiceChat *allChannel = [[match voiceChatWithName:@"allPlayers"] retain];

//Start the chat
[teamChannel start];

//Enable Mic
teamChannel.active = YES;

}
Brad The App Guy
  • 16,255
  • 2
  • 41
  • 60
0

One best way to do it using XMPP Framework. Using XMPP you can send files & text to other persons. Using it you can record voice message & send it across. I did lot of R & D n that to implement the jabber sever on ios with XMPP protocal.

for more info just move to link: to implement jabber with XMPP protocal.

http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-server-setup/

You can also see this link for simple chating in ios : http://www.ibm.com/developerworks/library/x-ioschat/