Solved

Full sound volume ?

Posted on 1997-09-06
1
254 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
bobThere java chalenge 45 89
Expand data scrubbing tool 13 32
bigDiff challenge 17 83
zeroMAx challenge 20 86
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

930 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now