I am trying to code a dialogue system, which plays a certain imported .wav file based on the “row” of character dialogue.
I have the file names represented as a string. How do I go from this string, to reference the .wav file I need in my blueprint, as shown below? Some clues might be in the “error” I get when I try to make the connection - String is not compatible with Sound Wave Object Reference. How do I look up an asset in UE4 based on a string from a table - or is there a better way to do it? The table comes from a .csv file, and I can change its type if needed.
I think the best way to do what your doing is to use the audio analyzer plugin,. It allows you to use and reference sound assets without having to make sound wave assets,. It’s great if you want to work with a lot of files in a folder,. And opens up a lot of other functionality.
Now let’s assume your poor and don’t want to pay any moneys
What you want to do is store all your sound assets in a list and reference them that way. Since there’s little to no info about lists for blueprints I’ll use an array in this example. Have an array of all the sound assets this uses (you can make it public then add them in the details panel of the blueprint in the level). In event begin play,. You can use a foreach loop on the array and get assets name and store it in a string array. Then when you need to play a sound, loop through the string array to find which element equals the sound you’re looking for,. Get the index from the array where that element is and use that integer to get the sound from the sound wave array. I hope that wasn’t too confusing