Table Of Contents

Previous topic

QAudioDeviceInfo

Next topic

QVideoFrame

QAudioFormat

Synopsis

Functions

Detailed Description

The PySide.QtMultimedia.QAudioFormat class stores audio parameter information.

An audio format specifies how data in an audio stream is arranged, i.e, how the stream is to be interpreted. The encoding itself is specified by the PySide.QtMultimedia.QAudioFormat.codec() used for the stream.

In addition to the encoding, PySide.QtMultimedia.QAudioFormat contains other parameters that further specify how the audio data is arranged. These are the frequency, the number of channels, the sample size, the sample type, and the byte order. The following table describes these in more detail.

Parameter Description
Sample Rate Samples per second of audio data in Hertz.
Number of channels The number of audio channels (typically one for mono or two for stereo)
Sample size How much data is stored in each sample (typically 8 or 16 bits)
Sample type Numerical representation of sample (typically signed integer, unsigned integer or float)
Byte order Byte ordering of sample (typically little endian, big endian)

You can obtain audio formats compatible with the audio device used through functions in PySide.QtMultimedia.QAudioDeviceInfo . This class also lets you query available parameter values for a device, so that you can set the parameters yourself. See the PySide.QtMultimedia.QAudioDeviceInfo class description for details. You need to know the format of the audio streams you wish to play. Qt does not set up formats for you.

class PySide.QtMultimedia.QAudioFormat
class PySide.QtMultimedia.QAudioFormat(other)
Parameters:otherPySide.QtMultimedia.QAudioFormat

Construct a new audio format.

Values are initialized as follows:

Construct a new audio format using other .

PySide.QtMultimedia.QAudioFormat.SampleType
Constant Description
QAudioFormat.Unknown Not Set
QAudioFormat.SignedInt samples are signed integers
QAudioFormat.UnSignedInt samples are unsigned intergers
QAudioFormat.Float samples are floats
PySide.QtMultimedia.QAudioFormat.Endian
Constant Description
QAudioFormat.BigEndian samples are big endian byte order
QAudioFormat.LittleEndian samples are little endian byte order
PySide.QtMultimedia.QAudioFormat.byteOrder()
Return type:PySide.QtMultimedia.QAudioFormat.Endian

Returns the current byteOrder value.

PySide.QtMultimedia.QAudioFormat.channelCount()
Return type:PySide.QtCore.int

Returns the current channel count value.

PySide.QtMultimedia.QAudioFormat.channels()
Return type:PySide.QtCore.int

Use PySide.QtMultimedia.QAudioFormat.channelCount() instead.

PySide.QtMultimedia.QAudioFormat.codec()
Return type:unicode

Returns the current codec value.

PySide.QtMultimedia.QAudioFormat.frequency()
Return type:PySide.QtCore.int

Use PySide.QtMultimedia.QAudioFormat.sampleRate() instead.

PySide.QtMultimedia.QAudioFormat.isValid()
Return type:PySide.QtCore.bool

Returns true if all of the parameters are valid.

PySide.QtMultimedia.QAudioFormat.__ne__(other)
Parameters:otherPySide.QtMultimedia.QAudioFormat
Return type:PySide.QtCore.bool

Returns true if this PySide.QtMultimedia.QAudioFormat is not equal to the otherPySide.QtMultimedia.QAudioFormat ; otherwise returns false.

All elements of PySide.QtMultimedia.QAudioFormat are used for the comparison.

PySide.QtMultimedia.QAudioFormat.__eq__(other)
Parameters:otherPySide.QtMultimedia.QAudioFormat
Return type:PySide.QtCore.bool

Returns true if this PySide.QtMultimedia.QAudioFormat is equal to the otherPySide.QtMultimedia.QAudioFormat ; otherwise returns false.

All elements of PySide.QtMultimedia.QAudioFormat are used for the comparison.

PySide.QtMultimedia.QAudioFormat.sampleRate()
Return type:PySide.QtCore.int

Returns the current sample rate in Hertz.

PySide.QtMultimedia.QAudioFormat.sampleSize()
Return type:PySide.QtCore.int

Returns the current sample size value.

PySide.QtMultimedia.QAudioFormat.sampleType()
Return type:PySide.QtMultimedia.QAudioFormat.SampleType

Returns the current QAudioFormat.SampleType value.

PySide.QtMultimedia.QAudioFormat.setByteOrder(byteOrder)
Parameters:byteOrderPySide.QtMultimedia.QAudioFormat.Endian
PySide.QtMultimedia.QAudioFormat.setChannelCount(channelCount)
Parameters:channelCountPySide.QtCore.int

Sets the channel count to channels .

PySide.QtMultimedia.QAudioFormat.setChannels(channels)
Parameters:channelsPySide.QtCore.int

Use PySide.QtMultimedia.QAudioFormat.setChannelCount() instead.

PySide.QtMultimedia.QAudioFormat.setCodec(codec)
Parameters:codec – unicode

Sets the codec to codec .

PySide.QtMultimedia.QAudioFormat.setFrequency(frequency)
Parameters:frequencyPySide.QtCore.int

Use PySide.QtMultimedia.QAudioFormat.setSampleRate() instead.

PySide.QtMultimedia.QAudioFormat.setSampleRate(sampleRate)
Parameters:sampleRatePySide.QtCore.int

Sets the sample rate to samplerate Hertz.

PySide.QtMultimedia.QAudioFormat.setSampleSize(sampleSize)
Parameters:sampleSizePySide.QtCore.int

Sets the sample size to the sampleSize specified.

PySide.QtMultimedia.QAudioFormat.setSampleType(sampleType)
Parameters:sampleTypePySide.QtMultimedia.QAudioFormat.SampleType