Playing Audio with a start time on a mobile device

When trying to play ambient sound with a certain start time on a mobile device the audio will always play from the beginning regardless of the entered start time. I am using an iPad Air to test and a Mac to develop. The Audio works fine on the simulator but not on the actual device.

Howdy Zaeran24,

Thank you for reporting this issue. I am going to need a bit more information from you before I begin digging into what may be causing this error. What version of UE4 would you be using and would that build be a Binary or Source build? Would you be able to provide a couple steps that I may be able to use to reproduce this issue internally? What version is your iPad Air on?

Any additional information would be greatly appreciated.

Thanks and have a great day!

I’m running on UE 4.6.1. The iPad is on iOS 8.1.2. To recreate the issue I added an ambient sound actor into a fps blueprint template then set up a trigger to change the playtime on the actor.

Hey Zaeran24,

Thank you for sharing a screenshot of your setup. I have just tested this issue and may have found what the issue could be. IN your Play node, you have the Start Time set to 10. Is your Audio clip over 10 seconds long? I found if I have a short audio clip (2 Seconds) and set that number to any length longer then 2 i would receive no audio playback. This because that node is saying to start the audio 10 seconds in, not to play it 10 seconds after walking into the trigger box. I was using a Mac and an iPad Air 2 to test this issue.

Let me know if this helps with the issue.

Thanks!

Yes, the audio is longer, it all works fine in the simulator and on a packaged windows project but it doesn’t work on an iPad.

So i have just tested out the issue once again and have seen no errors occur once deployed to an iPad Air 2 (8.1). If you select your Ambient Actor in the level and then, in the details panel, check to see if Auto Activate is turned off.

I tried that but it’s still the same. Are you sure when you’re testing it it’s not just restarting from the beginning on the sound track? When i trigger the event it restarts the track from the beginning, not from the point I’m setting. It definitely works on the simulator and definitely doesn’t on the device.

Howdy Zaeran24,

Thank you again for all of the information that you have provided. I have been able to reproduce the issue. I have entered UE-7511 into our Bug Database so that the issue may be resolved in a future release of UE4. I will be sure to keep you updated as I see work being done to the issue.

Thanks again and have a great day!

Is there any update on this? I tested this in 4.9.1 on an Android Samsung Galaxy S6 and the problem is still occurring. It’s been 9 months. Surely someone must have looked into this by now.

Hi ,
Our team is experiencing the same problem.
We are testing on a Samsung Note 3 and Samsung Galaxy S6.

The problem doesn’t occur on the desktop when Auto Activate is On.
However, it does occur when Auto Activate is turned Off.

In either case, it doesn’t work on the mobile devices.

Hey BenRetan,

UE-7511 is currently set as a minor priority, which has been backlogged and isn’t resolved as of yet. Please feel free to check on this again in the future.

Thanks!

I am having the same issue. Is there a work around? Or another way to play a sound at a specific time?

Every time I try to play a sound from a sound actor at some time other than the beginning, it won’t start at that time, instead it always starts at the beginning.

It’s really frustrating when trying to deal with long audio file playback. I try to pause my background sound for my level and it doesn’t restart at the same time.

Any assistance on this matter would be greatly appreciated.

Hey JDSon,

UE-7511 has been set as a priority 4, which is minor. It’s currently assigned to a Developer but it’s backlogged. If you’d like to check on this bug in the future, please feel free to reply back here.

Regarding a workaround, at this time I do not know of a workaround at this time. I would suggest looking through our [Audio and Sound][1] documentation for additional ideas to try.

Thanks!

Working with Audio in Unreal Engine | Unreal Engine 5.1 Documentation

Hi ,
I have built a [test case project][1] which demonstrates the problem. Its attached.
Please note: You need an audio file to test this. It needs to replace the bad asset reference in the world blueprint. (Why is mp3 import not working?)

On the development machine, pressing the buttons should restart the audio at different start times. On android, it always starts at 0 seconds.

This is a major issue for us which we hope that you will be able to address quickly.

Sincerely

62421-sound_test.zip (366 KB)

Hi ,

Thank you for responding to this post. I have looked through the documentation and unfortunately, the only way to start an audio node at specific time seems to be through this implementation of the “Play” node.

This is obviously a bug and something that should be fixed.

It is surprising to me that this is a priority 4 when it is easy to reproduce, is blocking progress on projects, and there seems to be some community interest. Would it be possible to escalate the issue?

Again, this has been an oustanding issue for over 9 months.

Thanks!

Hey ,

While this bug may or may not be easy for the Developers to correct, more pressing issues are categorized before this bug for example, editor or package crashes would be placed as a high priority issue. I have updated this but to let them know that you all would like to see progress on this bug soon.

Thanks!

Hi ,
I have a [tentative fix][1] for the problem. I believe that the problem exists because FSLESSoundBuffer::Seek() doesn’t exist like it does in
FXAudio2SoundBuffer.

I copied and pasted the necessary code and updated where it’s called in AndroidAudioSource.cpp. but I can’t test it because of problems with running the github version of UE4Editor. If this diff helps get the problem fixed, please pass it on.

Thank you for your time,

63225-androidaudio_seek_diff.txt (3.38 KB)

Thank you ,

I have commented on the bug report to let them know of this additional information. :slight_smile:

Hi ,

I put in [a pull-request on github][1] with code changes to fix the issue. Hopefully, it’ll work properly on your end. I am pretty interested in getting this fixed.

https://github.com/EpicGames/UnrealEngine/pull/1747

Hi,
I just tried testing this functionality in 4.11 preview 1 and now setting the playback time doesn’t even work on the PC. I am not sure what broke.

Thank you,