gtreshchev / RuntimeAudioImporter

Runtime Audio Importer plugin for Unreal Engine. Importing audio of various formats at runtime.
MIT License
336 stars 69 forks source link

Sound wave won't play if startTime is different than 0. #2

Closed lucastakejame closed 3 years ago

lucastakejame commented 3 years ago

After the sound wave is imported and setted on the audio component, if I execute a Play node with StartTime different from 0. , it will play no sound.

gtreshchev commented 3 years ago

Are you using the latest version of the plugin? The plugin used to have this problem, but it has already been fixed.

If not, are you using the same node or which node are you using? I've tested in different ways, both on Windows and Android and everything works as it should 286

lucastakejame commented 3 years ago

I'm using the plugin for ue4.25, Downloaded from release page on 13/01/2021 (previously I got from MarketPlace and couldn't get it to work at all). I'm using an audio component, in which I set sound with the imported .wav and play with these nodes:

image image

Just to be sure, I'll try to download again the zip for 4.25

EDIT: Forgot to mention, the audio files I'm using are ambisonics, but I just tested with a mono audio and got the same result...

lucastakejame commented 3 years ago

I downloaded the RuntimeAudioImporter4250.zip from release and it worked!

lucastakejame commented 3 years ago

It worked for normal sound, but for Ambisonics (4 channels) sound It doesn't . I uploaded 2 ambisonics sounds in here if you wan't to test: https://we.tl/t-Mh5SMYfv2A I also added 1 line in RuntimeAudioImporterLibrary.cpp

USoundWave* ReadyUSoundWave = GetSoundWaveObject(this, (const uint8*)WaveData, WaveDataSize, Status); // A ready USoundWave static object
                    ReadyUSoundWave->bIsAmbisonics = 1; // added this line to make sure all imported audios are flagged as ambisonics

with this setup, the problem is only with the start time, if different from 0. it won't play.

gtreshchev commented 3 years ago

Thanks for the message, I'll take a look and deal with this shortly.

gtreshchev commented 3 years ago

I have an assumption that I missed something: some platforms do not use WAV, but OGG Vorbis format, which is why decompression does not take place in full. I will fix this as soon as I can.

lucastakejame commented 3 years ago

Thank you very much!

gtreshchev commented 3 years ago

I will update the plugin soon, more information can be found in this chat - https://t.me/unrealblog

gtreshchev commented 3 years ago

Fixed.

michaelWuensch commented 1 year ago

Hi there, I still have this problem. Playing with start time of 0 works like a charm. I am using UE 4.27 on windows. When I installed the plugin from the marketplace it crashed when using a starttime other than 0. I then found this thread and downloaded the latest 4.27 zip. Now it doesn't crash anymore, but it doesn't play anything either. It doesn't matter if I try to import an mp3 or a wav file.

Btw, altough I downloaded 4.27 zip it says it was built with 4.26

image

gtreshchev commented 1 year ago

@michaelWuensch Hi. This bug is relevant on UE versions less than 5. I will investigate if it is possible to fix this and let you know. In the meantime, for now, you can start playing your soundwave from zero seconds and instantly rewind (RewindPlaybackTime function) to the desired time.