Results 1 to 21 of 21

Thread: AssetBundles as Audio players

  1. #1

    AssetBundles as Audio players

    Just thought I'd post this one up as an example of the versatility of the New AssetBundles

    If you ever wanted to add your own playlist to one of your games Its now very easy to stock an object with a selection of background ambience and Music tracks and then switch between them during your gaming session. In fact It took me longer to find 4 royalty free tracks to add to the radio than it did to make the Assetbundle .






    Now there is certainly more room for improvement as currently the volume is controlled by the overall sound level setting.
    and there is no way to set off an AssetBundles Loops and Triggers with scripted commands....

    But I suspect we'll see a lot more functionality added to how we can interact with AssetBundles as time progress.


  2. #2
    Join Date
    Feb 2015
    Location
    The Internet
    Posts
    1,238
    Awesome

  3. #3
    If a player joins a server with the song already playing, does it play from the beginning? Does it play from the same point as everyone else hears it? Or does it not play at all?

    Looking forward to trying this when there's more scripting capabilities.

  4. #4
    If a player joins a server with the song already playing, does it play from the beginning? Does it play from the same point as everyone else hears it? Or does it not play at all?
    Good Question...Short answer...No idea

    But thinking about it as the information is effectively imbedded in an object rather than called from some external 3rd party source. if you enter a room mid way through a track I'd assume you'd start hearing it from that point rather than the beginning. Really in this format they're nothing more than super extended versions of the pick up and put down noises you here when you interact with objects on the table.

    To test it out I'll put together another one (Humorously I didn't bother to save the last one ) and offer it up for people to try in a multiplayer environment.

    Nothing beats a good bit of empirical testing

  5. #5
    Join Date
    Jan 2014
    Posts
    805
    If the sound was activated with a trigger effect then when a player joins they will hear nothing because that is a fire and forget effect. Looping effects will play for them but it will start from the beginning of the loop (I sync what looping mode the object is on, not at what time). You would have to fire the loop / trigger effect to get everyone synced for a late joining player.

  6. #6
    Join Date
    Sep 2016
    Posts
    166
    I think this would be great for ambient sounds, like birds chirping. Can't wait to see what people come up with!

  7. #7
    I wonder if scripting + asset bundles could create a soundboard with buttons to press that then make certain sounds?

  8. #8
    I'd say if/when scripting gains access to Assetbundle triggers then that is entirely likely to happen

  9. #9
    Join Date
    Mar 2016
    Posts
    181
    Quote Originally Posted by Baryonyx View Post
    I wonder if scripting + asset bundles could create a soundboard with buttons to press that then make certain sounds?
    I made this. When scripting allows triggering, I'll add a dashboard to control it. But for now you can use the right click menus to trigger or loop the sounds.

    http://steamcommunity.com/sharedfile.../?id=772687187

  10. #10
    If you have multiple such radios that all use the same model, how would you put the model in a Secondary AssetBundle and use that...?! Is that what your Looping Effect 0 is...?

  11. #11
    So here I am now trying my hand at making an own sound asset bundle. However, the Unity editor screen I get looks very different from the one presented in the knowledge base article. (yes I downloaded the exact same version mentioned there) Which makes its complexity feel even more overwhelming.
    Is there an easy to follow tutorial that could help me create my own sound bundles?

  12. #12
    Most of that difference's your seeing are cosmetic and down to the fact The Dev's are using the Pro rather than free edition. Baryonyx
    and any difference that's not cosmetic won't impact on any of the stuff were doing with assetbundles.


    I don't know if there are any tutorials out yet specifically made for this. But I can put you an asset Package together with it all laid out ready If you'd like.
    Send it so it has an assetbundle ready to export in a project scene with some sample sounds set so you can see how its put together...

    just let me know if its something your interested in

  13. #13
    Oh I would be very grateful if you would do that!

  14. #14
    Right.... start a new Unity project and import the package in the link through the assets tab in the top bar. its got everything you need including the example TTS Package from github.

    In the "Sound cube" folder I've created in the project panel I've put a prefab of a simple cube with a default material to hold the sounds. right click on it to bring up its contents in the Inspector panel and expand the "TTS Asset Bundle Effects (Script)" this is where your sounds will go.

    https://www.dropbox.com/s/h6ec04oobb...AMPLE.zip?dl=0


    Expand out the headers for each of the four sample elements and examine how the sounds are placed inside. You can swap the sounds out with any that are stored in your asset folder and you can increase the number of elements by raising the number in the "Size" slot at the top.

    When its ready to go right click on the prefab. name the Assetbundle if it isn't named already and then select "Build Assetbundles" and that's pretty much it.

    I've also added a working Assetbundle of the Prefab in the project so you can drop it in TTS to see how it works on the table.

    just ask if you need anything your seeing explained.

  15. #15
    Many thanks, instructions are clear and to the point.

    Just one problem: When I change the sounds in your sound cube 1 prefab and rename that, then try to build asset bundle again, all it does is rebuild the original one you made and not the one I changed it into. What's wrong?

  16. #16
    O.k do this... Drag the cube prefab into the Hierarchy panel to create an instance of it in the scene...rename it...right click it to bring up its details in the inspector panel if they're not already visible...make your alterations to the sounds then drag it back into the prefab folder to create a new prefab of this new version.....then select this new prefab and give it a new assetbundle name in the bottom right window where it currently says "None" now right click it again and hit Build Assetbundles.

    This way you've still got the original and you wont have to keep overwriting the same object and there will be no issue of building the wrong bundle by accident.

    Also just to be clear when you create an assetbundle it is not automatically placed in the TTS Assetbundle folder in the mod section with the image and model folders but resides in the Unity Assetbundle folder for the project you created it in. You have to transfer it over...Which thinking about it might be what's happened here .

    So open your Unity folder find this projects name ..open it and then open its Assetbundle folder to find your file
    Last edited by Lucky seven; 10-12-2016 at 12:46 PM.

  17. #17
    Now it works perfectly fine. Thanks a ton. This really saved me a lot of work figuring all of this out by myself.

    EDIT: I was looking for it in the right location, but it really just rebuilt the old one. But pulling it into hierarchy and back to prefabs and giving it an own assetbundle name fixed it.

  18. #18
    That's great.. you'll have to post up a link if you upload any of these to the workshop.....unless you've a terrible taste in music.. in which case keep them to yourself .

  19. #19
    Lucky Seven, if you have a moment I could use some help: I've followed all your steps above, but when I try to add the object into game I get an error saying....
    "Object Reference not set to an instance of an Object"

    Can't seem to wrap my head around getting it fixed.

  20. #20
    Hey, update: I was able to figure it out. Turns out I forgot to check the Mac and Linux thing in the Unity installer. Works now, many thanks!

  21. #21
    Gad you Fixed it Obidammos Sorry I missed your first post. . . time zones were against you I'm afraid

    If you have any more questions about this or any thing else to do with Assetbundles in General. Don't hesitate to ask .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •