audio equalizer in Qt
-
Hi, I've just looked around at QMultimedia and I see that over the years it became more and more mature... but still are few things to add or to improve..
how can I add an audio equalizer??
I've tried to use libvlc - because it has implemented one.. but their video sucks on raspberry pi Gl driver... even with Qwidget - so I've abandoned the idea...
then I've gone to GStreamer but... I've realised that Qt multimedia is actually using it...
Now I'm using QtMuyltimedia...
great.. even the examples that they provide work perfectly in the Raspberry Pi video is ok... quality is ok... speed is ok... but no audio controls for bass treble ... this is not ok.. I need one.. that was the part that I've liked about libvlc - this was working but video not...So... How can I add an equalizer here???
I've found some option... I have few libs.. the only thing I'm asking is how to implement it?? where to take the source in raw.. pass it to my equalizer and then return the processed row back to the sink Hm...or any other solution...
Many Thanks...
-
@arsinte_andrei Qt Multimedia doesn't contain audio processing functions, so you need to use an external library like libvlc or gstreamer.
but their video sucks on raspberry pi Gl driver...
Are you trying to play audio or video?
I've found some option... I have few libs.. the only thing I'm asking is how to implement it?? where to take the source in raw.. pass it to my equalizer and then return the processed row back to the sink Hm...
Many years ago, I did this:
- Use
libsndfile
to convert audio files into raw waveforms (or useQAudioInput
to acquire live audio waveforms from the microphone) - Use
libfftw
to transform short waveform chunks into the frequency domain. - Multiply each frequency bin by the amount I want.
- Use
libfftw
to transformed frequency values back into waveforms. - Output the waveforms to
QAudioOutput
.
There might be a better way, but this is the method I know. It is probably not suitable for modifying a video's audio.
- Use
-
At the moment I'm working only on the audio side of it.. but in the nearest future, I'll be adding even the video... So It has to be something done thru Qt as much as possible in order to keep the dependency as low as possible. it has also to work on ARM and X64 and. At the moment the libsndfile is not supporting mp3 and the licence on mpeg vanished away a few years ago... so I would like to take advantage of this... so the lib proposed is not that good... I've found lame and shine but... I want more freedom in Qt.. what the hell is this no one is able to use QMediaPlayer or to write an extension of it... it should be nice from Qt to have like a module to load the audio file (file in *nix can be a device also) to take it from there as a bytearray or as a stream process it and then send it back to a file(can be a playing device like your speakers)... but QMediaPlayer cannot be implemented (re-made) by a user simply because it uses some classes that they are not made available -
in other words... QMedia player is doing a very good job in decoding the files - how can we get those decoded files to process them??? in floating or int maths??
I do still think that there is some chance to possible use Qt to add an equalizer... I just need to figure out how... -
Also, How can I ask a feature in Qt... I mean .. any way Qt is using some classes to take the audio file and to decode it - for this is using a back end like GStreamer on GNU/Linux or others...I do not want access to the backend .. but I want to have access to the decoded file in order to process it myself... then I need a class to sed a processed file back to the backend in order to play it...
Like that, I can write my own plugins for Qt to play files like echo, reverb, equalizer, compressors and so on...Hei Qt what do you think about this??
-
Hi,
You're on the wrong channel to ask for features. This is a user forum. You can open a feature request on the bug report system.
As for QtMultimedia, the various backends offers different level of support and you can't always access everything on all platform easily. The module itself has no pretension of being a full featured multimedia editing tool.
From the looks of it, you would likely needs an audio equivalent of QAbstractVideoFilter.
On a side note that there's no decoded file. That's not how it works. Data is read, decompressed, processed if needed and sent to audio/video rendering hardware.
-
@arsinte_andrei said in audio equalizer in Qt:
in the nearest future, I'll be adding even the video... So It has to be something done thru Qt as much as possible in order to keep the dependency as low as possible.
Unfortunately, Qt does not provide audio processing functionality. You need external dependencies.
so the lib proposed is not that good...
Let's be clear: I did not propose that you use libsndfile. I simply told you that I used libsndfile with Qt in the past. I showed one possibility, but you need to find an alternative that suits your needs.
I want more freedom in Qt.. what the hell is this no one is able to use QMediaPlayer or to write an extension of it... it should be nice from Qt to have like a module to load the audio file (file in *nix can be a device also) to take it from there as a bytearray or as a stream process it and then send it back to a file(can be a playing device like your speakers)... but QMediaPlayer cannot be implemented (re-made) by a user simply because it uses some classes that they are not made available -
in other words... QMedia player is doing a very good job in decoding the filesQMediaPlayer is working as advertised: It plays media correctly.
If you want to modify QMediaPlayer to let you inject custom audio filters to video files, you have 2 options:
- Follow @SGaist's suggestion and submit a feature request to https://bugreports.qt.io/ and wait for it to be implemented. (I'm guessing this will take at least a few years, because it is outside the original scope of Qt Multimedia)
- Modify the Qt source code to add the feature yourself