#include <audiodataoutput.h>
This class gives you the audio data (for visualizations).
This class implements a special AbstractAudioOutput that gives your application the audio data. Don't expect realtime performance. But the latencies should be low enough to use the audio data for visualizations. You can also use the audio data for further processing (e.g. encoding and saving to a file).
Definition at line 52 of file audiodataoutput.h.
Public Types | |
enum | Channel { LeftChannel, RightChannel, CenterChannel, LeftSurroundChannel, RightSurroundChannel, SubwooferChannel } |
Specifies the channel the audio data belongs to. More... | |
Public Slots | |
void | setDataSize (int size) |
Sets the number of samples to be passed in one signal emission. More... | |
![]() | |
void | deleteLater () |
Signals | |
void | dataReady (const QMap< Phonon::AudioDataOutput::Channel, QVector< qint16 > > &data) |
Emitted whenever another dataSize number of samples are ready. More... | |
void | endOfMedia (int remainingSamples) |
This signal is emitted before the last dataReady signal of a media is emitted. More... | |
![]() | |
void | destroyed (QObject *=0) |
Public Member Functions | |
int | dataSize () const |
Returns the currently used number of samples passed through the signal. More... | |
int | sampleRate () const |
Returns the sample rate in Hz. More... | |
![]() | |
~AbstractAudioOutput () | |
![]() | |
Q_INVOKABLE | QObject (QObject *parent=0) |
virtual | ~QObject () |
virtual bool | event (QEvent *) |
virtual bool | eventFilter (QObject *, QEvent *) |
QString | objectName () const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const |
bool | signalsBlocked () const |
bool | blockSignals (bool b) |
QThread * | thread () const |
void | moveToThread (QThread *thread) |
int | startTimer (int interval) |
void | killTimer (int id) |
template<typename T > | |
T | findChild (const QString &aName=QString()) const |
template<typename T > | |
QList< T > | findChildren (const QString &aName=QString()) const |
template<typename T > | |
QList< T > | findChildren (const QRegExp &re) const |
const QObjectList & | children () const |
void | setParent (QObject *) |
void | installEventFilter (QObject *) |
void | removeEventFilter (QObject *) |
bool | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0) |
bool | disconnect (const QObject *receiver, const char *member=0) |
void | dumpObjectTree () |
void | dumpObjectInfo () |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const |
QList< QByteArray > | dynamicPropertyNames () const |
void | setUserData (uint id, QObjectUserData *data) |
QObjectUserData * | userData (uint id) const |
QObject * | parent () const |
bool | inherits (const char *classname) const |
![]() | |
virtual | ~MediaNode () |
bool | isValid () const |
Tells whether the backend provides an implementation of this class. More... | |
QList< Path > | inputPaths () const |
QList< Path > | outputPaths () const |
Properties | |
int | dataSize |
![]() | |
QString | objectName |
Additional Inherited Members | |
![]() | |
static bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
static bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static uint | registerUserData () |
![]() | |
AbstractAudioOutput (AbstractAudioOutputPrivate &dd, QObject *parent) | |
![]() | |
QObject * | sender () const |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
virtual void | timerEvent (QTimerEvent *) |
virtual void | childEvent (QChildEvent *) |
virtual void | customEvent (QEvent *) |
virtual void | connectNotify (const char *signal) |
virtual void | disconnectNotify (const char *signal) |
QObject (QObjectPrivate &dd, QObject *parent=0) | |
![]() | |
MediaNode (MediaNodePrivate &dd) | |
![]() | |
QScopedPointer< QObjectData > | d_ptr |
![]() | |
MediaNodePrivate *const | k_ptr |
![]() | |
static const QMetaObject | staticQtMetaObject |
enum Channel |
Specifies the channel the audio data belongs to.
Enumerator | |
---|---|
LeftChannel | |
RightChannel | |
CenterChannel | |
LeftSurroundChannel | |
RightSurroundChannel | |
SubwooferChannel |
Definition at line 63 of file audiodataoutput.h.
int dataSize | ( | ) | const |
Returns the currently used number of samples passed through the signal.
int sampleRate | ( | ) | const |
Returns the sample rate in Hz.
Common sample rates are 44100 Hz and 48000 Hz. AudioDataOutput will not do any sample rate conversion for you. If you need to convert the sample rate you might want to take a look at libsamplerate. For visualizations it is often enough to do simple interpolation or even drop/duplicate samples.
Sets the number of samples to be passed in one signal emission.
Defaults to 512 samples per emitted signal.
size | the number of samples |
|
signal |
Emitted whenever another dataSize number of samples are ready.
data | A mapping of Channel to a vector holding the audio data. |
This signal is emitted before the last dataReady signal of a media is emitted.
If, for example, the playback of a media file has finished and the last audio data of that file is going to be passed with the next dataReady signal, and only the 28 first samples of the data vector are from that media file endOfMedia will be emitted right before dataReady with remainingSamples
= 28.
remainingSamples | The number of samples in the next dataReady vector that belong to the media that was playing to this point. |
|
readwrite |
Definition at line 57 of file audiodataoutput.h.