void DelegateNotification(AudioVolumeNotificationData data)
 {
     if (_callback != null)
     {
         _callback.Invoke(new DeviceInfo(data.MasterVolume, data.Muted));
     }
 }
Exemple #2
0
        private void RunCallback(Mixer mixer, MixerLine line)
        {
            int VolumeMin     = Mixers.Playback.UserLines[0].VolumeMin;
            int VolumeMax     = Mixers.Playback.UserLines[0].VolumeMax;
            int VolumeCurrent = Mixers.Playback.Lines[0].Volume;

            // Volume Min and Max are probably 0, and 100, but since I can't say that for sure adjust the values to be zero based
            VolumeMax     = VolumeMax - VolumeMin;
            VolumeCurrent = VolumeCurrent - VolumeMin;
            VolumeMin     = 0;

            double volume = ((double)VolumeCurrent) / ((double)VolumeMax);
            bool   muted  = Mixers.Playback.UserLines[0].Mute;

            if (_callback != null)
            {
                _callback.Invoke(new DeviceInfo(volume, muted));
            }
        }
        private IEnumerator OnAudioEndCoroutine(float clipDuration)
        {
            yield return(new WaitForSeconds(clipDuration));

            onAudioEnded.Invoke();
        }