Realtime audio streaming

ahsan_cheema
edited August 2014 in Photon Server
how can i stream real time voice with photon??? i have to stream same human voice to all game players??

Comments

  • Hi ahsan_cheema.

    First you will need some 3rd party lib that can record the voice data of a player and that can split this data up into small packets (preferably 1kb or smaller each so that Photon doesn't have too split them up internally (which would mean that it would send them reliably even if they have been specified as unreliable)). Then just pass each packet as a byte array to an opRaiseEvent() call and make sure that you are calling sendOutgoingCommands() and dispatchIncomingCommands() often enough so that your queues are not filling up. Test a bit with the bitrate to assure that you don't send more data around than your weakest clients are able to handle.
    It may be a good idea to send voice data on a different channel than game logic data.
    You should use udp (if possible) and send the data unreliable as this normally gives better results than reliable for voice data.
  • Hello, I know this post is 1 year old, but ahsan_cheema, any result with your voice feature? I would like to implement the same.

    Thanks
    Don T.
  • And is this can be done by using only Photon Cloud? Or it would require our own server?
  • You can send byte[] in any case. Photon Cloud and Server both offer this feature, so you can implement this, if your voice messages are not too big to be sent in realtime.
  • Hello Toblas.

    Ok thanks for the clarification. Nevertheless, I'm curious if some developers already implemented this with Photon and also having good user experience/result, in theory it seems feasible, but in practice, I'm wondering. The bottle neck are clearly the 500 msg/s (per room, but that can be customized at the end with you guys if this is the only bottleneck), and performance.

    But I will try it for sure
    . I already bought PUN+ and moving porting my Badumna integration to Photon (I finally lost the faith with Badumna).

    Don T.