Solved

Full sound volume ?

Posted on 1997-09-06
1
273 Views
Last Modified: 2013-12-26
I'm looking for some C/C++ code to temporarily change the systems sound volume. I've checked out the Caveman Sound System, but you cannot set the volume of a sound channel to a value higher than the system volume defined with the Sound-control panel.
I just want some lines of code that help me to do this.
0
Comment
Question by:mennigmann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
Hose earned 50 total points
ID: 1291677
If you're just looking for code to change the main system volume, here it is:

long      theSoundVol;

GetDefaultOutputVolume( &theSoundVol);
SetDefaultOutputVolume( kFullVolume );

/* do whatever here */

SetDefaultOutputVolume( theSoundVol );


Don't forget to do an #include <Sound.h> in your includes.

If you're looking to specifically alter an individual sound channel, then you're going to have to dive into the sound commands and channel structure.  I'd recommend picking up "Graphics and Sound Programming Techniques" (contains a subtitle "For The Mac") by Dan Sydow.  ISBN 1-55851-442-2  You'll need a reference work too, so pick up Inside Macintosh (I'd recommend the CD version with all the books--if you're going to be manipulating sound channels then you'll probably be doing some other advanced stuff in need to IM at some point in time).  Good luck.  :)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question