0

"time.audioSource.pitch" implementation in own project

waruban 6 months ago 0

Hi, kindly allow me to try asking here. I want to implement "time.audioSource.pitch" in my code in order to create an audio effect (slowing background music) when time is slowed. however I m using an array like : 


foreach (Sound s in sounds)

{

s.audioSource = time.gameObject.AddComponent<AudioSource>();

s.audioSource.clip = s.clip;

s.audioSource.volume = s.volume;

s.audioSource.pitch = s.pitch;

s.audioSource.loop = s.loop;

s.audioSource.outputAudioMixerGroup = s.audioMixerGroup;

}

and do not really know how to do it (not really good at coding is not helping either). Any advice on how to insert time.audioSource.pitch in my code would be highly appreciated.

Chronos Version:
Unity Version: