getVolume() public method

public getVolume ( float &volume ) : RESULT
volume float
return RESULT
Beispiel #1
0
    public float GetVolume()
    {
        float volume;

        instance.getVolume(out volume);
        return(volume);
    }
Beispiel #2
0
    void Start()
    {
        atmoEv = FMODUnity.RuntimeManager.CreateInstance(atmoAll);
        atmoEv.getParameter("location", out atmoLoc);
        atmoEv.getParameter("rain", out atmoRain);

        musicEv = FMODUnity.RuntimeManager.CreateInstance(music);
        musicEv.getParameter("music_style", out musicType);

        musicEv.getVolume(out volume);
        musicType.setValue(1);

        rainlvl = 0;
    }
Beispiel #3
0
    IEnumerator doFadeout()
    {
        //Gets current volume levels
        soundevent.getVolume(out currentVolume, out finalVolume);

        //Fades volume down to zero
        while (currentVolume > 0)
        {
            currentVolume = currentVolume - fadeoutSpeed;
            soundevent.setVolume(currentVolume);
            yield return(null);
        }

        //Stops the event
        soundevent.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);

        //Waits for stopped event
        yield return(new WaitForSeconds(0.5f));

        soundevent.setVolume(initialVolume);
    }
Beispiel #4
0
    /// <summary>
    /// TODO: Make work properly
    /// </summary>
    private void doEventFadeout()
    {
        float currentValue = initialEventVolume;
        float finalValue   = finalEventVolume;

        //soundevent.getVolume(out currentValue, out finalValue);
        //Debug.Log("CurrentVolume: " + currentValue + " FinalVolume: " + finalValue);

        soundevent.getVolume(out currentValue, out finalValue);
        if (currentValue > 0)
        {
            currentValue = currentValue - 0.001f;
            soundevent.setVolume(currentValue);
            Debug.Log("Volume reduced to " + currentValue);
        }

        if (currentValue <= 0)
        {
            soundevent.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
            soundevent.setVolume(initialEventVolume);
            fadeoutRunning = false;
        }
    }
Beispiel #5
0
    public float GetIntroRainVolume()
    {
        if (_rainAmbianceInstance.isValid())
        {
            float _lastVolumeSent;
            float _actualVolume;
            float _normalizedToSend;

            _rainAmbianceInstance.getVolume(out _lastVolumeSent, out _actualVolume);
            if (_lastVolumeSent == 0.0f)
            {
                _normalizedToSend = 0.0f;
            }
            else
            {
                _normalizedToSend = Mathf.Log(_lastVolumeSent / a) / b;
            }
            return(_normalizedToSend);
        }
        else
        {
            return(0.0f);
        }
    }
Beispiel #6
0
 // Use this for initialization
 void Start()
 {
     soundevent = FMODUnity.RuntimeManager.CreateInstance(selectSound);
     soundevent.getVolume(out initialEventVolume, out finalEventVolume);
     is3DEvent(soundevent);
 }
 private void Start()
 {
     eventInstance = emitter.EventInstance;
     eventInstance.getVolume(out volume);
 }