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.
Parameters: | other – PySide.QtMultimedia.QAudioFormat |
---|
Construct a new audio format.
Values are initialized as follows:
Construct a new audio format using other .
Constant | Description |
---|---|
QAudioFormat.Unknown | Not Set |
QAudioFormat.SignedInt | samples are signed integers |
QAudioFormat.UnSignedInt | samples are unsigned intergers |
QAudioFormat.Float | samples are floats |
Constant | Description |
---|---|
QAudioFormat.BigEndian | samples are big endian byte order |
QAudioFormat.LittleEndian | samples are little endian byte order |
Return type: | PySide.QtMultimedia.QAudioFormat.Endian |
---|
Returns the current byteOrder value.
Return type: | PySide.QtCore.int |
---|
Returns the current channel count value.
Return type: | PySide.QtCore.int |
---|
Use PySide.QtMultimedia.QAudioFormat.channelCount() instead.
Return type: | unicode |
---|
Returns the current codec value.
Return type: | PySide.QtCore.int |
---|
Use PySide.QtMultimedia.QAudioFormat.sampleRate() instead.
Return type: | PySide.QtCore.bool |
---|
Returns true if all of the parameters are valid.
Parameters: | other – PySide.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.
Parameters: | other – PySide.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.
Return type: | PySide.QtCore.int |
---|
Returns the current sample rate in Hertz.
Return type: | PySide.QtCore.int |
---|
Returns the current sample size value.
Return type: | PySide.QtMultimedia.QAudioFormat.SampleType |
---|
Returns the current QAudioFormat.SampleType value.
Parameters: | byteOrder – PySide.QtMultimedia.QAudioFormat.Endian |
---|
Parameters: | channelCount – PySide.QtCore.int |
---|
Sets the channel count to channels .
Parameters: | channels – PySide.QtCore.int |
---|
Use PySide.QtMultimedia.QAudioFormat.setChannelCount() instead.
Parameters: | codec – unicode |
---|
Sets the codec to codec .
Parameters: | frequency – PySide.QtCore.int |
---|
Use PySide.QtMultimedia.QAudioFormat.setSampleRate() instead.
Parameters: | sampleRate – PySide.QtCore.int |
---|
Sets the sample rate to samplerate Hertz.
Parameters: | sampleSize – PySide.QtCore.int |
---|
Sets the sample size to the sampleSize specified.
Parameters: | sampleType – PySide.QtMultimedia.QAudioFormat.SampleType |
---|