How to modify all audio under Bus, or the single playback speed of EventInstance

At present, I want to realize the function of program acceleration, so the sound effect will be accelerated accordingly, but I have tried the SetPatch interface, but it will cause the pitch to become higher.

I searched for a long time and found that most of them use DSP, including official recommendations, but DSP has limitations, because its value is 0.5-2, so the maximum supported speed is 2 times.

I also found that setMusicSpeed in Sound seems to be able to meet the requirements without causing the pitch to become higher. However, I am currently using EventInstance to play audio, and it seems a bit troublesome to obtain it.

So I would like to ask if there is a better solution that can change the overall audio speed under the Bus, or change the speed of a single EventInstance.

What is the official recommended practice? The current DSP should not be able to meet the demand, or is there any third-party DSP that can meet this demand?

We have a way to speed up sound and pitch using setPitch, and we have a way to change pitch without changing sound using a DSP, so combined you have a way to speed up sound without changing pitch by playing at twice the speed and half the pitch.
To do this at the bus level you will need to drill down to get the ChannelGroup and call ChannelGroup.setPitch on that- you can also set the pitch to greater than double the speed in this way.

FMOD.DSP pitchShift;
FMOD.System coreSystem;
system.getCoreSystem(out coreSystem);

system.getBus("bus:/", out FMOD.Studio.Bus master);
master.getChannelGroup(out FMOD.ChannelGroup masterChannelGroup);
if (masterChannelGroup)
{
    masterChannelGroup.setPitch(2.0f); // Play twice as fast
    coreSystem.createDSPByType(FMOD.DSP_TYPE.PITCHSHIFT, out pitchShift);
    pitchShift.setParameterFloat(FMOD.DSP_PITCHSHIFT.PITCH, 0.5f); // Play at half pitch
    masterChannelGroup.addDSP(FMOD_CHANNELCONTROL_DSP_HEAD, pitchShift);
}

...

// Clean up dsp when finished

masterChannelGroup.removeDSP(pitchShift);
pitchShift.release();

Sound.setMusicSpeed only works for MIDI/MOD/IT etc files.

Hi Jeff, thanks for your reply.

ChannelGroup or EventInstance has a setPitch interface, which can set the speed above 2x, but it will cause the pitch to become higher, which sounds uncomfortable.

Yes, the DSP can support 2x speed very well, but if it exceeds 2x speed, the pitch will still become very high, because of its value of 0.5-2.

I wonder or is there any other solution that can be implemented? Because what I probably need now is up to 6x speed.

Looking forward to your next reply.

Hi,

Unfortunately, we do not support speeds above x2. I will make a note of your interestest and pass it on to our development team to look into further.

Apologies I cannot assist further.

Hi Connor,

Not supporting speeds higher than 2x might sound like bad news, but over time I’ve been prepared because the only solution I’ve found so far is for 2x.

I’m trying to convince the team to change their minds, unless a higher pitch is acceptable.

Thanks again for your reply.

1 Like