Author Topic: Is it possible to send files over the network (e.g. 200KB MP3 file) ?  (Read 4445 times)

choinkees

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
    • Ricky's site
Hi, I'm interested in using TNet but first wanted to ask a question - is it possible to send files from one host to another?

I'm working on a language and quizzing app for kids and special needs students. The app has some level of user customisation, including options for a parent/teacher/therapist to record their own custom voice tracks to the content. I'd love to be able to offer some sort of "share your settings" option in this app so that a class with 15 tablet devices can customise just one tablet, and then share/copy their settings and custom voice files to the other 14 devices through local WiFi, rather than having to manually customise and rerecord for every single device. Another use is a speech therapist could use and customise the app at their centre, and then share their custom sets and voices with the parents of the kids for their home devices.

I can package the general settings into text strings to send over a local network, but I'm not sure how to approach the sharing of audio files. I imagine the audio files to be 25-250 KB each, and they'll live in the local Application.persistentDataPath for the device, so I guess some sort of general file sending and receiving function would probably quite nicely.

..any ideas on whether TNet can do this? Or any other approach?

Oh, and Merry Christmas!  :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Is it possible to send files over the network (e.g. 200KB MP3 file) ?
« Reply #1 on: December 29, 2013, 01:34:23 AM »
You can certainly send larger files via TNet. Although I'd recommend you to split them up into chunks rather than sending them as one huge file -- although this depends on the network you use. For Wifi, 250 kb is nothing.

choinkees

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
    • Ricky's site
Re: Is it possible to send files over the network (e.g. 200KB MP3 file) ?
« Reply #2 on: January 01, 2014, 05:58:58 AM »
Thanks for the quick reply, and happy new year! :) I'm just going for local wifi so hopefully 250kb is ok.

I've looked at some TNet examples and trying to guess how to change those position syncing examples to sending audio files instead. Is it as simple as a single line "tno.send" command and attaching a Unity audio clip as a parameter to send a single audio file from one machine to another? (or perhaps a byte array?)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Is it possible to send files over the network (e.g. 200KB MP3 file) ?
« Reply #3 on: January 01, 2014, 10:38:13 PM »
You have to send it via the byte array.

choinkees

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
    • Ricky's site
Re: Is it possible to send files over the network (e.g. 200KB MP3 file) ?
« Reply #4 on: January 02, 2014, 12:08:50 AM »
Thanks :) I bought TNet a minute ago and will experiment with sending audio on the weekend.