QAudioFormat

Inheritance diagram of QAudioFormat

Synopsis

Functions

def __eq__ (other)
def __ne__ (other)
def byteOrder ()
def channels ()
def codec ()
def frequency ()
def isValid ()
def operator= (other)
def sampleSize ()
def sampleType ()
def setByteOrder (byteOrder)
def setChannels (channels)
def setCodec (codec)
def setFrequency (frequency)
def setSampleSize (sampleSize)
def setSampleType (sampleType)

Detailed Description

The 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 QAudioFormat.codec() used for the stream.

In addition to the encoding, 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
Frequency 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 QAudioDeviceInfo . This class also lets you query available parameter values for a device, so that you can set the parameters yourself. See the 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)
Parameter:other – QAudioFormat

Construct a new audio format.

Values are initialized as follows:

Construct a new audio format using other .

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
QAudioFormat.Endian
Constant Description
QAudioFormat.BigEndian samples are big endian byte order
QAudioFormat.LittleEndian samples are little endian byte order
QAudioFormat.byteOrder()
Return type:Endian

Returns the current byteOrder value.

QAudioFormat.channels()
Return type:int

Returns the current channel value.

QAudioFormat.codec()
Return type:QString

Returns the current codec value.

QAudioFormat.frequency()
Return type:int

Returns the current frequency value.

QAudioFormat.isValid()
Return type:bool

Returns true if all of the parameters are valid.

QAudioFormat.__ne__(other)
Parameter:other – QAudioFormat
Return type:bool

Returns true if this QAudioFormat is not equal to the otherQAudioFormat ; otherwise returns false.

All elements of QAudioFormat are used for the comparison.

QAudioFormat.operator=(other)
Parameter:other – QAudioFormat
Return type:QAudioFormat

Assigns other to this QAudioFormat implementation.

QAudioFormat.__eq__(other)
Parameter:other – QAudioFormat
Return type:bool

Returns true if this QAudioFormat is equal to the otherQAudioFormat ; otherwise returns false.

All elements of QAudioFormat are used for the comparison.

QAudioFormat.sampleSize()
Return type:int

Returns the current sample size value.

QAudioFormat.sampleType()
Return type:SampleType

Returns the current QAudioFormat.SampleType value.

QAudioFormat.setByteOrder(byteOrder)
Parameter:byteOrder – Endian
QAudioFormat.setChannels(channels)
Parameter:channels – int

Sets the channels to channels .

QAudioFormat.setCodec(codec)
Parameter:codec – QString

Sets the codec to codec .

QAudioFormat.setFrequency(frequency)
Parameter:frequency – int

Sets the frequency to frequency .

QAudioFormat.setSampleSize(sampleSize)
Parameter:sampleSize – int

Sets the sample size to the sampleSize specified.

QAudioFormat.setSampleType(sampleType)
Parameter:sampleType – SampleType