Using Low Level Audio
I´m starting to try use the low level c++ classes to process audio in Qt.
My main target is made a simple thing:
01 - Open the Audio with AudioDecoder class.
02 - Makes some processing on the audio buffers
03 - Play the sound.
With this i can start create some algorithms to process audio data in my system, but some things are not clear to me yet reading the Qt´s help files like:
How i play this sound in Low Level?
How This data can be changed during the Play loop?
Anyone have access to a little example or tutorial doing this simple 3 steps?
Any help will be much appreciated.
- What Audio do you mean ? Audio file ? Audio device ?
- What processing do you have in mind ? Channel mixing ? Volume modification ?
I want open a wave audio , put the entire sound in a buffer and during the execution of this sound make some changes in this buffer in Real-Time, like we do with graphics for example.
A Channel Mixing operation is one of my targets here too, so can be used as a reference of what i´m trying to do.
Basically i want change the properties of this loaded sound in realtime, like the pith , panning etc...
I open a example in Qt called QAudioOutput example , but it´s being hard understand where i can process the Data , during the execution since it uses a start method only.
Maybe using the m_generator in this example i can reach this...
Be sure to check that the feature you need is supported on the OS you are running:
Don't assume that because a particular class looks like it does what you want, it will do it on the OS you are working with (looking at you QAudioProbe – can I get the two days I wasted on you back... ;-)
Then a bit more of advanced audio processing, in that case Qt is not the best tool for the "editing" part. You can use a library like DSPFilters for the audio processing.
QAudioOutput is used to send data to an audio device, so basically what you will have processed.
Well, the things start to work, but if i understand correctly , and looking at the back-end list i will only be able to decode audio in windows?
What do you mean by "only decode" ?
On Windows machines.
I understood that you are working on Windows what I would like you to explain is what you mean by "only decode" ?
Becouse looking at the table , for example the decode funtionality is not present, so in android machines for example, i will be able to use the QAudioDecoder class to open my audio and process it?
i only see this funtionality avaliable for :
Media Foundation (Windows) and GStreamer (Unix)
Are you talking about audio files ?
Basically i want load a wave or mp3 file, store it in a buffer and during the play...apply some filters in real-time to hear the results...
Everything is working using the QAudioOutput and QAudioDecoder examples, but my concern now is about how many platforms i will be able to make this run.
My engine runs in many platforms(Windows,Mac,Android,iOS) acctually using Qt , and the Audio component is the only component that are using yet external sdk to work properly and i want remove this sdk to make possible use only the low level part of Qt , as i do with graphics(OpenGL).
Ok, clearer now.
Well, as you already discovered, the QAudioDecoder class is not yet available on all platforms so you have to rely on that other SDK currently to provide that part.
By the way; which one are you using right now ?
Im using FMod, but i want a library where i can compile it toguether with my engine on the target plattform.
The only plattform that make this possible was the YSE sdk , but i not test it yet...
Another idea about this topic that happen is becouse the main development hosts platforms(Windows and Linux) the decoder works...i will develop a little aplication to manage my own format of sound and images.
So, thia application basically will convert all the images and sound in a already prepeared buffer (in a buffer defined by me) to be loaded in the engine...
I believe in thia way i can then code my own decoder and use the low level QAudioOutput class to play it!
IIRC, there are already some application mixing Qt and SFML that might be also an in-between solution.