Example #1
0
 void Update()
 {
     // Update soundfield.
     if (!isPlaying && !isPaused)
     {
         Stop();
     }
     else
     {
         GvrAudio.UpdateAudioSoundfield(id, transform, gainDb);
     }
 }
Example #2
0
 // 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);
 }
Example #3
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);
 }