[Interest] QAudioDecoder mp3 problem
John Weeks
john at wavemetrics.com
Wed Aug 31 17:36:58 CEST 2016
> On Aug 31, 2016, at 1:28 AM, Alexander Dyagilev <alervdvcw at gmail.com> wrote:
>
> Hello,
>
> I'm trying to decode an mp3 file. Getting ServiceMissingError ("The QAudioDecoder object does not have a valid service").
>
> At the same time QMediaPlayer can play the file.
>
> Am I doing something wrong?
>
> The code:
>
> QSharedPointer<QAudioDecoder> decoder(new QAudioDecoder());
>
> decoder->setSourceFilename("1.mp3");
>
> decoder->start();
On what platform? QAudioDecoder depends on both support on the platform and on the presence of a Qt plug-in that uses the platform support. The support on OS X is so minimal that we wound up writing a platform-specific bit of code using Core Audio (which is not pleasant!).
It's also hard to figure what support is actually available on a given platform, and now I've forgotten how I figured it out!
-John Weeks
More information about the Interest
mailing list