Setting volume in Phonon

  • Hi,

    I created a music player in Qt/QML/Phonon which I use on my Windows UMPC. I have some problems with controlling volume.

    The first problem is that the output volume is quite low compared to other players. I found out that I can set volume above 1.0 (or 0 dB) but it has no impact. Is this normal?

    Also since Phonon/DirectShow doesn't support replaygain, I implemented it myself so that I change the volume whenever a new track starts playing. It works but the changes are to strong. I use the function setVolumeDecibel and add the calculated replaygain value to the current volume. The result is that loud tracks are quieted to much and quiet tracks are amplified to much. I also tried MPlayer as a backend before and this approach worked fine there.

    I would appreciate any advice regarding these problems with volume control. Probably the best solution would be to switch to VLC backend but I have no idea how to do this on Windows.

  • did you compiled phonon library yourself? AFAIK you should compile it with your own directx version to be compatible with your windows.
    Also you can't set windows master volume by phonon. you may use native APIs (just a note).

  • Not true. Phonon is not depricated.
    From the "module maturity": page:
    Phonon copy inside Qt
    State: Done
    Reasoning: a separate release of Phonon, with its own version numbers, is available and can be used instead; the copy inside Qt will not be updated further.

    That is not the same as "depricated", but it fits in the more modular approach that Qt is taking: use the external Phonon module instead.

  • bq. Overall module state: Done inside Qt, Maintained outside of Qt
    Reasoning: QtMultimediaKit recommended instead; development of Phonon continues and is maintained outside of Qt, by the KDE community

    So for new project is recommended

  • If you want to stick with pure Qt only modules: yes. But nothing is stopping you from using the external Phonon anyway.

  • mohsen> I haven't compiled it myself. I use the program many different computers and it works the same on all of them. I don't want to control master volume, I want to control the volume internally. So this works OK for me, just the change in dB seems to be bigger then I intent.

    Regarding QtMultimediaKit, I plan to switch to it. But the last time I tried it, it didn't work on Windows. There was no binary available and when I tried to compile it myself, it always failed (with both MinGW and MSVC). I'll check it again but I'm afraid there won't be any change before Qt 4.8.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.