【问题标题】:voice chat over internet implementation iphone sdk通过互联网实现语音聊天 iphone sdk
【发布时间】:2010-12-16 22:04:23
【问题描述】:

谁能告诉我如何在 iphone sdk 中实现语音聊天。 游戏用于通过蓝牙进行语音聊天.. 我希望我的应用能够通过互联网进行语音聊天选项

谢谢 亚西尔

【问题讨论】:

    标签: iphone sdk chat voice


    【解决方案1】:

    Apple 的 GameKit 框架提供了实现游戏内聊天所需的一切。

    完整的文档在这里:

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

    假设您已经使用 GameKit 将应用程序连接到一个或多个其他玩家,您可以像这样开始语音聊天:

    -(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;
    
    }
    

    【讨论】:

      【解决方案2】:

      使用 XMPP 框架的最佳方法。使用 XMPP,您可以将文件和文本发送给其他人。使用它,您可以录制语音消息并将其发送出去。我做了很多研发工作,以使用 XMPP 协议在 ios 上实现 jabber 服务器。

      欲了解更多信息,请移至链接:使用 XMPP 协议实现 jabber。

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

      您还可以在 ios 中查看此链接以进行简单聊天: http://www.ibm.com/developerworks/library/x-ioschat/

      【讨论】:

        猜你喜欢
        • 2015-07-11
        • 2011-06-10
        • 1970-01-01
        • 1970-01-01
        • 2014-12-07
        • 2019-08-13
        • 2017-03-16
        • 2023-04-06
        • 2019-06-29
        相关资源
        最近更新 更多