AudioOutput class is used to send data to audio output devices.
AudioOutput class plays sound over a sound device. The audio output needs to be connected to a Phonon.MediaObject 使用 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 ,可以调用 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() 。 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.
另请参阅
Phonon.VolumeSlider 音乐播放器范例 BackendCapabilities Phonon Module
| 参数: |
|
|---|
创建新 AudioOutput that defines output to the system default device with the {Phonon::Category::}{ NoCategory } category
另请参阅
Phonon.categoryToString() PySide.phonon.Phonon::AudioOutput.outputDevice()
| 返回类型: | PySide.phonon.Phonon.Category |
|---|
Returns the category of this output.
另请参阅
Phonon.AudioOutput.AudioOutput()
| 返回类型: | PySide.QtCore.bool |
|---|
This property tells whether the output is muted.
Muting the output has the same effect as calling setVolume(0.0).
| 参数: | arg__1 – PySide.QtCore.bool |
|---|
| 返回类型: | unicode |
|---|
This is the name that appears in Mixer applications that control the volume of this output.
| 返回类型: | 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.
另请参阅
PySide.phonon.Phonon::AudioOutput.outputDeviceChanged()
| 参数: | newAudioOutputDevice – PySide.phonon.Phonon::AudioOutputDevice |
|---|
| 参数: | mute – PySide.QtCore.bool |
|---|
This property tells whether the output is muted.
Muting the output has the same effect as calling setVolume(0.0).
| 参数: | newName – unicode |
|---|
This is the name that appears in Mixer applications that control the volume of this output.
| 参数: | newAudioOutputDevice – PySide.phonon.Phonon::AudioOutputDevice |
|---|---|
| 返回类型: | PySide.QtCore.bool |
| 参数: | newVolume – PySide.QtCore.qreal |
|---|
This is the current loudness of the output.
(it is using Stevens' law to calculate the change in voltage internally).
另请参阅
PySide.phonon.Phonon::AudioOutput.volumeDecibel()
| 参数: | newVolumeDecibel – 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.
另请参阅
PySide.phonon.Phonon::AudioOutput.volume()
| 返回类型: | PySide.QtCore.qreal |
|---|
This is the current loudness of the output.
(it is using Stevens' law to calculate the change in voltage internally).
另请参阅
PySide.phonon.Phonon::AudioOutput.volumeDecibel()
| 参数: | newVolume – PySide.QtCore.qreal |
|---|
| 返回类型: | 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.
另请参阅
PySide.phonon.Phonon::AudioOutput.volume()