# Downporting Wav -\> Cue Python code from UE5 to UE4?

**URL:** <https://forums.unrealengine.com/t/downporting-wav-cue-python-code-from-ue5-to-ue4/1200293>\
**Category:** Editor Scripting\
**Tags:** unreal-engine, question\
**Created:** [June 15, 2023, 4:36pm UTC](https://forums.unrealengine.com/t/downporting-wav-cue-python-code-from-ue5-to-ue4/1200293 "2023-06-15T16:36:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FiftyTiftyModder](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FiftyTiftyModder](https://forums.unrealengine.com/u/FiftyTiftyModder)\
**Post date:** [June 15, 2023, 4:36pm UTC](https://forums.unrealengine.com/t/downporting-wav-cue-python-code-from-ue5-to-ue4/1200293/1 "2023-06-15T16:36:21Z")

</div>

The TAPython devs were very helpful and did most of the work in making a script that automates wav file import and cue creation. Here’s the snippet that has an issue in UE4:

**#2. load the create wave asset**  
**assetWavCurrent = unreal.load\_asset(strPathWavUE)**

**#3. create the cue asset from the loaded wave asset**  
**factory = unreal.SoundCueFactoryNew()**

**factory.set\_editor\_property(“InitialSoundWaves”, [assetWavCurrent])**

**strPathCueUE = f’/Game/{strProjectName}cue/{os.path.dirname(strPathLocal)}'.replace(“\”, “/”)**

**strCue = os.path.basename(strPathWavCurrent).split(‘.’)[0] + ‘\_CUE’**

**assetCueCurrent = asset\_tools.create\_asset(strCue, strPathCueUE, unreal.SoundCue, factory)**

It works fine in UE5! But in EU4, the following line:

**factory.set\_editor\_property(“InitialSoundWaves”, [assetWavCurrent])**

Throws this error:

**LogPython: Error: Exception: SoundCueFactoryNew: Property ‘InitialSoundWaves’ for attribute ‘InitialSoundWaves’ on ‘SoundCueFactoryNew’ is protected and cannot be set**

I took a look at the Unreal documentation, but it’s non-existant. Just function and property names. No examples, no detail, no explanations on how to work with the python functions: [unreal.SoundCueFactoryNew — Unreal Python 4.26 (Experimental) documentation](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/SoundCueFactoryNew.html)

I tried changing the line to:

**factory.set\_editor\_property(“InitialSoundWave”, [assetWavCurrent])**

But it throws the same error for that property. What’s the proper way of using Python for wav & cue asset creation in UE4?
