Add some recent things to the overview docs.
Also clean up a few other doc related bits and pieces. Change-Id: I56714e1811e38a7225131c1d141430b49f5f509c Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
c77e442b99
commit
db781f29e0
@@ -47,6 +47,11 @@
|
||||
#include "qaudiodeviceinfo.h"
|
||||
#include "qaudioinput.h"
|
||||
#include "qaudiooutput.h"
|
||||
#include "qaudioprobe.h"
|
||||
|
||||
//! [Audio decoder header]
|
||||
#include "qaudiodecoder_p.h"
|
||||
//! [Audio decoder header]
|
||||
|
||||
class AudioInputExample : public QObject {
|
||||
Q_OBJECT
|
||||
@@ -208,3 +213,34 @@ void AudioDeviceInfo()
|
||||
qDebug() << "Device name: " << deviceInfo.deviceName();
|
||||
//! [Dumping audio formats]
|
||||
}
|
||||
|
||||
class AudioDecodingExample : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
void decode();
|
||||
|
||||
public Q_SLOTS:
|
||||
void stateChanged(QAudio::State newState);
|
||||
void readBuffer();
|
||||
};
|
||||
|
||||
void AudioDecodingExample::decode()
|
||||
{
|
||||
//! [Local audio decoding]
|
||||
QAudioFormat desiredFormat;
|
||||
desiredFormat.setChannelCount(2);
|
||||
desiredFormat.setCodec("audio/x-raw");
|
||||
desiredFormat.setSampleType(QAudioFormat::UnSignedInt);
|
||||
desiredFormat.setSampleRate(48000);
|
||||
desiredFormat.setSampleSize(16);
|
||||
|
||||
QAudioDecoder *decoder = new QAudioDecoder(this);
|
||||
decoder->setAudioFormat(desiredFormat);
|
||||
decoder->setSourceFilename("level1.mp3");
|
||||
|
||||
connect(decoder, SIGNAL(bufferReady()), this, SLOT(readBuffer()));
|
||||
decoder->start();
|
||||
|
||||
// Now wait for bufferReady() signal and call decoder->read()
|
||||
//! [Local audio decoding]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user