Solved

Full sound volume ?

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sameEnds challenge 3 107
substring method in java 1 79
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 49
Problem to open Excel file 15 43
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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 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

23 Experts available now in Live!

Get 1:1 Help Now