Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QAudioFormat Class Reference

The QAudioFormat class stores audio parameter information. More...

 #include <QAudioFormat>

This class was introduced in Qt 4.6.

Public Types

enum Endian { BigEndian, LittleEndian }
enum SampleType { Unknown, SignedInt, UnSignedInt, Float }

Public Functions

QAudioFormat ()
QAudioFormat ( const QAudioFormat & other )
~QAudioFormat ()
QAudioFormat::Endian byteOrder () const
int channelCount () const
QString codec () const
bool isValid () const
int sampleRate () const
int sampleSize () const
QAudioFormat::SampleType sampleType () const
void setByteOrder ( QAudioFormat::Endian byteOrder )
void setChannelCount ( int channels )
void setCodec ( const QString & codec )
void setSampleRate ( int samplerate )
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

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 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.

ParameterDescription
Sample RateSamples per second of audio data in Hertz.
Number of channelsThe number of audio channels (typically one for mono or two for stereo)
Sample sizeHow much data is stored in each sample (typically 8 or 16 bits)
Sample typeNumerical representation of sample (typically signed integer, unsigned integer or float)
Byte orderByte 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.

Member Type Documentation

enum QAudioFormat::Endian

ConstantValueDescription
QAudioFormat::BigEndianQSysInfo::BigEndiansamples are big endian byte order
QAudioFormat::LittleEndianQSysInfo::LittleEndiansamples are little endian byte order

enum QAudioFormat::SampleType

ConstantValueDescription
QAudioFormat::Unknown0Not Set
QAudioFormat::SignedInt1samples are signed integers
QAudioFormat::UnSignedInt2samples are unsigned intergers
QAudioFormat::Float3samples are floats

Member Function Documentation

QAudioFormat::QAudioFormat ()

Construct a new audio format.

Values are initialized as follows:

QAudioFormat::QAudioFormat ( const QAudioFormat & other )

Construct a new audio format using other.

QAudioFormat::~QAudioFormat ()

Destroy this audio format.

QAudioFormat::Endian QAudioFormat::byteOrder () const

Returns the current byteOrder value.

See also setByteOrder().

int QAudioFormat::channelCount () const

Returns the current channel count value.

This function was introduced in Qt 4.7.

See also setChannelCount().

QString QAudioFormat::codec () const

Returns the current codec value.

See also setCodec() and QAudioDeviceInfo::supportedCodecs().

bool QAudioFormat::isValid () const

Returns true if all of the parameters are valid.

int QAudioFormat::sampleRate () const

Returns the current sample rate in Hertz.

This function was introduced in Qt 4.7.

See also setSampleRate().

int QAudioFormat::sampleSize () const

Returns the current sample size value.

See also setSampleSize().

QAudioFormat::SampleType QAudioFormat::sampleType () const

Returns the current SampleType value.

See also setSampleType().

void QAudioFormat::setByteOrder ( QAudioFormat::Endian byteOrder )

Sets the byteOrder to byteOrder.

See also byteOrder().

void QAudioFormat::setChannelCount ( int channels )

Sets the channel count to channels.

This function was introduced in Qt 4.7.

See also channelCount().

void QAudioFormat::setCodec ( const QString & codec )

Sets the codec to codec.

See also codec() and QAudioDeviceInfo::supportedCodecs().

void QAudioFormat::setSampleRate ( int samplerate )

Sets the sample rate to samplerate Hertz.

This function was introduced in Qt 4.7.

See also sampleRate().

void QAudioFormat::setSampleSize ( int sampleSize )

Sets the sample size to the sampleSize specified.

See also sampleSize().

void QAudioFormat::setSampleType ( QAudioFormat::SampleType sampleType )

Sets the sampleType to sampleType.

See also sampleType().

bool QAudioFormat::operator!= ( const QAudioFormat & other ) const

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

All elements of QAudioFormat are used for the comparison.

QAudioFormat & QAudioFormat::operator= ( const QAudioFormat & other )

Assigns other to this QAudioFormat implementation.

bool QAudioFormat::operator== ( const QAudioFormat & other ) const

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

All elements of QAudioFormat are used for the comparison.

Publicit�

Best Of

Actualit�s les plus lues

Semaine
Mois
Ann�e
  1. � Quelque chose ne va vraiment pas avec les d�veloppeurs "modernes" �, un d�veloppeur � "l'ancienne" critique la multiplication des biblioth�ques 53
  2. Les d�veloppeurs ignorent-ils trop les failles d�couvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  3. BlackBerry 10 : premi�res images du prochain OS de RIM qui devrait int�grer des widgets et des tuiles inspir�es de Windows Phone 0
  4. Apercevoir la troisi�me dimension ou l'utilisation multithread�e d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  5. Quelles nouveaut�s de C++11 Visual C++ doit-il rapidement int�grer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil d�claratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le blog Digia au hasard

Logo

D�ploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privil�gi� pour la communication sur l'�dition commerciale de Qt, o� des r�ponses publiques sont apport�es aux questions les plus pos�es au support. Lire l'article.

Communaut�

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la r�daction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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.7
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 !
 
 
 
 
Partenaires

H�bergement Web