Feb 20 2007, 03:45 PM
Post
#1
|
|
![]() Group: Admin Posts: 3,277 Joined: 29-July 04 From: Cambridge, England Member No.: 4,149 |
I have successfully played sound like this...
CODE #include <qsound.h> QSound soundSample(Resource::findSound("wave")); soundSample.play(); However, I am trying to set the volume control.. I have tried everything I can find from googling, but no joy! If anyone has any ideas, I'd be terrible grateful! Here's what I have so far:[/code] Config cfgSound("Sound"); cfgSound.setGroup("System"); int oldVolume = cfgSound.readNumEntry("Volume", 0); cfgSound.writeEntry("Volume", 66); int newVolume = cfgSound.readNumEntry("Volume", 0); QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; [/code] the code runs but the volume doesn't change.. reading it and calling readNumEntry then writeEntry then readNumEntry reveals the new value is accepted, but the volume level doesn't change! |
|
|
|
![]() |
Feb 20 2007, 11:12 PM
Post
#2
|
|
![]() Group: Members Posts: 2,808 Joined: 21-March 05 From: Sydney, Australia Member No.: 6,686 |
QUOTE(speculatrix @ Feb 21 2007, 09:45 AM) I have successfully played sound like this... CODE #include <qsound.h> QSound soundSample(Resource::findSound("wave")); soundSample.play(); However, I am trying to set the volume control.. I have tried everything I can find from googling, but no joy! If anyone has any ideas, I'd be terrible grateful! Here's what I have so far:[/code] Config cfgSound("Sound"); cfgSound.setGroup("System"); int oldVolume = cfgSound.readNumEntry("Volume", 0); cfgSound.writeEntry("Volume", 66); int newVolume = cfgSound.readNumEntry("Volume", 0); QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; [/code] the code runs but the volume doesn't change.. reading it and calling readNumEntry then writeEntry then readNumEntry reveals the new value is accepted, but the volume level doesn't change! you can use tkvol to change the volume from the command line. the code for tkvol is included in the zplayer source.... |
|
|
|
speculatrix Playing Sound, Controlling The Volume Feb 20 2007, 03:45 PM
speculatrix thanks for that... looks like he does an IOCTL on ... Feb 21 2007, 04:27 AM![]() ![]() |
|
Lo-Fi Version | Time is now: 18th May 2013 - 05:03 AM |