jonlab / NewAtlantis

http://www.newatlantis.world/
9 stars 6 forks source link

Trunk recorder - audio synchronization between clients #17

Closed jonlab closed 8 years ago

jonlab commented 8 years ago

We need to be able to synchronize audio recordings between clients. This feature is needed by the Audio trunk recorder : someone records a sound, and we want all the connected clients to be able to hear the sound, synchonized. Other uses would be with non-deterministic audio synthesis.

jonlab commented 8 years ago

possible implementation : as soon as a synchronized audio clip change, send it to the database with a hash (TBD - concatenation of name + NetworkView id) for the other synchronized audio clips to be able to download the same data. to be defined more precisely.

jonlab commented 8 years ago

I am doing some tests with AudioClip buffer synchronization with a network RPC and it kind-of works. But of course this is float PCM so quite bandwidth heavy (10s of mono audio at 44k takes 1.7 MB). The idea is to synchronize the trunk at the end of a recording so that everyone has the same audio buffer. Possible improvements would be to compress the data on-the-fly - ADPCM could be a good choice (good tradeoff of complexity VS license VS compressed size).

jonlab commented 8 years ago

Question : once someone has created a Trunk, does everyone has the right to record audio and possibly replace what was recorded before ?

jonlab commented 8 years ago

I commited a first implementation of ADPCM encoding / decoding with the Audio recorder (Trunk).