Hello
I’m currently building a music system for our game using Quartz to play wave assets sample-accurately, and I’m using metasounds as wave assets. The metasound is quite simple - just a wave player that starts playing a pre-entry sound wave (if it has one) before going into a main sound wave that will loop if it is set to do so.
I have built it as a state-based system, where a number of music layers can be associated with certain states. When a new state is queued, the system will crossfade into the layers of that state (if set to crossfade) over the duration of each pre-entry sound wave of the new layer. So all layer crossfades will line up, and be finished on beat 1 of the new state.
For fade-out, I’ve set up a callback using NotifyOnQuantizationBoundary and starting a fade-out when the event type of the callback is EQuartzCommandDelegateSubType::CommandOnAboutToStart. I couldn’t find any StopQuantized function for audio components.
For fade-in, I’m using the optional fade-in parameters of PlayQuantized. This works well enough when audio components are queued up to start on beat 1 of a clock that has not yet started, but not when queued up to play on a later beat. It seems like to me that the fade is started the moment PlayQuantized is called (or when the clock starts). If the delay until the sound starts playing is longer than the fade-in duration, the volume of the sound reaches its target value instantly when it starts playing, and if the delay is slightly shorter, it seems like the volume jumps to somewhere in the middle of the fade and then finishes the fade like normal.
See repro steps for more detail.
Is this intended behaviour? For now, I think I will perform the fade-in the same way as the fade-out.
Thank you in advance.