Announcement

Collapse
No announcement yet.

Blueprint audio library

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

    Blueprint audio library

    Hi everyone!

    We are a small team of people that are relatively new to creating games, and we happen to be starting a new project these days. With UE4 coming out we're really psyched about moving away from Unity, as the toolset in UE4 looks absolutely kickass, and the visual scripting style would suit our team a lot better allowing everyone within the team to take on more responsibilities than before -- but we have a problem...

    We rely heavily on music and being able to analyze audio for our projects' concept to work(think Audiosurf, Beat Hazard and the like.) We already have a rudimentary system up and running in Unity that was incredibly simple to accomplish with Audio.GetSpectrumData(), but we can't find anything similar in UE4.

    Does anybody have an idea how we could go about this in UE4 - preferrably through Blueprint if possible as we're all new to C++. We're only doing basic beat detection, working with means and modes of frequency ranges and such. Any help would be appreciated as we're really psyched about moving over to UE4(or UE$ if I don't let go of the shift button )

    Also, is there a way to natively load audio files from disk in mp3/ogg/etc... and/or from the web?

    Thank you for your help.

    Answerhub entry here
    Last edited by nLock; 03-22-2014, 07:39 AM. Reason: Added answerhub link and external links to referenced games

    #2
    Hi there-
    Sounds like you're working on something exciting in the audio game genre- can't wait to hear about it . UE4 currently does not have a function like Audio.GetSpectrumData, but we are working on a similar feature for the engine. Alas, I don't know if and when it will be ready for release, so it will likely not be a help you on your current project.

    The engine also currently only supports PCM .wav file import, 16 bit up to 48khz. When these .wav files are imported into the engine, they are converted to different platform-based formats. For the PC, the .wav files are converted to Ogg Vorbis format; you can then set an Ogg encoding quality on each asset.

    Hope these answers at least clarify the current audio pipeline; we are constantly working to improve it. I'll mention the Audio.GetSpectrumData request, and see if I can't get that prioritized .

    Best-
    Zak
    Zak Belica
    Audio Director, Epic Games

    Comment


      #3
      Any updates on this? I too come from Unity and heavily use the built in FFT Spectrum audio data.

      Comment


        #4
        Check out the SoundVisualizations plugin. It exposes methods like CalculateFrequencySpectrum and GetAmplitude.

        Cheers,
        Michael Noland

        Comment


          #5
          Originally posted by Michael Noland View Post
          Check out the SoundVisualizations plugin. It exposes methods like CalculateFrequencySpectrum and GetAmplitude.

          Cheers,
          Michael Noland
          Wow. Thank you Mr Noland! That's what I was looking for. Keep on rock'n

          Comment


            #6
            Stupid Question. I have the audioVisualizations plugin installed now what? Where is the documentation? The plug-in sends me to Epic Games. ?

            Update:
            I did find Amplitude function while messing around in Blueprints and one other function. Does any want to add real world examples of audio visualizations using this function?
            Last edited by koluskomtu; 04-09-2014, 03:26 PM.

            Comment


              #7
              I was playing around with this yesterday and had some great results I'll see if I can get a quick tutorial together soon, but I roughly did the following:
              * Setup a blueprint that plays a sound on startup.
              * Setup a Tick event that calls Sound Visualization CalculateFrequencySpectrum
              * Use the resulting frequency array to scale bars in the scene.

              It was surprisingly easy to setup, took me an hour or two to get everything setup including a dynamic construction script for bars etc.
              Programmer at Klang Games | Ex-CCP (EVE Valkyrie / Sparc) | @SiggiGG
              Check out my procedural mesh examples

              Comment


                #8
                It's cool, but I'm still trying to figure out things like:

                1. how to use audio from the microphone as an audio source.
                2. how to change the sample size to get better separation between the frequency bands.
                3. how to apply a FFT Window to the sample data to reduce leakage (Hamming, Hanning, Blackman, etc)
                4. some way to limit the frequency range (anything from 16k-40k is a bit useless in most cases)

                But its a great start. Can't stop messing it.

                Comment


                  #9
                  Glad you found it useful! It is just an experimental feature. I found that using Tick was not accurate enough and I had to use 'GetAccurateRealTime' when I started playback, and then again each frame and subtract the two, to get an accurate sound position.
                  Lead Programmer - UE4 Animation/Physics/Audio Team - Epic Games
                  Twitter: @EpicJamesG

                  Comment


                    #10
                    Originally posted by SiggiG View Post
                    I was playing around with this yesterday and had some great results I'll see if I can get a quick tutorial together soon, but I roughly did the following:
                    * Setup a blueprint that plays a sound on startup.
                    * Setup a Tick event that calls Sound Visualization CalculateFrequencySpectrum
                    * Use the resulting frequency array to scale bars in the scene.

                    It was surprisingly easy to setup, took me an hour or two to get everything setup including a dynamic construction script for bars etc.
                    What are you using to keep track of the position/start time for CalculateFrequencySpectrum? do you have to use a timeline for this?

                    Comment


                      #11
                      Using the tick event I setup a simple graph that added the delta time to a variable, and once it was above 0 I started the sound and then the getspectrum calls.
                      I did notice some issues with timing though, and based on the helpful reply from JamesG above I'll try his approach

                      You can also control the sample length when calculating, and for some visuals (bars going up and down) I found it helpful to smooth out the peaks by going for a slightly longer time than the tick.
                      Programmer at Klang Games | Ex-CCP (EVE Valkyrie / Sparc) | @SiggiGG
                      Check out my procedural mesh examples

                      Comment


                        #12
                        I'm not going to complain if someone wants to post a video of some cool stuff they have done
                        Lead Programmer - UE4 Animation/Physics/Audio Team - Epic Games
                        Twitter: @EpicJamesG

                        Comment


                          #13
                          Originally posted by JamesG View Post
                          I'm not going to complain if someone wants to post a video of some cool stuff they have done
                          I'll post something once I'm further along
                          Programmer at Klang Games | Ex-CCP (EVE Valkyrie / Sparc) | @SiggiGG
                          Check out my procedural mesh examples

                          Comment


                            #14
                            I have been trying to set this up. The calculate frequency spectrum node... i most be doing something wrong because when i link a tick event to this node, the simulation goes super slow.
                            @SiggiG Could you please show a simple graph of how this is set up? maybe at screengrab? I am still trying to figure out the blueprints work

                            Comment


                              #15
                              Originally posted by JamesG View Post
                              Glad you found it useful! It is just an experimental feature. I found that using Tick was not accurate enough and I had to use 'GetAccurateRealTime' when I started playback, and then again each frame and subtract the two, to get an accurate sound position.
                              thanks for the nodes i was playing around with them and got some nice results but ist not insync. could you please explain or show how you got it right with the 'GetAccurateRealTime' because i dont get it. do i have to use the tick at all for the spectrumnode or do i have to make a custom event with the math you wrote above? please help

                              Comment

                              Working...
                              X