QAudioFormat ClassThe QAudioFormat class stores audio stream parameter information. More... #include <QAudioFormat>
Public Types
Public Functions
Detailed DescriptionThe QAudioFormat class stores audio stream 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 codec() used for the stream. In addition to the encoding, QAudioFormat contains other parameters that further specify how the audio sample 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.
This class is typically used in conjunction with QAudioInput or QAudioOutput to allow you to specify the parameters of the audio stream being read or written. 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 or record. Member Type Documentation
|
Constant | Value | Description |
---|---|---|
QAudioFormat::BigEndian | QSysInfo::BigEndian | Samples are big endian byte order |
QAudioFormat::LittleEndian | QSysInfo::LittleEndian | Samples are little endian byte order |
Constant | Value | Description |
---|---|---|
QAudioFormat::Unknown | 0 | Not Set |
QAudioFormat::SignedInt | 1 | Samples are signed integers |
QAudioFormat::UnSignedInt | 2 | Samples are unsigned intergers |
QAudioFormat::Float | 3 | Samples are floats |
Construct a new audio format.
Values are initialized as follows:
Construct a new audio format using other.
Destroy this audio format.
Returns the current byteOrder value.
See also setByteOrder().
Returns the current channel count value.
See also setChannelCount().
Returns the current codec identifier.
See also setCodec() and QAudioDeviceInfo::supportedCodecs().
Returns true if all of the parameters are valid.
Returns the current sample rate in Hertz.
See also setSampleRate().
Returns the current sample size value, in bits.
See also setSampleSize().
Returns the current SampleType value.
See also setSampleType().
Sets the byteOrder to byteOrder.
See also byteOrder().
Sets the channel count to channels.
See also channelCount().
Sets the codec to codec.
The parameter to this function should be one of the types reported by the QAudioDeviceInfo::supportedCodecs() function for the audio device you are working with.
See also codec() and QAudioDeviceInfo::supportedCodecs().
Sets the sample rate to samplerate Hertz.
See also sampleRate().
Sets the sample size to the sampleSize specified, in bits.
This is typically 8 or 16, but some systems may support higher sample sizes.
See also sampleSize().
Sets the sampleType to sampleType.
See also sampleType().
Returns true if this QAudioFormat is not equal to the other QAudioFormat; otherwise returns false.
All elements of QAudioFormat are used for the comparison.
Assigns other to this QAudioFormat implementation.
Returns true if this QAudioFormat is equal to the other QAudioFormat; otherwise returns false.
All elements of QAudioFormat are used for the comparison.