内容表

上一话题

QAudioDecoder

下一话题

QAudioDeviceInfo

QAudioDecoderControl

QAudioDecoderControl class provides access to the audio decoding functionality of a QMediaService . 更多

Inheritance diagram of PySide2.QtMultimedia.QAudioDecoderControl

详细描述

The functionality provided by this control is exposed to application code through the QAudioDecoder 类。

The interface name of QAudioDecoderControl is org.qt-project.qt.audiodecodercontrol/5.0 作为定义在 QAudioDecoderControl_iid .

class QAudioDecoderControl ( [ parent=None ] )
param parent

QObject

Constructs a new audio decoder control with the given parent .

PySide2.QtMultimedia.QAudioDecoderControl. audioFormat ( )
返回类型

QAudioFormat

Returns the current audio format of the decoded stream.

Any buffers returned should have this format.

PySide2.QtMultimedia.QAudioDecoderControl. bufferAvailable ( )
返回类型

bool

Returns true if a buffer is available to be read, and false otherwise.

PySide2.QtMultimedia.QAudioDecoderControl. bufferAvailableChanged ( available )
参数

available bool

PySide2.QtMultimedia.QAudioDecoderControl. bufferReady ( )
PySide2.QtMultimedia.QAudioDecoderControl. duration ( )
返回类型

qint64

Returns total duration (in milliseconds) of the audio stream or -1 if not available.

PySide2.QtMultimedia.QAudioDecoderControl. durationChanged ( duration )
参数

duration qint64

PySide2.QtMultimedia.QAudioDecoderControl. error ( error , errorString )
参数
  • error int

  • errorString – unicode

PySide2.QtMultimedia.QAudioDecoderControl. finished ( )
PySide2.QtMultimedia.QAudioDecoderControl. formatChanged ( format )
参数

format QAudioFormat

PySide2.QtMultimedia.QAudioDecoderControl. position ( )
返回类型

qint64

Returns position (in milliseconds) of the last buffer read from the decoder or -1 if no buffers have been read.

PySide2.QtMultimedia.QAudioDecoderControl. positionChanged ( position )
参数

position qint64

PySide2.QtMultimedia.QAudioDecoderControl. read ( )
返回类型

QAudioBuffer

Attempts to read a buffer from the decoder, without blocking. Returns invalid buffer if there are no decoded buffers available, or on error.

PySide2.QtMultimedia.QAudioDecoderControl. setAudioFormat ( format )
参数

format QAudioFormat

Set the desired audio format for decoded samples to format .

If the decoder does not support this format, error() will be set to FormatError .

If you do not specify a format, the format of the decoded audio itself will be used. Otherwise, some format conversion will be applied.

If you wish to reset the decoded format to that of the original audio file, you can specify an invalid format .

另请参阅

audioFormat()

PySide2.QtMultimedia.QAudioDecoderControl. setSourceDevice ( device )
参数

device QIODevice

Sets the current source to device . Changing the source will stop any current decoding and discard any buffers.

Sources are exclusive, so only one can be set.

另请参阅

sourceDevice()

PySide2.QtMultimedia.QAudioDecoderControl. setSourceFilename ( fileName )
参数

fileName – unicode

Sets the current source to fileName . Changing the source will stop any current decoding and discard any buffers.

Sources are exclusive, so only one can be set.

另请参阅

sourceFilename()

PySide2.QtMultimedia.QAudioDecoderControl. sourceChanged ( )
PySide2.QtMultimedia.QAudioDecoderControl. sourceDevice ( )
返回类型

QIODevice

Returns the current media source QIODevice , or 0 if none (or a file).

另请参阅

setSourceDevice()

PySide2.QtMultimedia.QAudioDecoderControl. sourceFilename ( )
返回类型

unicode

Returns the current media source filename, or a null QString if none (or a device)

PySide2.QtMultimedia.QAudioDecoderControl. start ( )

Starts decoding the current media.

If successful the player control will immediately enter the decoding 状态。

另请参阅

state() read()

PySide2.QtMultimedia.QAudioDecoderControl. state ( )
返回类型

State

Returns the state of a player control.

PySide2.QtMultimedia.QAudioDecoderControl. stateChanged ( newState )
参数

newState State

PySide2.QtMultimedia.QAudioDecoderControl. stop ( )

Stops playback of the current media and discards any buffers.

If successful the player control will immediately enter the stopped 状态。