aanrv
aanrv

Reputation: 2241

Get QAudioBuffer from QMediaPlayer

I want to build an audio visualizer using QMediaPlayer. I came across this but QAudioProbe would not allow me to set QMediaPlayer as its source. I believe it may not be supported on OSX.

I have also found this but I'm not sure how to make it work with QMediaPlayer as that example uses a QIODevice.

Is there another way to getting QAudioBuffer from a QMediaPlayer without using QAudioProbe? If not, what is another approach to getting data from QMediaPlayer in order to build a visualizer?

Upvotes: 3

Views: 883

Answers (1)

psyched
psyched

Reputation: 1939

As you can see here, AV Foundation backend has support neither for Audio probe, nor for Stream source. You are out of luck. You need to decode audio with some other library, for example libmpg123 or libogg, depending on the format. Then you can play it with OpenAL.

Upvotes: 2

Related Questions