• PySide 模块
  • PySide.phonon
  • 内容表

    上一话题

    PySide.phonon

    下一话题

    Phonon.BackendCapabilities

    Phonon

    概要

    静态函数

    详细描述

    The Phonon namespace contains classes and functions for multimedia applications.

    This namespace contains classes to access multimedia functions for audio and video playback. Those classes are not dependent on any specific framework, but rather use exchangeable backends to do the work.

    Phonon Module page for general information about the framework and the Phonon Overview for an introductory tour of its features.

    PySide.phonon.Phonon. DiscType

    Enum to identify the media discs supported by MediaObject .

    常量 描述
    Phonon.NoDisc No disc was selected. This is only useful as a return value from MediaSource::diskType().
    Phonon.Cd Identifies Audio CDs.
    Phonon.Dvd Identifies DVDs (not arbitrary data DVDs, only movie DVDs).
    Phonon.Vcd Identifies Video CDs.

    另请参阅

    MediaSource MediaObject

    PySide.phonon.Phonon. MetaData

    Provided as keys for Phonon.MediaObject.metaData() . The enum values matches strings defined in the Ogg Vorbis specification

    常量 描述
    Phonon.ArtistMetaData  
    Phonon.AlbumMetaData  
    Phonon.TitleMetaData  
    Phonon.DateMetaData  
    Phonon.GenreMetaData  
    Phonon.TracknumberMetaData  
    Phonon.DescriptionMetaData  
    Phonon.MusicBrainzDiscIdMetaData  
    PySide.phonon.Phonon. Category

    Sets the category your program should be listed in in the mixer.

    常量 描述
    Phonon.NoCategory Will make use of the default device.
    Phonon.NotificationCategory If the sounds produced are notifications (ping, beep and such) you should use this category.
    Phonon.MusicCategory If your application is a music player (like a jukebox or media player playing an audio file).
    Phonon.VideoCategory If the sound is the audio channel of a video.
    Phonon.CommunicationCategory If your applications produces sounds from communication with somebody else (VoIP, voice chat).
    Phonon.GameCategory Sound produced by a computer game should go into this category.
    Phonon.AccessibilityCategory Sounds produced for accessibility (e.g., Text-To-Speech) Holds the largest value of categories.

    A Jukebox will set this to Music, a VoIP program to Communication, a DVD player to video, and so on.

    注意

    These categories can also become useful for an application that controls the volumes automatically, like turning down the music when a call comes in, or turning down the notifications when the media player knows it's playing classical music.

    PySide.phonon.Phonon. ObjectDescriptionType

    This enum defines the type of information that is contained in a ObjectDescription 对象。

    常量 描述
    Phonon.AudioOutputDeviceType An audio output device ( AudioOutputDevice ). This can be soundcards (with different drivers), sound servers, or other virtual outputs like playback on a different computer on the network.
    Phonon.EffectType An audio effect ( EffectDescription ).
    PySide.phonon.Phonon. State

    The state enum describes the different states a media object can take. Several functions of MediaObject are asynchronous, so even if a you have requested a state change through a function call, e.g., through PySide.phonon.Phonon.MediaObject.play() , you cannot be sure that the change has taken place before you receive the PySide.phonon.Phonon.MediaObject.stateChanged() 信号。

    A media object can at any time change into any state, regardless of the state it previously had.

    常量 描述
    Phonon.LoadingState After construction it might take a while before the media object is ready to PySide.phonon.Phonon.MediaObject.play() . This state is commonly used by backends to initialize the media graph and loading the source. When the object leaves the loading state, it will enter the StoppedState unless an error occurred or another state is requested through a function call, e.g., MediaObject.play() .
    Phonon.StoppedState In the stopped state, the media object is ready to play its current media source. The current position in the media stream is then 0.
    Phonon.PlayingState The media object is playing back its media source.
    Phonon.BufferingState The Player is waiting for data to be able to start or continue playing. This state is commonly used to wait for media data over a network connection.
    Phonon.PausedState The media player has currently paused its playback, i.e., it stops playing but keeps the current playback position in the stream.
    Phonon.ErrorState When a media object enters the error state a problem with the playback has occurred. The possible errors are grouped into two categories by Phonon.ErrorType , and the type can be queried through PySide.phonon.Phonon.MediaObject.errorType() . A FatalError implies that the playback cannot continue, but one can still try with a new media source. With a NormalError it might be possible to continue playback, and a media object may therefore change state from the ErrorState .

    另请参阅

    MediaObject

    PySide.phonon.Phonon. ErrorType

    This enum describes the severity when an error has occurred during playback.

    After a media object has entered the ErrorState , one can query the type of error from MediaObject.errorType() . Note that you should query the error when receiving the MediaObject.stateChanged() signal, because the error type will be lost if the media object leaves the error state.

    常量 描述
    Phonon.NoError No error. MediaObject.errorType() returns this if MediaObject.state() != Phonon.ErrorState .
    Phonon.NormalError An error has occurred with the playback of the current source. It might be possible to continue playback, for instance, if only the audio stream in a video cannot be played back. The media object will then leave the error state again.
    Phonon.FatalError . Something important does not work. Your program cannot continue the playback of the current source, but it might be possible to try another.

    另请参阅

    MediaObject.errorType()

    static PySide.phonon.Phonon. categoryToString ( c )
    参数: c PySide.phonon.Phonon.Category
    返回类型: unicode

    Returns a (translated) string to show to the user identifying the given Category ( c ).

    static PySide.phonon.Phonon. createPath ( source , sink )
    参数:
    • source PySide.phonon.Phonon::MediaNode
    • sink PySide.phonon.Phonon::MediaNode
    返回类型:

    PySide.phonon.Phonon::Path

    Creates a new Path connecting the two MediaNodes source and sink .

    The implementation will automatically select the right format and media type. E.g. connecting a MediaObject and AudioOutput will create a Path object connecting the audio. This might be represented as PCM or perhaps even AC3 depending on the AudioOutput 对象。

    source MediaNode to connect an output from sink MediaNode to connect to.

    static PySide.phonon.Phonon. createPlayer ( category [ , source=Phonon.MediaSource() ] )
    参数:
    返回类型:

    PySide.phonon.Phonon::MediaObject

    static PySide.phonon.Phonon. phononVersion ( )
    返回类型: str

    Returns the Phonon version.

    static PySide.phonon.Phonon. qHash ( param )
    参数: param PySide.phonon.Phonon::EffectParameter
    返回类型: PySide.QtCore.uint