How to save audio .wav format to variable ?

Sound wave object reference?

Hello,

I am using struct variable for weapon, containing all detail of weapon. I want to save audio file (.wav) to struct but i don’t know which variable type it should be. I tried variable type as “sound cue” and “sound base” but i cannot store value in it. Like in blueprint you can store value as default value but as soon as you place it in world it removes value from it and i cannot set it.
Hope you understand my question

Hello again ClockworkOcean,

Thanks for replay and tried your suggestion but still the same.

I have many types of weapons and almost everything runs on struct so i thought that sound of each weapon would be easy as struct is passing all values.

Do you think that unreal cannot save sound on editable variable?

What am I missing?

You made struct.
added that struct to blueprint actor.
And changed it’s value.

You did this all.
Now if you make struct editable in blue print. And place that blueprint actor in your map.
All values of variable should be there.
But in my project, when i place blueprint actor with struct in map, all struct variable values are there except that sound value.

In the level:

But you will only get the default values when you place in the level. When you place the BP in the level, you get a fresh instance, so all parts of the struct that are not intialized by default will be empty.

hummm , that’s strange !!!
i set value as default. But still mine value show empty.
Even if i try to set value in placed actor, it won’t let me.
Which UE version you are using?
Mine is 4.25
And is there limit of variables in struct ?

4.25 here, no limit as far as I know.

When you click it do you get a list?

yes i do get list

Try using type ‘sound base object reference’ it should fit anything you try and throw at it…

Well, that’s how you set it, no?

HAHAHAHAHA, You are right. But if select any of those, the list menu just collapsed and no value is stored.

Have you tried type ‘sound base object reference’?

I just tried that, still same result.

I think my engine is broken

302981-worrying-emoji.png

Ok can you do me pics of: structure, and variable declaration in the blueprint?

I need the top bit actually, and the variable or array declaration in the blueprint.

That is all I have one struct only