Page 1 of 1
AudioMixer resets when loading the project
Posted: Sat Mar 05, 2022 7:55 am
by Ats
Hello. I have this weird bug with the AudioMixer:
I'm using Chanel 2 and 3, but when I save the project, leave ZGE, and come back to it later, extra channels 2 and 3 are deactivated.
In fact, none of the settings in the AudioMixer seems to be saved, since Volume and DelayLength of channel 0 and 1 goes back to their factory reset.
I can't set all manually at the start of the game either using:
AudioMixer.Ch2Active = 1;
AudioMixer.Ch2Volume = 0.5;
AudioMixer.Ch3Active = 1;
AudioMixer.Ch3Volume = 0.5;
I get an AccessViolation Error...
Re: AudioMixer resets when loading the project
Posted: Sat Mar 05, 2022 2:35 pm
by Kjell
Hi Ats,
Ats wrote: ↑Sat Mar 05, 2022 7:55 amI'm using Chanel 2 and 3, but when I save the project, leave ZGE, and come back to it later, extra channels 2 and 3 are deactivated.
Strange .. i just tried this to double-check and it works just fine for me.
Ats wrote: ↑Sat Mar 05, 2022 7:55 amI can't set all manually at the start of the game either
Also weird .. i initially thought because you named your AudioMixer component "AudioMixer" that might have caused some problems, but it doesn't seem like AudioMixer is a reserved keyword so i'm not getting any errors even when i use that name.
No idea what's going on.
K
Re: AudioMixer resets when loading the project
Posted: Sat Mar 05, 2022 5:16 pm
by Ats
I'll try to make a strip down example from my game. But apart from using SunVox library, I'm not doing much with the sound.
This time around, everything was kept when I opened the project. But the problem happened to me four times already in the past few days, that's why I noted it. I'll see if I can find what is breaking the thing.
I tried renaming the AudioMixer to something else already, but still got the AccessViolation Error...
Edit:
Ok, preview works, but F9 gives the AccessViolation error only with that:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" FileVersion="2">
<OnLoaded>
<ZExpression Expression="test.Ch2Active = 1;"/>
</OnLoaded>
<Content>
<AudioMixer Name="test" Ch0Active="1" Ch0Volume="0.5" Ch0DelayLength="0.1" Ch1Active="1" Ch1Volume="0.5" Ch1DelayLength="0.1" Ch2Active="1"/>
</Content>
</ZApplication>
Edit 2:
Here's the repro:
- Add an AudioMixer
- Deactivate Ch0Active (or change Ch0Volume)
- Save the project
- Reload the project
Result: AudioMixer is back to factory reset
And I'm still searching why Ch2Active and Ch3Active are deactivating from time to time...
Re: AudioMixer resets when loading the project
Posted: Sun Mar 06, 2022 1:03 pm
by VilleK
AudioMixer is treated specially in the engine so there is a possibility something got wrong in the transition to 64-bit. I'll investigate.
Re: AudioMixer resets when loading the project
Posted: Mon Mar 07, 2022 8:34 am
by Ats
I'VE FOUND IT!!!
- Add an AudioMixer
- Activate Ch2Active
- Edit Project as XML
- Add a spacebar somewhere so that ZGE thinks the code has been changed and Validate
- AudioMixer is now factory reset
Re: AudioMixer resets when loading the project
Posted: Mon Mar 07, 2022 3:24 pm
by VilleK
So far it seems to be two separate problems:
- Channel 0 and 1 active and volume are set to default values by the designer. This seems to override settings in zgeproj files.
- Assigning audiomixer properties in expressions fails with player.bin that is built with Freepascal in 64-bit build.
I'll continue to check for a solution.
Re: AudioMixer resets when loading the project
Posted: Thu Mar 10, 2022 3:07 pm
by VilleK
Ats wrote: ↑Sat Mar 05, 2022 7:55 am
AudioMixer.Ch2Active = 1;
AudioMixer.Ch2Volume = 0.5;
AudioMixer.Ch3Active = 1;
AudioMixer.Ch3Volume = 0.5;
I get an AccessViolation Error...
I've now fixed the access violation. Please download ZGE again to test.
Re: AudioMixer resets when loading the project
Posted: Mon Mar 14, 2022 2:58 pm
by VilleK
VilleK wrote: ↑Thu Mar 10, 2022 3:07 pm
I've now fixed the access violation. Please download ZGE again to test.
Not sure I actually updated the public build. Please try again now.
Re: AudioMixer resets when loading the project
Posted: Tue Mar 15, 2022 2:28 pm
by Ats
Oh yes! Sorry I saw that the other day, and everything was still broken, so I went for another thing and forgot about it. So, now:
- F9 bug is corrected
- Editing XML bug isn't corrected: AudioMixer keeps resetting to factory after editing the XML
- Saving/Loading project keeps resetting AudioMixer channels 0 and 1
Re: AudioMixer resets when loading the project
Posted: Mon Aug 01, 2022 2:23 pm
by Ats
Hello VilleK, just a friendly reminder that those two bugs are still present in ZGE. I forgot about them and was wondering why the sound wasn't working properly all of a sudden...
- Add an AudioMixer
- Deactivate Ch0Active (or change Ch0Volume)
- Save the project
- Reload the project
RESULT: Ch0Active is reactivated
- Add an AudioMixer
- Activate Ch2Active
- Edit Project as XML
- Add a spacebar somewhere so that ZGE thinks the code has been changed and Validate
- AudioMixer is now factory reset
RESULT: Ch2Active is deactivated