PDA

View Full Version : Change volume of AudioOutput



snah
21st July 2010, 12:19
Hi,

I'm planning to use the Qt Multimedia framework to output raw audio data. I have several sources of which I want to change the volume independently, during playback.
Do I need to scale the raw data myself to do this, or is there an easier way?

I need the code run on linux(desktop and mobile) and windows.

thanks, Hans

stefanadelbert
29th November 2010, 07:24
One way to do this would be to have each MediaObject linked to its own AudioOutput (using createPath) and then you could adjust the volume of each AudioOutput.

I'm trying to link a number of MediaObjects to the same AudioOutput so that I can control the volume of a number of sources with one VolumeSlider linked to the AudioOutput. I can't get it working though - do you know if that's possible?

BTW. I'm on Qt 4.6.2.

snah
1st December 2010, 18:24
hi,

yes that is what I ended up doing. My problem was (originally) that I couldn't use phonon since I had raw audio data not a wave file. Therefor I wanted to use the lower level QtMultimedia module (which has no volume control). In the end I just created a class which could turn the raw data into a wave file (i.e. create the propper headers and file structure) in memory.

As for you'r problem with multiple AudioOutputs. I think it should work, but I never got around testing that. I had to put the project on hold due to a very busy period in my study. Maybe you should create a new thread and post some more details of your problem there.

stefanadelbert
1st December 2010, 21:41
Hi snah

Good that you managed to get your problem sorted out.

I have already created a thread (http://www.qtcentre.org/threads/36400-Connect-Multiple-MediaObjects-to-One-AudioOutput) where I explain the problem I'm having, but I haven't heard anything back yet. I would have thought that the way I'm trying to use Phonon would be very common, so I'm surprised that there isn't more about this problem on the web and that I haven't got a response yet.

I've been advised by a guy who used to work on Phonon to get in touch with the mailing list kde-multimedia@kde.org. Hopefully I'll have more luck there.