QAudioDecoderControl

The QAudioDecoderControl class provides access to the audio decoding functionality of a QMediaService . More

Inheritance diagram of PySide2.QtMultimedia.QAudioDecoderControl

Detailed Description

The functionality provided by this control is exposed to application code through the QAudioDecoder class.

The interface name of QAudioDecoderControl is org.qt-project.qt.audiodecodercontrol/5.0 as defined in QAudioDecoderControl_iid .

class QAudioDecoderControl([parent=None])
param parent

QObject

Constructs a new audio decoder control with the given parent .

PySide2.QtMultimedia.QAudioDecoderControl.audioFormat()
Return type

QAudioFormat

Returns the current audio format of the decoded stream.

Any buffers returned should have this format.

PySide2.QtMultimedia.QAudioDecoderControl.bufferAvailable()
Return type

bool

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

PySide2.QtMultimedia.QAudioDecoderControl.bufferAvailableChanged(available)
Parameters

availablebool

PySide2.QtMultimedia.QAudioDecoderControl.bufferReady()
PySide2.QtMultimedia.QAudioDecoderControl.duration()
Return type

qint64

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

PySide2.QtMultimedia.QAudioDecoderControl.durationChanged(duration)
Parameters

durationqint64

PySide2.QtMultimedia.QAudioDecoderControl.error(error, errorString)
Parameters
  • errorint

  • errorString – unicode

PySide2.QtMultimedia.QAudioDecoderControl.finished()
PySide2.QtMultimedia.QAudioDecoderControl.formatChanged(format)
Parameters

formatQAudioFormat

PySide2.QtMultimedia.QAudioDecoderControl.position()
Return type

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)
Parameters

positionqint64

PySide2.QtMultimedia.QAudioDecoderControl.read()
Return type

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)
Parameters

formatQAudioFormat

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 .

See also

audioFormat()

PySide2.QtMultimedia.QAudioDecoderControl.setSourceDevice(device)
Parameters

deviceQIODevice

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.

See also

sourceDevice()

PySide2.QtMultimedia.QAudioDecoderControl.setSourceFilename(fileName)
Parameters

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.

See also

sourceFilename()

PySide2.QtMultimedia.QAudioDecoderControl.sourceChanged()
PySide2.QtMultimedia.QAudioDecoderControl.sourceDevice()
Return type

QIODevice

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

PySide2.QtMultimedia.QAudioDecoderControl.sourceFilename()
Return type

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.

See also

state() read()

PySide2.QtMultimedia.QAudioDecoderControl.state()
Return type

State

Returns the state of a player control.

PySide2.QtMultimedia.QAudioDecoderControl.stateChanged(newState)
Parameters

newStateState

PySide2.QtMultimedia.QAudioDecoderControl.stop()

Stops playback of the current media and discards any buffers.

If successful the player control will immediately enter the stopped state.