Hi there! I’m summoning the wisdom of @dan.reynolds - hope you can help.
I’m working on a rhythm-based puzzle game with interactive music. Everything was working okay until I recently overhauled the music and rhythm system. Previously it was messy and unperformant, but functional.
The new version uses Quartz in UE4.27. I have a BP class called BeatMgr that fires off events on the beat that drive the gameplay - that part is all fine. The interactive music in this case is done by crossfading looping 32s stems. When BeatMgr is notified to add a new stem to the mix, it works out what the start time of the wave should be if it starts on the next beat and then uses PlayQuantized with the Quartz clock to start it on the right sample when the time comes. (BeatMgr then uses Cue params to do crossfading and stuff, that part’s all fine.) Basically, I’m trying to add a stem by starting the wave in sync with the other stems that are already playing.
The problem is, no matter what I plug into the “In Start Time” input parameter of PlayQuantized, it always starts at the beginning of the wave. Everything about this system works fine.
I’ve tried all the old tricks like using “force inline” on the wave asset so it’s not streaming (ideally I need it primed) and setting the AudioComponent to not auto-activate. I’ve tried not looping. I’ve tried tweaking just about everything on the wave, cue, sound class and component that I’d think would make a difference. Nothing will make it start anywhere than sample 0. The quantization works fine, it always starts on the beat, just the wrong beat.
This might be a bug, or it might be me. I’m happy to get my c++ on if I need to. Any help at all would be appreciated!