Hi all! First off, I’m new to FMOD so apologies if there is an easy fix for this!
I’ve started to use FMOD for a recent game project and have created a discrete parameter in respect to player lives (3, 2, 1 and 0 respectively. Just as a side note, 0 is pitched down 15 semitones and has a seek modulation to simulate a tape stop effect). I am automating the pitch of the audio file using the clip pitch and not the pitch shifter effect. This creates a nice combination of stretching/slowing down the audio as well as pitching. This is perfect and exactly what I want. I also created three separate loop points that are the exact length of the original and time stretched versions (this was worked out by adding extra audio tracks and pitching the audio directly to see what the new length would be for each one). I then setup these loops with conditions that they only trigger if the player lives are 3, 2 or 1. These loops work perfectly in FMOD but for some reason, Unity is refusing to playback the extended audio and has silence during those extended loop points. Unity will correctly use the loop points for each respective life value but refuses to ‘see’ the longer time stretched clip, resulting in a cutoff in sound.
Does anyone have any workarounds for this kind of thing? I’m not a dev so am unsure whether this can be fixed via scripting in Unity.
Thank you for sharing the information and screenshot!
I tried to follow up your setup in FMOD, but so far I haven’t been able to reproduce the extended audio silence issue in Unity, and the stretched part seems keeps playing on my side.
Could you please share a bit more details on how you are triggering the event and setting the parameter in your game? For example:
Are you starting the event via a StudioEventEmittercomponent, or through code?
I was able to reproduce the issue on my side when changing the parameter during runtime, so I will forward this to the dev team for further investigation.
In the meantime, another possible workaround you could try is using an Autopitch Modulator.
Here’s a quick setup to test:
Create a new event and add only the livesLeft parameter sheet
Drag your asset onto the audio track, click the single instrument and enable Loop Instrument
Right click on the pitch knob, select Add Modulation > Autopitch
Set the root pitch to 3 and tweak the min pitch to match your design