void Update() { // Update soundfield. if (!isPlaying && !isPaused) { Stop(); } else { GvrAudio.UpdateAudioSoundfield(id, transform, gainDb); } }
// Initializes the source. private bool InitializeSoundfield() { if (id < 0) { id = GvrAudio.CreateAudioSoundfield(); if (id >= 0) { GvrAudio.UpdateAudioSoundfield(id, this); for (int channelSet = 0; channelSet < audioSources.Length; ++channelSet) { InitializeChannelSet(audioSources[channelSet], channelSet); } } } return(id >= 0); }
void Update() { // Update soundfield. if (!isPlaying && !isPaused) { Stop(); } else { for (int channelSet = 0; channelSet < audioSources.Length; ++channelSet) { audioSources[channelSet].SetSpatializerFloat((int)GvrAudio.SpatializerData.Gain, GvrAudio.ConvertAmplitudeFromDb(gainDb)); } } GvrAudio.UpdateAudioSoundfield(id, this); }