I'm on a linux and I want to get data out of an mp3. Hang in there because I know the first thing you're thinking is "this dope doesn't have his codecs set up". I'm pretty sure I do, mplayer plays mp3's, ffmpeg can encode and decode mp3, no problems there. I'm on linux fedora, I'm using qtcreator, qt5.6, and I've installed qt5multimedia. I have my .pro set up to include multimedia. Here's my mainWindow class followed by the error I'm getting;
GStreamer; Unable to start decoding process
Error:Error:Could not open resource for reading.
I used fstream to check that the file could be accessed and it did fine, I'm not sure that my QAudioFormat is set up correctly since I couldn't find a good example for how to open mp3's. I tried downloading dnf's qt5-qtmultimedia-example package but they don't show up in qtcreator's examples area (nothing is showing up there)...
The QAudioFormat object is for the format that the decoder is supposed to decode into right?
Does anyone have an example of the correct setup?
[Edit]
I just tested on a .wav and .ogg and both showed the same errors. It's got to be my code. I'll keep looking.
OK, I tried to set up a simple QMediaPlayer, and I got a different message about GStreamer, one that I've seen other people have posted about on stack overflow. It appears to be a problem with my version of GStreamer not being supported by this version of Qt?
I'm not 100% on that, but I'll try downgrading my GStreamer to version 0.1 and make sure it's the dev package...
{EDIT: With Solution}
So I did that... It didn't work.
I read through 30 other posts where nobody got a resolution, then someone was good enough to post their solution...
Absolute paths. "/home/username/fileToPlay.mp3"
I tested that with the QMediaPlayer and it played, then with the above code and it worked (or at least the bufferReady signal was sent and my readBuffer function closed the program as my way of confirming the slot was activated...
So apparently while Qt accepts files from the current working directory, GStreamer expects to get absolute paths. I don't know if installing version 0.1 helped, but I doubt it since It did not affect the error message received before changing to absolute path...