This application has been implemented using the Qt framework, as a GUI application, so that we also get a graphical interface for ease of debugging. This debugging UI was designed using the Qt Designer of the Qt Creator IDE as a single UI file.
We start by creating an instance of the GUI application:
#include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
This creates an instance of the MainWindow class in which we have implemented the application, along with an instance of QApplication, which is a wrapper class used by the Qt framework.
Next, this is the MainWindow header:
#include <QMainWindow> #include <QAudioRecorder> #include <QAudioProbe> #include <QMediaPlayer> namespace Ui { ...