Volume control etc.

derez

Expert
Licensed User
Longtime User
I have been looking for means to control the volume from the application without success.
the registry has entries under Current_user\controlpanel\volume but these only serve for storing the last volume for the next use, not for real time changes.
I have found a small application that is an independent volume control, which shows that there is a way to do it. It is attached.

Anybody has an idea ?

I think that controlling the screen brightness in real time is a similar problem (without opening the windows form that has the sliding bar).
 

Attachments

  • VolumeCtrl.zip
    9.3 KB · Views: 462

sahoopes

Member
Licensed User
FMOD Library should be able to do that

FMOD is a B4PPC library that wraps the FMODCE library from FMOD.org. Right? According to FMOD.org (FMOD docs) volume control is supported on Win32 and WinCE.

FMUSIC_SetMasterVolume
Sets a songs master volume.

signed char F_API FMUSIC_SetMasterVolume(
FMUSIC_MODULE *mod,
int volume
);


Parameters
mod Pointer to the song to have its master volume set.

volume value from 0-256. 0 = silence, 256 = full volume.
 

Standa

Member
Licensed User
Longtime User
Very interesting - this is last feature what I need for my music player. So, is it possible to include volume control to Fmod for B4ppc?
 

sahoopes

Member
Licensed User
My thoughts were that the overhead for using FMOD is so huge that we should be able to take advantage of as much of that overhead as possible. fmodce.dll from fmod.org is 440 Kb.
 

Cableguy

Expert
Licensed User
Longtime User
Found this on the web after a short search..
 

Louis

Active Member
Licensed User
Longtime User
If you are dealing with the FMOD library then yes we need to somehow wrap the volume class into a Basic4ppc library. However if you are making a fas action game, orneed a wave file lowered in the background, check out the library entitled New Hekkus Sound Library Wrapper, which let's you control all aspects in real-time of wave files. You can even mix them in real-time as well. HTH.
 

esbenr

New Member
I have used this in WM5:

[DllImport("COREDLL")]
public static extern int waveOutSetVolume(IntPtr hMod, int lVolume);

[DllImport("COREDLL")]
public static extern void waveOutGetVolume(IntPtr hMod, IntPtr waveOutVolume);
 
Top