Hi, what is a "shot timer" ?
I've tried to call the play function into a QDialog.
#include "mydialog.h"
#include <QMediaPlayer>
#include <QBuffer>
MyDialog::MyDialog()
{
unsigned short samples[1000000];
for (unsigned int i = 0; i < sizeof(samples) / sizeof(float); i++) {
samples[i] = 1000;
}
QByteArray byteArray
((const char*) samples,
sizeof(samples
));
QMediaPlayer mp;
mp.setMedia(QMediaContent(),&mediaStream);
mp.play();
}
#include "mydialog.h"
#include <QMediaPlayer>
#include <QBuffer>
MyDialog::MyDialog()
{
unsigned short samples[1000000];
for (unsigned int i = 0; i < sizeof(samples) / sizeof(float); i++) {
samples[i] = 1000;
}
QByteArray byteArray((const char*) samples,sizeof(samples));
QBuffer mediaStream(&byteArray);
QMediaPlayer mp;
mp.setMedia(QMediaContent(),&mediaStream);
mp.play();
}
To copy to clipboard, switch view to plain text mode
#include <QApplication>
#include "mydialog.h"
int main(int argc, char *argv[])
{
MyDialog dialog;
return a.exec();
}
#include <QApplication>
#include "mydialog.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MyDialog dialog;
return a.exec();
}
To copy to clipboard, switch view to plain text mode
But I've always this message, even if I set play into a loop.
GStreamer; Unable to pause - ""
GStreamer; Unable to pause - ""
To copy to clipboard, switch view to plain text mode
Bookmarks