QAudioDecoderControlclass provides access to the audio decoding functionality of aQMediaService. 更多 …
The functionality provided by this control is exposed to application code through the
QAudioDecoder类。The interface name of
QAudioDecoderControlisorg.qt-project.qt.audiodecodercontrol/5.0作为定义在QAudioDecoderControl_iid.
QAudioDecoderControl
(
[
parent=None
]
)
¶
- param parent
QObject
Constructs a new audio decoder control with the given
parent
.
PySide2.QtMultimedia.QAudioDecoderControl.
audioFormat
(
)
¶
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
(
)
¶
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
.
另请参阅
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.
另请参阅
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.
另请参阅
PySide2.QtMultimedia.QAudioDecoderControl.
sourceChanged
(
)
¶
PySide2.QtMultimedia.QAudioDecoderControl.
sourceDevice
(
)
¶
QIODevice
Returns the current media source
QIODevice
, or 0 if none (or a file).
另请参阅
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
状态。
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
状态。