Mp3 Decoder using QAudioDecoder
I would like to get the raw data (pcm) from an mp3 file by using QAudioDecoder. According an example I found it's possible to do so with QAudioDecoder. Please tell if not.
I implemented this example, but get an error "defaultServiceProvider:requestService<> : no service found for - org.qt-project.qt.audiocode" when I do "decoder = new QAudioDecoder();".
Someone has an idea why?
My code is :
decoder = new QAudioDecoder(); decoder->setAudioFormat(desiredFormat); decoder->setSourceFilename("sample.mp3"); connect(decoder, SIGNAL(bufferReady()), this, SLOT(readBuffer())); decoder->start(); printf("Erreur : %d",decoder->error());
[edit, code tags added]
Please use "code wrappings":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 They make your code readable :-)
I have a "similar problem":https://qt-project.org/forums/viewthread/26237/ for writing my audio engine, does anyone knows how to solve it?
You can't used Qt to decode mp3, well ,I mean I didn't succeeded. Use instead mpeg123 (decode only mp3) or FFmpeg (decode many format). I did and it works.
[quote author="Matt141" date="1365522623"]You can't used Qt to decode mp3, well ,I mean I didn't succeeded. Use instead mpeg123 (decode only mp3) or FFmpeg (decode many format). I did and it works.[/quote]
I'm a fresh to this forum, so not familiar with it.
And this problem have another replay???
Now, I have met the problem too. I'm trying to solve it too.