Download

How do you set the VolumeMultipler within SoundCue.h ;/

Hey everyone,

Just a quick question in regards to setting the VolumeMultiplier found within “SoundCue.h”.

I wrote a for loop which should change the VolumeMultiplier but as soon as it enters the look, UE4 crash. Im actually not used to posting for help so I dont know what to include.

Fatal error!

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION writing address 0x00000140

void TitanDataHandle::ResetMenuVolume(float MusicVol, float SoundVol)
{


    if (MusicVol > 0)
    {
        MusicVolume = MusicVol;
        for ( TArray<USoundCue*> :: TIterator It  (AudioResource.Find(FString("Music"))->CreateIterator()); It; ++It) {


            (*It)->VolumeMultiplier = MusicVolume;
        }
    }
        if (SoundVol > 0)
        {
            SoundVolume = SoundVol;
            for (TArray<USoundCue*>::TIterator it(AudioResource.Find(FString("Sound"))->CreateIterator()); it; ++it) {

                (*it)->VolumeMultiplier = SoundVolume;
            }
        }
        //Update Archive Data
        TitanSingleton<TitanJsonHandle>::Get()->UpdateRecordData(GetEnumValueAsString<ECultureSelect>(FString("ECultureSelect"),
            CurrentCulture), MusicVolume, SoundVolume, &RecordDataList);
}


Okay, as i was about to called it a night, I had a thought to double check that the sound file is actually a cue! and it was not a cue, just default wav when you drag it in. if this post is still here in the future, and your dealing with soundcue.h make sure you create a cue for ye audio. #BrainFreeze :slight_smile: