News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

PlaySound volume?

Started by Mark Jones, July 31, 2005, 04:23:14 PM

Previous topic - Next topic

Mark Jones

Is there a way to set the volume of a sound played with PlaySound? Or any alternatives? Thx. :)
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

hitchhikr

No.
Use directsound or the waveOut* stuff.
Browse for examples.

Tedd

I think you'll have to use winmm to set the waveout volume, then play the sound, then put the volume back again.
Which isn't really a nice solution.
No snowflake in an avalanche feels responsible.

thomasantony

Hi,
  I think you can use

mixerOpen
mixerGetControlDetails with MIXER_GETLINECONTROLSF_ONEBYTYPE and MIXER_GETCONTROLDETAILSF_VALUE

and

mixerSetControlDetails with MIXER_GETCONTROLDETAILSF_VALUE
mixerClose

Look it up in MSDN

Thomas :U
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

GregL

Mark,

I know it's not exactly what you wanted to do, but here is an example of setting the speaker volume.



[attachment deleted by admin]

Mark Jones

Cool, thanks for the ideas guys. :)
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

GregL

Mark,

You can set the volume for other devices by changing the constant in this line in the program I posted:

mov eax, MIXERLINE_COMPONENTTYPE_DST_SPEAKERS   ; Set device to work with here


Constants for other devices:

MIXERLINE_COMPONENTTYPE_DST_SPEAKERS     = Speakers
MIXERLINE_COMPONENTTYPE_DST_LINE         = Line Out
MIXERLINE_COMPONENTTYPE_SRC_LINE         = Line In
MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE   = Mic In
MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC  = CD In
MIXERLINE_COMPONENTTYPE_DST_WAVEIN       = Wave In (ADC)
MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT      = Wave Out (DAC)


You can also set bass, treble, balance etc.

Audio Mixers