1 Reply Latest reply on Aug 23, 2011 12:03 PM by Michael Thornburgh

    Object replication for Sound objects

    Dries.C

      We have an application to play music on demand. We currently use the Sound object to load the sounds from the server into the different clients. We only load sounds when they are needed for playback, so not all clients have all sounds.

       

      We would like to add object replication to our application so that not all clients have to load the sound objects from our server.

       

      Is it possible to cache those sound objects in our application and share them into a group? We were thinking to extract a byte array from the sound object, make smaller pieces of the byte array and do object replication on those smaller chunks, but we can't extract a byte array from a Sound object.

       

      So our question is: Is it currently possible to support something like swarming files for sound objects?

        • 1. Re: Object replication for Sound objects
          Michael Thornburgh Adobe Employee

          the "extract" method of a Sound object extracts the raw, uncompressed audio samples from the object.  while you *could* share those with Object Replication, you really really don't want to, since that'll be a potentially huge amount of data.

           

          Sound only appears (from reading the API) to let you play a URL.  there's no URL scheme for a local ByteArray (although that would be cool).

           

          you *could* use Object Replication to distribute, for example, compressed sounds in MP3, AAC, or NellyMoser, perhaps formatted as FLVs, and use NetStream.appendBytes() to play the sounds instead of Sound objects.

           

          note that for Object Replication to work effectively in a group, every member of the group has to want everything being replicated and eventually end up with everything.  only when a node has a piece of data can it replicate it to its neighbors.