How to change sysem volume using Qt
I wrote one Qt GUI application that uses QWebView. I would like to change system volume at run time using my Qt application. Please suggest how can we do it.
2 replies
You can use Phonon::AudioOutput [doc.qt.nokia.com] or QMediaPlayer [doc.qt.nokia.com] Here is a media player example using qt mobility [doc.qt.nokia.com].
I tried by the casses suggested by you, but no help.
Since I dont deal with any media file playback so that I feel QMediaObject is not suitbale for this case. Howevwe I tried with AudioOutput, and Volume Slider class but no help in controlling the system volume.
Below mention is code that I wrote , please figure out where is the problem.
- Phonon::MediaObject *mediaObject = new Phonon::MediaObject(this);
- audio = new Phonon::AudioOutput(Phonon::MusicCategory, this);
- Phonon::createPath(mediaObject, audio);
- volumeSlider = new Phonon::VolumeSlider;
- volumeSlider->setAudioOutput(audio);
- volumeSlider->show();
You must log in to post a reply. Not a member yet? Register here!


