Link to home
Start Free TrialLog in
Avatar of nfcdrummer
nfcdrummerFlag for Australia

asked on

Repeating midi files, and setting midi/sound volume + muting

Well, as well as my last question about INI files, I thought it would be easy to find out how to change midi and sound volume, repeat midi files, and mute the sound / midi.  I cannot find anything on this, so I am asking here.  If anyone can give me some C++Builder example, or just some C++ code on muting and changing volume level, and some code on repeating the midi files (not visual c++ source please), you'd be very helpful!!
Avatar of chensu
chensu
Flag of Canada image

Check out my article at CodeGuru.

Audio Mixer Functions Demo
http://www.codeguru.com/multimedia/ADMixer.shtml

The framework is MFC. But you can extract all the amd* functions for your own use.
Avatar of nfcdrummer

ASKER

Sorry, but this is no use to me - I don't want to change the master volume, only the wave volume and the midi volume, and mute both of these
The article is a tutorial. You just need to change a few parameters.
Alternatively, you may also use the waveOutSetVolume and midiOutSetVolume functions.
well I'll try it out, if I can get it to work I'll award you the points?
sorry Chensu I've tried, but  I can't seem to get it to work... Also I am using C++ Builder 4, not Visual C++ 5... That may  help
All of those multimedia functions are Win32 API functions. Using which compiler doesn't matter. What have you done? What have you got? Are there any error messages?
it says it cannot find some 'win???.h' files...
and also 'missing ,' and 'missing ;' but that was in my Borland C++ 5.02 compiler, not the Builder.

I was also thinking, maybe you could send me a Visual C++ Project file with these procedures used because C++Builder can convert them and that might help

I'll also try something else that I didn't think of before..
You need to include <mmsystem.h> and link with winmm.lib.
well, I'm getting somewhere now, but I'm having trouble... I'm not exactly sure how to use the waveOutSetVolume function...

here is what I'm doing:

if (TempCount == 6) waveOutSetVolume(void, 0x6000);

it gives me error 'E2188: Expression Syntax.'
I seriously don't think this is right... could you give me some help please?

also once I've finished doing the volume settings or have it all written down or memorised I will award you the points as I'm finally working it all out!
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks mate... I spent about 3 hours this morning trying to figure it out and that link was all I needed !!!

laterz

Dave