MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

QAudioEncoderSettings Class Reference

The QAudioEncoderSettings class provides a set of audio encoder settings. More...

 #include <QAudioEncoderSettings>

This class was introduced in Qt Mobility 1.0.

Public Functions

QAudioEncoderSettings ()
QAudioEncoderSettings ( const QAudioEncoderSettings & other )
~QAudioEncoderSettings ()
int bitRate () const
int channelCount () const
QString codec () const
QtMultimediaKit::EncodingMode encodingMode () const
bool isNull () const
QtMultimediaKit::EncodingQuality quality () const
int sampleRate () const
void setBitRate ( int rate )
void setChannelCount ( int channels )
void setCodec ( const QString & codec )
void setEncodingMode ( QtMultimediaKit::EncodingMode mode )
void setQuality ( QtMultimediaKit::EncodingQuality quality )
void setSampleRate ( int rate )
bool operator!= ( const QAudioEncoderSettings & other ) const
QAudioEncoderSettings & operator= ( const QAudioEncoderSettings & other )
bool operator== ( const QAudioEncoderSettings & other ) const

Detailed Description

The QAudioEncoderSettings class provides a set of audio encoder settings.

A audio encoder settings object is used to specify the audio encoder settings used by QMediaRecorder. Audio encoder settings are selected by constructing a QAudioEncoderSettings object, setting the desired properties and then passing it to a QMediaRecorder instance using the QMediaRecorder::setEncodingSettings() function.

 QAudioEncoderSettings audioSettings;
 audioSettings.setCodec("audio/mpeg");
 audioSettings.setChannelCount(2);

 recorder->setEncodingSettings(audioSettings);

See also QMediaRecorder and QAudioEncoderControl.

Member Function Documentation

QAudioEncoderSettings::QAudioEncoderSettings ()

Construct a null audio encoder settings object.

QAudioEncoderSettings::QAudioEncoderSettings ( const QAudioEncoderSettings & other )

Constructs a copy of the audio encoder settings object other.

This function was introduced in Qt Mobility 1.0.

QAudioEncoderSettings::~QAudioEncoderSettings ()

Destroys an audio encoder settings object.

int QAudioEncoderSettings::bitRate () const

Returns the bit rate of the compressed audio stream in bits per second.

This function was introduced in Qt Mobility 1.0.

See also setBitRate().

int QAudioEncoderSettings::channelCount () const

Returns the number of audio channels.

This function was introduced in Qt Mobility 1.0.

See also setChannelCount().

QString QAudioEncoderSettings::codec () const

Returns the audio codec.

This function was introduced in Qt Mobility 1.0.

See also setCodec().

QtMultimediaKit::EncodingMode QAudioEncoderSettings::encodingMode () const

Returns the audio encoding mode.

This function was introduced in Qt Mobility 1.0.

See also setEncodingMode() and QtMultimediaKit::EncodingMode.

bool QAudioEncoderSettings::isNull () const

Identifies if an audio settings object is initialized.

Returns true if the settings object is null, and false if it is not.

This function was introduced in Qt Mobility 1.0.

QtMultimediaKit::EncodingQuality QAudioEncoderSettings::quality () const

Returns the audio encoding quality.

This function was introduced in Qt Mobility 1.0.

See also setQuality().

int QAudioEncoderSettings::sampleRate () const

Returns the audio sample rate in Hz.

This function was introduced in Qt Mobility 1.0.

See also setSampleRate().

void QAudioEncoderSettings::setBitRate ( int rate )

Sets the audio bit rate in bits per second.

This function was introduced in Qt Mobility 1.0.

See also bitRate().

void QAudioEncoderSettings::setChannelCount ( int channels )

Sets the number of audio channels.

A value of -1 indicates the encoder should make an optimal choice based on what is available from the audio source and the limitations of the codec.

This function was introduced in Qt Mobility 1.0.

See also channelCount().

void QAudioEncoderSettings::setCodec ( const QString & codec )

Sets the audio codec.

This function was introduced in Qt Mobility 1.0.

See also codec().

void QAudioEncoderSettings::setEncodingMode ( QtMultimediaKit::EncodingMode mode )

Sets the audio encoding mode setting.

If QtMultimediaKit::ConstantQualityEncoding is set, the quality encoding parameter is used and bit rate is ignored, otherwise the bitrate is used.

The audio codec, channels count and sample rate settings are used in all the encoding modes.

This function was introduced in Qt Mobility 1.0.

See also encodingMode() and QtMultimediaKit::EncodingMode.

void QAudioEncoderSettings::setQuality ( QtMultimediaKit::EncodingQuality quality )

Set the audio encoding quality.

Setting the audio quality parameter allows backend to choose the balanced set of encoding parameters to achieve the desired quality level.

The quality settings parameter is only used in the constant quality encoding mode.

This function was introduced in Qt Mobility 1.0.

See also quality().

void QAudioEncoderSettings::setSampleRate ( int rate )

Sets the audio sample rate in Hz.

A value of -1 indicates the encoder should make an optimal choice based on what is avaialbe from the audio source and the limitations of the codec.

This function was introduced in Qt Mobility 1.0.

See also sampleRate().

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

Determines if other is of equal value to an audio encoder settings object.

Returns true if the settings objects are not of equal value, and true if they are of equal value.

This function was introduced in Qt Mobility 1.0.

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

Assigns the value of other to an audio encoder settings object.

This function was introduced in Qt Mobility 1.0.

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

Determines if other is of equal value to an audio encoder settings object.

Returns true if the settings objects are of equal value, and false if they are not of equal value.

This function was introduced in Qt Mobility 1.0.