| 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) |
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.
| Parameter: | other – 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: | Endian |
|---|
Returns the current byteOrder value.
See also
| Return type: | int |
|---|
Returns the current channel value.
See also
| Return type: | QString |
|---|
Returns the current codec value.
| Return type: | int |
|---|
Returns the current frequency value.
See also
| Return type: | bool |
|---|
Returns true if all of the parameters are valid.
| 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.
| Parameter: | other – QAudioFormat |
|---|---|
| Return type: | QAudioFormat |
Assigns other to this QAudioFormat implementation.
| 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.
| Return type: | int |
|---|
Returns the current sample size value.
See also
| Return type: | SampleType |
|---|
Returns the current QAudioFormat.SampleType value.
See also
| Parameter: | byteOrder – Endian |
|---|
| Parameter: | channels – int |
|---|
Sets the channels to channels .
See also
| Parameter: | codec – QString |
|---|
Sets the codec to codec .
| Parameter: | frequency – int |
|---|
Sets the frequency to frequency .
See also
| Parameter: | sampleSize – int |
|---|
Sets the sample size to the sampleSize specified.
See also
| Parameter: | sampleType – SampleType |
|---|