April 20, 2012

Ashish Mittal Ashish Mittal
Ant Farmer
151 posts

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

April 20, 2012

leon.anavi leon.anavi
Mad Scientist
1062 posts

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].

 Signature 

http://anavi.org/

April 23, 2012

Ashish Mittal Ashish Mittal
Ant Farmer
151 posts

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.

  1.     Phonon::MediaObject *mediaObject = new Phonon::MediaObject(this);
  2.  
  3.     audio = new Phonon::AudioOutput(Phonon::MusicCategory, this);
  4.  
  5.        Phonon::createPath(mediaObject, audio);
  6.  
  7.        volumeSlider = new Phonon::VolumeSlider;
  8.        volumeSlider->setAudioOutput(audio);
  9.        volumeSlider->show();

 
  ‹‹ stopping data transfer with QTcpSocket      Problem with QGraphicsScene mouse move event ››

You must log in to post a reply. Not a member yet? Register here!