# include <QtGui/QtGui> 

#if QT_VERSION >= 0x040600
# include <QtMultimedia/QAudioDeviceInfo>
# include <QtMultimedia/QAudioOutput>
#endif

class AudioTest : public QObject
{
    Q_OBJECT

public:
    AudioTest();

	int error;
	QIODevice * audio;

private:
    QAudioOutput *   m_audioOutput;
    QAudioFormat     m_format;
};

class Generator : public QIODevice
{
    Q_OBJECT
public:
    Generator();
    
    void start();
    void stop();

    qint64 readData(char *data, qint64 maxlen);
    qint64 writeData(const char *data, qint64 len);

private:
    qint64 m_pos;
    QByteArray m_buffer;
};
