Qt audio issue issue using qmultimedia low level API

I am trying to get mpg123 audio decoder to work with QT on windows. How can I play decoded audio data at the desired speed using the Qmultimedia module in push mode. I am currently using a simple timer to make it play sound, but this is not a very effective way to do this if I do something else, at the same time the sound becomes distorted. Is there a better way to send decoded data to the audio output? It would be nice if someone could point me to some nice examples using the Qmultimedia module and the Qaudiooutput class. I tried to figure out an example of the “audiooutput” project in QT, but it seems like it also uses a timer to send sound for push output. Hope I'm not too confused.

+3
source share
1 answer

I also had to figure this out, and I would also suggest using the Phonon framework for this. It uses Windows Media Player as a host on Windows, QuickTime on Mac, and some KDE stuff on Linux. Thus, it is quite platform independent.

If you need lower functionality, you should take a look at an open source project called portaudio. It is very easy to use, and you can manipulate or even fill buffers from code. I used it to create a generator.

Hope this helps!

Best

guitarflow

0
source

Source: https://habr.com/ru/post/1788935/


All Articles