CallName 语音点名系统

点名系统


这是程序运行图,包含点名系统,语音播报功能,以及记录存到数据库等;

#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);

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值