点名系统
这是程序运行图,包含点名系统,语音播报功能,以及记录存到数据库等;
#include "app.h"
#include "ui_app.h"
#include <QFileDialog>
#include <QFile>
#include <QDebug>
#include <QProcess>
#include <QSqlDatabase>
#include <QMessageBox>
#include <QSqlQuery>
#include <QString>
#include <QMediaPlayer>
app::app(QWidget *parent) :
QWidget(parent),
ui(new Ui::app)
{
ui->setupUi(this);
this->setWindowTitle("CallName 1.0");
this->setWindowIcon(QIcon(":/icons/png-0628.png"));
db = QSqlDatabase::addDatabase("QSQLITE");
ui->pushButton_CA->setEnabled(false);
ui->pushButton_AB->setEnabled(false);
ui->pushButton_AG->setEnabled(false);
ui->pushButton_begin->setEnabled(false);
//ui->pushButton_end->setEnabled(false);
ui->pushButton_begin_2->setEnabled(false);
}
app::~app()
{
delete ui;
}
void app::spake(QString &namep)
{
// QString file_mp3 = tr("name/%0.mp3").arg(namep);
// QFileInfo info(file_mp3);
// if(!info.exists())
// {
// char command[256] = {0};
// sprintf(command,"ttsmain %s",namep.toUtf8().data());
// qDebug()<<"command :"<<command;
// system(command);
// memset(command,0,256);
// sprintf(command,"move result.mp3 name/%s.mp3",namep.toLocal8Bit().data());
// system(command);
// }
// char command[256] = {0};
// sprintf(command,"../CallName/ttsmain %s",namep.toUtf8().data());
// qDebug()<<"command :"<<command;
// system(command);
// system("play result.mp3");
// this->play = new QMediaPlayer;
// QString localfile = tr("name/%0.mp3").arg(namep);
// play->setMedia(QUrl::fromLocalFile(localfile));
// play->setVolume(50);
// play->play();
QString file_mp3 = tr("name/%0.mp3").arg(name);