Phonon.Effect

Inherited by: Phonon.VolumeFaderEffect

Synopsis

Functions

Detailed Description

The Effect class is used to transform audio streams.

An effect is a media node which is inserted into a path between a Phonon.MediaObject and an audio output node, for instance, an Phonon.AudioOutput . The Effect transforms the media stream on that path.

Examples may include simple modifiers, such as fading or pitch shifting, and more complex mathematical transformations. You can query the backend for available effects with BackendCapabilities.availableAudioEffects() . Note that the effects available is dependent on the underlying system (DirectDraw, GStreamer, or QuickTime).

In order to use an effect, insert it into the path as follows:

path = Phonon.createPath(...)
effect = Effect(this)
path.insertEffect(effect)

The effect will immediately begin applying it’s transformations on the path. To stop it, remove the Effect from the path.

To create an effect, you use the Phonon.EffectDescription class, which you get from PySide.phonon.Phonon::BackendCapabilities.availableAudioEffects() . We give a code example below.

QList<Phonon::EffectDescription> effectDescriptions =
        Phonon::BackendCapabilities::availableAudioEffects();
Phonon::EffectDescription effectDescription = effectDescriptions.at(4);

Phonon::Path path = Phonon::createPath(mediaObject, audioOutput);


Phonon::Effect *effect = new Phonon::Effect(effectDescription);
path.insertEffect(effect);

An effect can have one or more parameters, which let you alter how the effect works, for instance, by specifying the depth of a reverb effect. See the EffectParameter class description for details.

Phonon also provides EffectWidget , which lets the user modify the parameters of an effect an the fly; e.g., with combo boxes.

See also

Phonon Module EffectWidget

class PySide.phonon.Phonon.Effect(description[, parent=None])
Parameters:

Constructs a new effect object with the given description and parent object.

The EffectDescription object determines the type of the effect.

PySide.phonon.Phonon.Effect.description()
Return type:PySide.phonon.Phonon::EffectDescription

Returns the description of this effect. This is the same description that was passed to the constructor.

PySide.phonon.Phonon.Effect.parameterValue(arg__1)
Parameters:arg__1PySide.phonon.Phonon::EffectParameter
Return type:object

Returns the value of the given effect parameter . You can fetch the available parameters for an effect with PySide.phonon.Phonon::Effect.parameters() .

See also

PySide.phonon.Phonon::Effect.setParameterValue() EffectParameter

PySide.phonon.Phonon.Effect.parameters()
Return type:

Returns a list of parameters that this effect provides to control its behavior.

PySide.phonon.Phonon.Effect.setParameterValue(arg__1, value)
Parameters:
  • arg__1PySide.phonon.Phonon::EffectParameter
  • value – object

Sets the given effect parameter to the specified value .

Parameters for an effect are returned by PySide.phonon.Phonon::Effect.parameters() . You can check which QVariant.Type an EffectParameter takes with the EffectParameter.type() function.

See also

PySide.phonon.Phonon::Effect.parameterValue() EffectParameter