I used the unreal tounament’s code to save the Sound classes’ volume***(tested both Editor and Packaged game)***
FAudioDevice* AudioDevice = GEngine->AudioDevice;
if (AudioDevice != NULL)
{
for (TMap<USoundClass*, FSoundClassProperties>::TIterator It(AudioDevice->SoundClasses); It; ++It)
{
USoundClass* ThisSoundClass = It.Key();
if (ThisSoundClass != NULL && ThisSoundClass->GetFullName().Find(SoundClassName) != INDEX_NONE)
{
// the audiodevice function logspams for some reason
//AudioDevice->SetClassVolume(ThisSoundClass, NewVolume);
ThisSoundClass->Properties.Volume = NewVolume;
}
}
}
it worked to changed the audio Volume.
but if I close the editor or packaged game. it will return to a default audio Volume every times.
I did the saving in the game setting class too. but it still not work.
it saved like following way
SoundClassVolumes[0]=0.000000
SoundClassVolumes[1]=1.000000
SoundClassVolumes[2]=1.000000
SoundClassVolumes[3]=1.000000