udark / underdark-cocoa

Bluetooth peer-to-peer mesh networking for iOS
http://underdark.io
Other
123 stars 24 forks source link

Is it possible to send a stream? #7

Open mikkeldamm opened 7 years ago

mikkeldamm commented 7 years ago

Hi, Thanks for the cool framework! Makes it so much easier to connect devices :) ..

I was wondering if it is possible to send a stream between the connected devices? So like, one device is sending its audio (microphone) and the other devices are receiving and listening.

If its possible, then I think I need to use the sendFrameWithSource but i'm not quite sure how to use it.

Thanks 😉

virl commented 7 years ago

@mikkeldamm Hello! sendFrameWithSource is experimental API, but it does the same thing as sendFrame. The latter already sends frames sequentially.

But only TCP-like sending is supported, so all frames are guaranteed to be received (except due to disconnect), but real-time audio often requires UDP.

mikkeldamm commented 7 years ago

@virl So what you are saying is that its not possible as of right now?

virl commented 7 years ago

@mikkeldamm It depends on what you need in your audio transfer task.

mikkeldamm commented 7 years ago

I'm trying to stream live voice audio from one device to multiple other devices. E.g. one person talks via the microphone and that audio stream is sent to other phones that listens to that stream live.

So you can say its kinda like an voice group call to multiple phones.

virl commented 7 years ago

@mikkeldamm Great idea!

Bluetooth on iOS have roughly 200 KBytes/sec throughput, but I don't know is it per device or shared among connected devices (probably the latest).

The problem with TCP streaming (as opposed to UDP) is that if there is some temporary connection hiccup (due to nearby working microwave, for example), the most recent audio will not be sent until earlier audio data is received.