PDA

View Full Version : Connect Multiple MediaObjects to One AudioOutput



stefanadelbert
28th November 2010, 23:35
Is it possible to connect two or more MediaObjects directly to one AudioOutput? My application has a volume control which affect the volume of all the application's sounds. But I have a two MediaObjects and I can't find a way get them both to use the same AudioOutput. It seems that the second time I call createPath the first path is being disconnected.

I found this article (http://vir.homelinux.org/blog/archives/45-Phonon-Trolltech.html) which mentions that implicit mixing of MediaObject audio sources is no longer possible and that there "will" be a mixing object that will make mixing audio sources possible. Did this ever happen? I find no reference to this in the documentation (I'm on Qt 4.6.2).

Anyone achieved this before? Anyone got any insight?

stefanadelbert
2nd December 2010, 22:40
Has anyone created or worked on a Qt application that has more than one potential notification sound and managed to get them playing simultaneously? I would have imagined that this would be quite common, especially for games.

Is there another solution that someone can think of? Maybe I should create a new MediaObject and AudioOutput each time a sound needs to be played, using createPath. This would allow the sounds to be played at the same time, even two of the same sound to be played at the same time (desirable behaviour). I would need to call deleteLater() on MediaObject::finished(). I would also need to connect the application-wide VolumeSlider to each active AudioOutput somehow, which will be tricky seeing that the VolumeSlider does not emit any signals when it's been changed.

stefanadelbert
9th December 2010, 00:21
It seems to be generally accepted, according to this thread (see quote below), that KDE multimedia framework is currently not capable of mixing sounds:


Wearing my kdegames author hat, I must say that one requirement we have
there is the ability not only to get sounds playing very fast when they
are triggered, but also something that would help us preload short
samples and have them ready for playback (without streaming), combined
with the ability to mix several layers of these samples with a
background track. There are no good solutions for this problem yet
afaik. KDE Edu could also benefit from something like this.

I'm glad that I found the reference to games as a game is a great example of where mixing sounds together would be required.

As KDE uses Qt, I assume that this also means that Phonon is not capable of mixing sounds.

If anyone knows differently, please let me know.