Phonon.AudioOutput

Synopsis

Functions

Slots

Signals

Detailed Description

The AudioOutput class is used to send data to audio output devices.

The AudioOutput class plays sound over a sound device. The audio output needs to be connected to a Phonon.MediaObject using PySide.phonon.Phonon.createPath() . To start playback, you call PySide.phonon.Phonon.MediaObject.play() on the media object.

mediaObject = Phonon.MediaObject(self)
mediaObject.setCurrentSource(Phonon.MediaSource("/mymusic/barbiegirl.wav"))
audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)
path = Phonon.createPath(mediaObject, audioOutput)

The class supports changing the PySide.phonon.Phonon::AudioOutput.volume() . It is also possible to mute the sound.

To find out what Phonon.AudioOutputDevice s are available for AudioOutput , you can call BackendCapabilities.availableAudioOutputDevices() . A default device is selected by the backend, but it is possible to set the device to be used with PySide.phonon.Phonon::AudioOutput.setOutputDevice() . The PySide.phonon.Phonon::AudioOutput.outputDeviceChanged() signal will be emitted if the device changes.

If an error occurs with the playback, for instance, if no valid output device is found, the media object will receive a stateChanged() signal with the ErrorState .

Note that the default values of properties are dependent on the backend.

See also

Phonon.VolumeSlider Music Player Example BackendCapabilities Phonon Module

class PySide.phonon.Phonon.AudioOutput(category[, parent=None])
class PySide.phonon.Phonon.AudioOutput([parent=None])
Parameters:

Creates a new AudioOutput that defines output to the system default device with the {Phonon::Category::}{ NoCategory } category

See also

Phonon.categoryToString() PySide.phonon.Phonon::AudioOutput.outputDevice()

PySide.phonon.Phonon.AudioOutput.category()
Return type:PySide.phonon.Phonon.Category

Returns the category of this output.

See also

Phonon.AudioOutput.AudioOutput()

PySide.phonon.Phonon.AudioOutput.isMuted()
Return type:PySide.QtCore.bool

This property tells whether the output is muted.

Muting the output has the same effect as calling setVolume(0.0).

PySide.phonon.Phonon.AudioOutput.mutedChanged(arg__1)
Parameters:arg__1PySide.QtCore.bool
PySide.phonon.Phonon.AudioOutput.name()
Return type:unicode

This is the name that appears in Mixer applications that control the volume of this output.

PySide.phonon.Phonon.AudioOutput.outputDevice()
Return type:PySide.phonon.Phonon::AudioOutputDevice

This property holds the (hardware) destination for the output.

The default device is determined by the Phonon.Category and the global configuration for that category. Normally you don’t need to override this setting - letting the user change the global configuration is the right choice. You can still override the device though, if you have good reasons to do so.

See also

PySide.phonon.Phonon::AudioOutput.outputDeviceChanged()

PySide.phonon.Phonon.AudioOutput.outputDeviceChanged(newAudioOutputDevice)
Parameters:newAudioOutputDevicePySide.phonon.Phonon::AudioOutputDevice
PySide.phonon.Phonon.AudioOutput.setMuted(mute)
Parameters:mutePySide.QtCore.bool

This property tells whether the output is muted.

Muting the output has the same effect as calling setVolume(0.0).

PySide.phonon.Phonon.AudioOutput.setName(newName)
Parameters:newName – unicode

This is the name that appears in Mixer applications that control the volume of this output.

PySide.phonon.Phonon.AudioOutput.setOutputDevice(newAudioOutputDevice)
Parameters:newAudioOutputDevicePySide.phonon.Phonon::AudioOutputDevice
Return type:PySide.QtCore.bool
PySide.phonon.Phonon.AudioOutput.setVolume(newVolume)
Parameters:newVolumePySide.QtCore.qreal

This is the current loudness of the output.

(it is using Stevens’ law to calculate the change in voltage internally).

See also

PySide.phonon.Phonon::AudioOutput.volumeDecibel()

PySide.phonon.Phonon.AudioOutput.setVolumeDecibel(newVolumeDecibel)
Parameters:newVolumeDecibelPySide.QtCore.qreal

This is the current volume of the output in decibel.

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.

See also

PySide.phonon.Phonon::AudioOutput.volume()

PySide.phonon.Phonon.AudioOutput.volume()
Return type:PySide.QtCore.qreal

This is the current loudness of the output.

(it is using Stevens’ law to calculate the change in voltage internally).

See also

PySide.phonon.Phonon::AudioOutput.volumeDecibel()

PySide.phonon.Phonon.AudioOutput.volumeChanged(newVolume)
Parameters:newVolumePySide.QtCore.qreal
PySide.phonon.Phonon.AudioOutput.volumeDecibel()
Return type:PySide.QtCore.qreal

This is the current volume of the output in decibel.

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.

See also

PySide.phonon.Phonon::AudioOutput.volume()