Announcement

Collapse
No announcement yet.

Audio Cue with wind-up, looping, and release sections?

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

    Audio Cue with wind-up, looping, and release sections?

    I have a wave file. It has a wind-up part, a looping part, and a release part.
    I'd like to start playing this from the beginning, and loop only the looping part, and then when I get to "stop," keep playing the file until it reaches the end (the release part.)
    This is much like how a sample player music instrument treats samples.

    I can't find a good way to do this in the UE audio editor. All the "looping" bits just loop the entire sample, and it doesn't seem to import the markers at all (I make them in Adobe Audition.)

    How can I achieve this effect?

    #2
    Is audio, once again, getting short shrift?
    Is there no way of doing this?

    Comment


      #3
      We've discussed the idea of making SoundCues have a behavior like you're describing, but it is a fairly involved change at that level and we believe there is a good alternative using blueprints. You do have to structure it as 3 different cues (or waves as they are interchangeable for the most part) but by setting up a blueprint you can control the exact behavior you want including cross-fading between the loop and release.

      Comment


        #4
        Thanks for the answer. However, I have not been able to get sample-accurate splicing in a blueprint. How would I go about doing that?

        Comment


          #5
          You can splice the audio by downloading "Audacity" or another similar program, then open the sound file, and you can choose where and what to split into 3 smaller tracks, then re-import those tracks into UE4. That's probably the simplest way...

          You can get Audacity for free (its open source) from sourceforge here: http://audacity.sourceforge.net/
          Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

          Comment


            #6
            DotCam, thanks for the advice. It doesn't solve my problem as described in the first post at all, but someone else may benefit.

            Comment


              #7
              Sample-accurate splicing is not something that I think you can hope to get in this system. Because what we are doing when we start and stop sounds is communicating with the hardware sound thread there is always going to be latency of one sort or another be it at the sound thread level or the game thread due to a frame rate that is not perfectly timed to meet the sample desires.

              As I've discussed a bit elsewhere (https://forums.unrealengine.com/show...ll=1#post78471) anything that could come close to sample accurate splicing (and even then the tools needed to specify the start/stop times at that level of precision would be more than I can imagine us building in editor in the foreseeable future) requires a software mixer among other things.

              Comment


                #8
                Perhaps you could use an external dsp library for this?

                Comment


                  #9
                  Thanks, Marc!

                  On PC, hardware sound threads are largely a thing of the past, so I assume that you mean the various console targets.

                  If you support streaming audio sources, then sample-accurate splicing is a simple thing to build, at the cost of a memcpy() of the data. Given the low data rate of audio compared to RAM these days, and the almost perfect streaming/pre-fetching properties of sound data, you could do a hundred of them and it wouldn't show up on a profile.

                  So, the way I'd imagine this to work would be a new kind of wave source that takes a wave with loop point markers, and has a runtime-settable "looping" flag per instance. Whenever "looping" is set true, the source keeps generating the looped data between the markers. When "looping" is set false, it plays out to the end rater than looping back once it hits the loop point. This would hopefully be simple to implement as a variant of a streaming wave source, although it wouldn't need to "stream" from disk.

                  Comment

                  Working...
                  X