Linda wrote:
Is there an action to control the system audio on the pc?
I'd like to be able to mute someone's pc - and un-mute it.
I have a number of slides with voice. If I have a button to change the volume of the audio on one slide, I need to repeat this, with variables, on every slide.
So I hoped there was the simpler option of just muting the whole pc!
==================================================================================
Linda,
Just caught sight of this post whilst looking to solve an audio problem of my own. Here is how I would solve the problem.
//list number of the slide to mute in ascending order
txtSlidesToMute = "3 5 7 10 12 14 19 23 28 35 49 52 77";
//Splits the slide list into array
arrSlidesToMute = txtSlidesToMute.split(" ");
//Gets length of array
numLength = arrSlidesToMute.length
//Gets number of slides in slideshow
numSlides = Slideshow_1.GetSlideCount();
//Opens and plays the file
txtFileChosen = OpenSound("C:\\Users\\Paul\\Downloads\\Moonlight_Sonata_by_Beethoven.mp3");
txtFileChosen.Play();
//Loops through the slides
for (var i=0;i<numSlides;i++)
{
//Goes to slide number
Slideshow_1.GotoSlide(i);
//Assigns loop index to variable
numSlide = i;
//Loops through array to find match and sets sound to 0
for (var j = 0;j<numLength;j++)
{
//Compares slide number to array slide number and mutes audio
if (numSlide.toString() == arrSlidesToMute[j])
{
//Mutes audio and waits slide timing
txtFileChosen.SetVolume(0);
wait(3);
}
}
//Slide timing delay. If different for some slides use a variable and second array
wait(3);
//Rests audio to full volume
if (txtFileChosen.GetVolume() == 0)
{
txtFileChosen.SetVolume(100);
}
}
/*Linda, hope this helps. It worked fine on my single page slideshow. There may be more elegant solutions but this one works fine. I will retain it for use in the
multimedia program I am developing.
Regards
Paul Conway
*/
PPS:
Well, that was the scripted version! Your query referred to an action. I can't see one but there is a solution. Simply add two Key Pressed actions, e.g. 'Left' and 'Right' arrow keys and two script object to a page with the following code:
// Left arrow key pressed
soundFileVariable.SetVolume(0);
// Right arrow key pressed
soundFileVariable.SetVolume(100);
//The sound file continues to run with only the volume switched off and on as needed.
Paul