QAudioFormat Class Reference |
enum | Endian { BigEndian, LittleEndian } |
enum | SampleType { Unknown, SignedInt, UnSignedInt, Float } |
QAudioFormat () | |
QAudioFormat ( const QAudioFormat & other ) | |
~QAudioFormat () | |
QAudioFormat::Endian | byteOrder () const |
int | channels () const |
QString | codec () const |
int | frequency () const |
bool | isValid () const |
int | sampleSize () const |
QAudioFormat::SampleType | sampleType () const |
void | setByteOrder ( QAudioFormat::Endian byteOrder ) |
void | setChannels ( int channels ) |
void | setCodec ( const QString & codec ) |
void | setFrequency ( int frequency ) |
void | setSampleSize ( int sampleSize ) |
void | setSampleType ( QAudioFormat::SampleType sampleType ) |
bool | operator!= ( const QAudioFormat & other ) const |
QAudioFormat & | operator= ( const QAudioFormat & other ) |
bool | operator== ( const QAudioFormat & other ) const |
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 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.
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 value.
See also setChannels().
Returns the current codec value.
See also setCodec() and QAudioDeviceInfo::supportedCodecs().
Returns the current frequency value.
See also setFrequency().
Returns true if all of the parameters are valid.
Returns the current sample size value.
See also setSampleSize().
Returns the current SampleType value.
See also setSampleType().
Sets the byteOrder to byteOrder.
See also byteOrder().
Sets the channels to channels.
See also channels().
Sets the codec to codec.
See also codec() and QAudioDeviceInfo::supportedCodecs().
Sets the frequency to frequency.
See also frequency().
Sets the sample size to the sampleSize specified.
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.
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.6-snapshot | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com