i need a way to stream data while checking for new metadata that icycast provides within the stream contents
Читать полностью…I checked MSVC 2019 64-bit. I'm not sure but that seemed to install just QtCreator for that platform, and not the compiler. However, after installing Visual Studio, QtCreator was able to use its compiler without modifying the QtCreator installation.
Читать полностью…#include <QAudioDevice>
#include <QAudioOutput>
#include <QCoreApplication>
#include <QFile>
#include <QMediaDevices>
#include <QMediaMetaData>
#include <QMediaPlayer>
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
QMediaPlayer *mediaPlayer = new QMediaPlayer;
QAudioOutput *audioOutput = new QAudioOutput(QMediaDevices::defaultAudioOutput());
mediaPlayer->setSource(
QUrl("https://scdn.nrjaudio.fm/adwz1/fr/30079/"
"mp3_128.mp3?origine=radiogarden&listening-from-radio-garden=1673884209"));
mediaPlayer->setAudioOutput(audioOutput);
mediaPlayer->play();
QObject::connect(mediaPlayer, &QMediaPlayer::metaDataChanged, &app,
[mediaPlayer]
{
qDebug() << mediaPlayer->metaData().stringValue(QMediaMetaData::Title);
});
return app.exec();
}
""
after some little time
Читать полностью…
i think this method only reads the headers of the source, and since most online radios use icycast/shoutcast, there arent any
Читать полностью…By using MaintenanceTool.exe you can install all compilers from Microsoft...I do not see any problems...
Читать полностью…When you call play , you should check if the media has loaded and then fetch metadata
Читать полностью…if yes, wouldn't that be an unnecessary second network request which could use more internet traffic?
Читать полностью…i already know how to get the metadata but i dont know how to stream data into qmediaplayer
Читать полностью…icycast/shoutcast gives metadata after every x bytes (to find x you must pass Icy-MetaData: 1
header with the network request and in the response read header Icy-MetaInt
)
expected something different because metaData() always returns an empty metadata object
Читать полностью…or do I do setSource(QUrl) and then a ->get(requestWithTheSameUrl) to get the metadata (which is literally inside the audio)?
Читать полностью…