Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently October 17th, 2024, 10:20 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Button to control system audio?
PostPosted: December 12th, 2014, 5:49 pm 
Offline

Joined: October 25th, 2004, 1:21 pm
Posts: 424
Location: West Lancs, UK
Opus: 7
OS: Xp, Win7
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 Rossiter, Rossiter & Co

Pro 8, Pro 7, Pro 6, Pro 05.5XE, Pro 04XE, XE2.8, ILM 4.5 on Win7 Professional


For this message Linda has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Button to control system audio?
PostPosted: December 31st, 2014, 5:22 pm 
Offline

Joined: June 18th, 2005, 3:16 pm
Posts: 86
Opus: Opus Pro v9.75
OS: Windows 10.?
System: HP xw660 Server 32GB RAM, Toshiba Satellite Laptop
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

_________________
Opus 9.6
HP xw6600 Workstation, Intel64 , Intel(R) XEON(R) CPU E5430 2.7GHz, RAM 8GB, NVIDIA Quatro K600, Samsung SSD 840 Pro Series: 238.5GB , 2 x 1TB HDD, 2 x PnP Generic monitors
Living a long, healthy, happy & prosperous life!


For this message pc_amethyst has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group