|  | Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# VolumeFaderEffect Class Reference
(Phonon::VolumeFaderEffect)
[Phonon module]

Audio effect to gradually fade the audio volume. Author: Matthias Kretz <kretz@kde.org> More...

     #include <Phonon>

- List of all members, including inherited members

### Public Types

- enum FadeCurve { Fade3Decibel, Fade6Decibel, Fade9Decibel, Fade12Decibel }

### Properties

- fadeCurve : FadeCurve
- volume : float
- volumeDecibel : double

### Public Functions

- FadeCurve fadeCurve () const
- float volume () const
- double volumeDecibel () const

### Public Slots

- void fadeIn ( int fadeTime )
- void fadeOut ( int fadeTime )
- void fadeTo ( float volume, int fadeTime )
- void setFadeCurve ( FadeCurve curve )
- void setVolume ( float volume )
- void setVolumeDecibel ( double volumeDecibel )

## Detailed Description

Audio effect to gradually fade the audio volume. Author: Matthias Kretz <kretz@kde.org>

This effect differs from gradually changing the output volume in that a dedicated effect can change the volume in the smallest possible steps while every other volume control will make more or less noticeable steps.

See also AudioOutput::volume.

## Member Type Documentation

### enum VolumeFaderEffect::FadeCurve

Determines the curve of the volume change.

Constant | Value | Description
--- | --- | ---
`Phonon::VolumeFaderEffect::Fade3Decibel` | `0` | Crossfade curve/fast fade out. This is the default fade curve.
`Phonon::VolumeFaderEffect::Fade6Decibel` | `1` | Linear fade out.
`Phonon::VolumeFaderEffect::Fade9Decibel` | `2` | Slow fade out.
`Phonon::VolumeFaderEffect::Fade12Decibel` | `3` | A more extreme version of the -9dB fade.

Notes:

`Fade3Decibel` is often the best fade for a crossfade, as after half of the time the volume reached -3dB. This means that half the possible power (which is proportional to the square of the voltage) is reached. Summed, the maximum power of two audio signals fading with a -3dB curve will always be equal.

For fading in or out the -3dB curve is too abrupt in the end.

With a -6dB fade curve, a volume of -6dB is reached after half of the fading time. -6dB is equal to half of the voltage meaning that the voltage multiplier changes linearly from the start of the fade to the end.

With the `Fade9Decibel` fade, a volume of -9dB is reached after half of the fade time, so the fade is fast in the beginning and slow at the end. This is a good fade for ending music.

## Property Documentation

### fadeCurve : FadeCurve

This property holds the fade curve to be used for the fadeIn(), fadeOut() and fadeTo() slots.

Defaults to Fade3Decibel.

Access functions:

- FadeCurve fadeCurve () const
- void setFadeCurve ( FadeCurve curve )

See also FadeCurve.

### volume : float

This is the current volume of the output as voltage factor. Setting this property changes the volume immediately.

1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0%

Access functions:

- float volume () const
- void setVolume ( float volume )

See also volumeDecibel.

### volumeDecibel : double

This is the current volume of the output in decibel. Setting this property changes the volume immediately.

0 dB means no change in volume, -6dB means an attenuation of the voltage to 50% and an attenuation of the power to 25%, -inf dB means silence.

Access functions:

- double volumeDecibel () const
- void setVolumeDecibel ( double volumeDecibel )

See also volume.

## Member Function Documentation

### void VolumeFaderEffect::fadeIn ( int fadeTime ) `[slot]`

Tells the Fader to change the volume from the current volume to 100% in fadeTime milliseconds.

Short for `fadeTo(1.0, fadeTime)`.

fadeTime the fade duration in milliseconds

See also fadeTo() and volume.

### void VolumeFaderEffect::fadeOut ( int fadeTime ) `[slot]`

Tells the Fader to change the volume from the current volume to 0% in fadeTime milliseconds. Short for `fadeTo(0.0, fadeTime)`.

fadeTime the fade duration in milliseconds

See also fadeTo.

### void VolumeFaderEffect::fadeTo ( float volume, int fadeTime ) `[slot]`

Tells the Fader to change the volume from the current value to volume in fadeTime milliseconds.

See also fadeIn() and fadeOut().