Announcement

Collapse
No announcement yet.

[PLUGIN] Play Sound Files From Disk (OGG)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [PLUGIN] Play Sound Files From Disk (OGG)

    These nodes are all in Rama's BP library now, check it out! https://forums.unrealengine.com/show...l=1#post118564


    --------------------


    Hey everyone!

    I was listening to an audiobook yesterday and thought it would be cool to build an immersive environment (campire w/ old man storyteller) for listening to audiobooks in VR. Seemed like a nice little side project to promote my game and get something finished and released early on. I looked around but didn't find any way to play a sound file from disk, which of course would be the ideal way do a VR audiobook player. I did find this helpful code from @keru in his forays into making a music player, and using that I was able to whip up a couple of blueprint nodes.


    Play Sound From Disk Blueprint Lib

    Github Repo
    Zip File Download


    This plugin provides two blueprint nodes, Play Sound At Location From File, and Play Sound Attached From File. They are identical to Play Sound At Location and Play Sound Attached except that they take a file path rather than a sound asset.


    Thanks to @keru for the sound loading code, and @Rama for the blueprint library plugin example code.

    Future Work
    * Currently this doesn't have the other nodes, like those for playing Dialogue. It should be very easy to implement those, feel free to submit a pull request!



    Edit: Links added.

    Edit: There was no bug (there is no spoon, Neo). User error. The time is in seconds. For some odd reason I figured it would be 0-1. Derp. Plugin works!
    Last edited by n00854180t; 08-15-2014, 05:17 AM.
    Storyteller - An immersive VR audiobook player

    Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

    #2
    Posting here too to bump for publicity. Thank you!
    FREE Lightshow
    FREE VR Drum Kit Project

    FREE Color LUT Collection
    FREE Physics Driven Spacecraft Project
    FREE GTA Style Vehicle Interaction
    Dynamic DoF(Depth of Field)
    Camera Crossfade

    Comment


      #3
      This is a really awesome. I can think of hundreds of ways to utilize this. Thanks!
      Current Project - *shush shush* Ehh.. When its ready?

      Comment


        #4
        Thanks guys for the kind words Glad you like it.

        BTW I had added another BP node after I made the initial post - it just returns the SoundWave object instead of playing it directly.

        I looked into setting up the Dialogue nodes as well, but it seems like they don't load a sound directly anyway, so the node for loading to a SoundWave should be sufficient to use the Dialogue BP nodes already.

        I'll be looking into adding MP3 decoding support to the plugin sometime soon.

        Massive thanks go to @keru for his original snippet for loading Ogg files into a SoundWave, and to @Rama for his BP library plugin, which I used as an example to set this one up.
        Storyteller - An immersive VR audiobook player

        Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

        Comment


          #5
          MP3 support would make it perfect. Good luck and keep us posted!
          FREE Lightshow
          FREE VR Drum Kit Project

          FREE Color LUT Collection
          FREE Physics Driven Spacecraft Project
          FREE GTA Style Vehicle Interaction
          Dynamic DoF(Depth of Field)
          Camera Crossfade

          Comment


            #6
            Originally posted by Jacky View Post
            MP3 support would make it perfect. Good luck and keep us posted!
            It's a tricky situation due to the patent issues with MP3 - there are few libs with compatible licensing (LAME, for instance, is LGPL for encoding, but GPL for decoding - d'oh). Can't wait until it expires - I guess it's 2017 in the US and a bit sooner elsewhere.

            I *think* it should be appropriate to use a LGPL DLL linked against a UE4 plugin, but I'm no lawyer or LGPL specialist. I think it works because the plugin code is open, though. Not sure.

            In any case, I'll try to provide MP3 support through an LGPL library and leave it at that (I'm not super concerned about having the MP3 people come after me, honestly...worst case I have to take the plugin down).
            Last edited by n00854180t; 08-14-2014, 06:42 PM.
            Storyteller - An immersive VR audiobook player

            Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

            Comment


              #7
              Awesome n00854180t. This is exactly what I needed to build a prototype for a Mood Jukebox. I eventually want to wire up a online music service like Spotify.
              HeadlessStudios.com is now part of TheGameDevStore.com

              Comment


                #8
                Originally posted by TechLord View Post
                Awesome n00854180t. This is exactly what I needed to build a prototype for a Mood Jukebox. I eventually want to wire up a online music service like Spotify.
                Cool idea!

                BTW if you use Rama's BP library, both this plugin and the load (dds) texture from disk plugins are integrated there now.
                Storyteller - An immersive VR audiobook player

                Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

                Comment

                Working...
                X