Peer to Peer Voice chat between via bluetooth or in a local WiFi network in iOS

别来无恙 提交于 2019-12-11 08:05:33

问题


I want to implement the voice chat between two iOS devices without using WiFi or cellular network within the range of Bluetooth.

I have done the text chat within Bluetooth range using multipeer connectivity framework, But I also want to do voice chat like text chat within the Bluetooth range.

I found that we can implement the voice chat using GameKit but I have not found any reference of tutorial yet, How to Implement voice chat.

UPDATE: I found that the GameKit VoiceChatService has been deprecated after iOS 7.0. is There another way to call another iOS device on the same network.

I found that this app https://itunes.apple.com/us/app/ip2pvoicechat-bluetooth-wifi/id908638157?mt=8 work calls the user on the same wifi network.

Thanks in advance.


回答1:


If you already have a Bluetooth connection, you should just start sending chunks of audio data.

I made a library years ago that can read / play audio stream. See eppz!capture for more. EPPZCapture and EPPZCaptureBufferParser in particular. They provide / consume CMSampleBufferRef together.

I don't support this code, but you can use it as some source of inspiration for your own streaming code.


However, there are countless libraries for that, like https://github.com/tumtumtum/StreamingKit, https://github.com/muhku/FreeStreamer, https://github.com/mattgallagher/AudioStreamer.


Furthermore, I think you can still use GKVoiceChat, classes are there. Docs above don't even show deprecation (while the compiler may show).



来源:https://stackoverflow.com/questions/44943520/peer-to-peer-voice-chat-between-via-bluetooth-or-in-a-local-wifi-network-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!