gtreshchev / RuntimeAudioImporter

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

The ogg files, just play for 21 seconds #22

Closed Kazbayadum closed 2 years ago

Kazbayadum commented 2 years ago

Hi

I have the latest github version of the plugin (and earlier) and I have noticed that ogg files only play for 21 seconds. Does anyone else have the same problem? Works perfeclyt with wav, mp3 and flac files.

Here I'm attaching my "Blueprint code". It's from the event graph of an Ambient Sound Class. Pantallazo

Kazbayadum commented 2 years ago

I forgot to say that I'm using UE4.27 and Linux.

gtreshchev commented 2 years ago

We had a chat in Telegram and we found out that you didn't use the latest version of the plugin

Kazbayadum commented 2 years ago

Yes I was not using the latest version. The best way to download the latest is to go to here https://github.com/gtreshchev/RuntimeAudioImporter/releases

I also found an error when trying to compile the plugin:

error: undefined symbol: vorbis_encode_init_vbr
>>> referenced by VorbisTranscoder.cpp:46

But it was solved by applying a change to an engine file Engine/Source/ThirdParty/Vorbis/Vorbis.Build.cs (be careful, it's not VorbisFile.Build.cs) We have to change the line 96, like this:

else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
{
    PublicAdditionalLibraries.Add(Path.Combine(VorbisLibPath, "Linux", Target.Architecture, "libvorbis.a"));
    // added fix for build runtime audio importer
    PublicAdditionalLibraries.Add(Path.Combine(VorbisLibPath, "Linux", Target.Architecture, "libvorbisenc.a"));
}

Then we compile the project again (I use vscodium) and bingo! everything is perfect now.

Thank you for your invaluable help, @gtreshchev