Announcement

Collapse
No announcement yet.

Audio Component Get Playback Percentage broken.

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

    Audio Component Get Playback Percentage broken.

    Hi,
    in my projects the "On Audio Playback Percent" Event from an audio component constantly returns 0.00. It only worked correctly when setting up a new project and only as long as you don´t restart the editor. After restarting I´m back with the same issue. Tried different audio tracks and everything, verified my engine etc. Already issued a bug report "Case # 00078927".
    Couldn't find anything on this issue. Hopefully it's just me, currently reinstalling the engine.
    It has the correct audio output and the event fires, just has the incorrect output.

    Edit: Tried it in: 4.19 & 4.21 with fresh projects, problem persisting.

    Hopefully someone has an idea.

    Best regards and thanks in advance.
    Last edited by Max Mittelstädt; 11-14-2018, 04:07 PM. Reason: Version number

    #2
    Same problem here on 4.19.
    I can only add... if you double click your "sound wave" asset in "Content Browser" and after this: "Asset - Reimport", the problem is fixed... but after engine restart, again the problem persists.

    By the way, can you share the link for your bug report? I don't know where to write this: Case # 00078927

    Thanks

    Comment


      #3
      Hmm... very strange. Now I try: double click your "sound wave" asset in "Content Browser" and after this: "File Path" - Click Cross button to clear the source path. Click "Save" button. And now after engine restart the problem is fixed and "On Audio Playback Percent" event works fine. I don't know what and why happening... can anyone test it too?

      Comment


        #4
        Hi mate,
        "glad" to hear I´m not the only one with that problem ^^.
        Tried your suggestion on fixing it, although it doesn´t work for me.
        What worked though, was just reimporting the sound wave, sadly only till the next restart, and it also doesn't work in builds.
        So for a workaround in editor reimporting the asset everytime you open the editor does the trick.
        But a pretty **** annoying and project breaking bug. Hopefully someone has a permanent solution
        or Epic fixes this soon.

        Thanks again for the suggestion!

        Comment


          #5
          Any update on this? I too am getting the 0 playback percentage bug, though only intermittently.

          Comment


            #6
            TL;DR: Enable audio streaming for your sound file.

            Hopefully this helps, but I have fixed this issue in both builds, and standalone game.

            Was having the exact same issue with all .WAV assets. Moving location and reimporting only worked until editor restart. Builds always failed.

            Right-click on your audio file in the content browser and select "edit".

            Under the heading "Streaming" enable streaming.

            Save and try a build.


            Seems to work fine now for some reason, even after subsequent engine restarts. No adjustment to any events are necessary as they don't seem to effect this bug.

            You can also adjust maximum concurrent audio streams in the project settings, otherwise they will be sorted by priority set in the asset editor.

            Comment


              #7
              Just migrated my project from 4.19.2 (wasn't having this issue) to 4.21.1 and now playback percentage comes back as 0.0
              Attached Files

              Comment


                #8
                Yeah this is up. I have same bug.Yesterday it was working fine now it isn't. I moved my old .waw files from my harddrive. Maybe AudioComponent tries to preload from disk each time and because I moved source files, UE can't find them and creates bugs. I don't know. After I drag&drop source files to UE4's content browser (Same thing as ReImport via rightclick on ContentBrowser audio file), problem solved.

                Comment


                  #9
                  I fixed by exporting and re-importing the wav.... Just so you know its a bug. But there is a work around.

                  Comment


                    #10
                    4.21, same thing. Beware that enabling streaming fixes this issue. However, you can no longer use the StartTime parameter for any audio component playing that sound cue. The solution for me was to disable streaming and re-importing the audio asset.

                    Comment


                      #11
                      Can anyone report this bug here?

                      https://issues.unrealengine.com
                      https://epicsupport.force.com/unrealengine/s/
                      https://www.unrealengine.com/en-US/support/report-a-bug

                      And after that we all can using "Vote" button in the topic.

                      Comment


                        #12
                        On 4.22, envelope still delivering 0.0, tried reimporting, deleting, re-adding.. Always stays at 0.0.

                        Comment


                          #13
                          Someone opened a Bug report: https://issues.unrealengine.com/issue/UE-69726 UE-69726 vote on it so it gets a higher priority.

                          A workaround I use at the moment is creating a timeline float track with the length of the music and a value going from 0 - 1.
                          Not the most convenient workaround and not applicable in all situations, but may be useful to someone.
                          Hope Epic fixes this soon, very annoying bug.

                          Comment


                            #14
                            Originally posted by Max Mittelstädt View Post
                            Someone opened a Bug report: https://issues.unrealengine.com/issue/UE-69726 UE-69726 vote on it so it gets a higher priority.

                            A workaround I use at the moment is creating a timeline float track with the length of the music and a value going from 0 - 1.
                            Not the most convenient workaround and not applicable in all situations, but may be useful to someone.
                            Hope Epic fixes this soon, very annoying bug.
                            Thank you so much for this information!
                            Interesting workaround for this problem, I'll keep that in mind

                            I'll tell to all my friends to vote for this bug.

                            Comment


                              #15
                              Yeah, the bug is still present on 4.22.

                              I found another workaround but I'm not sure whether it offers the same preciseness as the delegate. Also, it does not provide length information. Anyway, here it is:

                              FAudioDevice* AudioDevice = AudioComponent->GetAudioDevice();
                              if (AudioDevice)
                              {
                              FActiveSound* ActiveSound = AudioDevice->FindActiveSound(AudioComponent->GetAudioComponentID());
                              if (ActiveSound)
                              {
                              float pos = ActiveSound->PlaybackTime;
                              }
                              }

                              Comment

                              Working...
                              X