Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Comment régler le son ?

4 réponses
Avatar
Joseph PUSZTAY
Comment régler le son ?

Bonjour mes amis,

Prologue :
J'ai déjà posté la question, et j'ai eu quelques réponses avisées, dans le
genre "va voir là-bas", ou "attrape cette API", quand on ne me met pas
simplement un hyperlien...
Certes! Mais comme je n'ai pas de doc d'API (pas ma faute, c'est plus
édité), et puis, faut dire que je parle français, oui je sais en France
c'est pas normal, je devrais pas c'est ma faute, mais je parle français
seulement, alors si la doc est écrite en chinois, évidemment, je ne suis pas
plus avancé, ou si peu...

Chapitre I : Passons à la question :
Je voudrais tester le son, et si = 0, proposer de l'augmenter (je parle du
son n'est-ce pas), et suivant la réponse, sortir ou augmenter le son (c'est
pour une alarme, c'est mieux si on l'entend)...

Epilogue :
Si vous voulez bien m'envoyer (à cause de ce qui est susdit dans le
prologue), le code susceptible de fonctionner, vous serez bien aimable,
c'est-à-dire :
Les 2 api + les constantes et variables + le mode d'emploi ou un exemple,
car je n'y connais rien en son...

Merci beaucoup, au revoir et à bientôt.

Joe.

4 réponses

Avatar
François Picalausa
Bonjour/soir,

Essaye comme ceci:
'Dans un form : form1
' une textbox : text1
' un commandbutton : command1
' caption = "récupérer le volume"
' un commandbutton : command2
' caption = "définir le volume"
Option Explicit

Private Sub Command1_Click()
Dim vol As myVolume
vol = Module1.GetVolume
Text1.Text = vol.Volume
End Sub

Private Sub Command2_Click()
SetVolume (CLng(Text1.Text))
End Sub

'Dans un module : module1
'(je sais que tu n'aimes pas les modules séparés mais vu la taille du code,
'il me semble judicieux de séparer ces fonctions pour la lisibilité.)
Option Explicit

Private Const MIXER_SETCONTROLDETAILSF_VALUE = &H0&
Private Const MIXER_GETCONTROLDETAILSF_VALUE = &H0&
Private Const MIXER_OBJECTF_MIXER = &H0&
Private Const MMSYSERR_NOERROR = 0
Private Const MAXPNAMELEN = 32
Private Const MIXER_LONG_NAME_CHARS = 64
Private Const MIXER_SHORT_NAME_CHARS = 16
Private Const MIXER_GETLINEINFOF_COMPONENTTYPE = &H3&
Private Const MIXER_GETLINECONTROLSF_ONEBYTYPE = &H2&
Private Const MIXERLINE_COMPONENTTYPE_DST_FIRST = &H0&
Private Const MIXERLINE_COMPONENTTYPE_SRC_FIRST = &H1000&

Private Const MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = _
(MIXERLINE_COMPONENTTYPE_DST_FIRST + 4)

Private Const MIXERCONTROL_CT_CLASS_FADER = &H50000000
Private Const MIXERCONTROL_CT_UNITS_UNSIGNED = &H30000

Private Const MIXERCONTROL_CONTROLTYPE_FADER = _
(MIXERCONTROL_CT_CLASS_FADER Or _
MIXERCONTROL_CT_UNITS_UNSIGNED)

Private Const MIXERCONTROL_CONTROLTYPE_VOLUME = _
(MIXERCONTROL_CONTROLTYPE_FADER + 1)

Private Declare Function mixerClose _
Lib "winmm.dll" ( _
ByVal hmx As Long _
) As Long

Private Declare Function mixerGetControlDetails _
Lib "winmm.dll" _
Alias "mixerGetControlDetailsA" ( _
ByVal hmxobj As Long, _
pmxcd As MIXERCONTROLDETAILS, _
ByVal fdwDetails As Long _
) As Long

Private Declare Function mixerGetLineControls _
Lib "winmm.dll" _
Alias "mixerGetLineControlsA" ( _
ByVal hmxobj As Long, _
pmxlc As MIXERLINECONTROLS, _
ByVal fdwControls As Long _
) As Long

Private Declare Function mixerGetLineInfo _
Lib "winmm.dll" _
Alias "mixerGetLineInfoA" ( _
ByVal hmxobj As Long, _
pmxl As MIXERLINE, _
ByVal fdwInfo As Long _
) As Long

Private Declare Function mixerOpen _
Lib "winmm.dll" ( _
phmx As Long, _
ByVal uMxId As Long, _
ByVal dwCallback As Long, _
ByVal dwInstance As Long, _
ByVal fdwOpen As Long _
) As Long

Private Declare Function mixerSetControlDetails _
Lib "winmm.dll" ( _
ByVal hmxobj As Long, _
pmxcd As MIXERCONTROLDETAILS, _
ByVal fdwDetails As Long _
) As Long

Private Type MIXERCAPS
wMid As Integer ' manufacturer id
wPid As Integer ' product id
vDriverVersion As Long ' version of the driver
szPname As String * MAXPNAMELEN ' product name
fdwSupport As Long ' misc. support bits
cDestinations As Long ' count of destinations
End Type

Private Type MIXERCONTROL
cbStruct As Long ' size in Byte of MIXERCONTROL
dwControlID As Long ' unique control id for mixer device
dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_xxx
fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx
cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULTIPLE set
szShortName As String * MIXER_SHORT_NAME_CHARS ' short name of control
szName As String * MIXER_LONG_NAME_CHARS ' long name of control
lMinimum As Long ' Minimum value
lMaximum As Long ' Maximum value
reserved(10) As Long ' reserved structure space
End Type

Private Type MIXERCONTROLDETAILS
cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS
dwControlID As Long ' control id to get/set details on
cChannels As Long ' number of channels in paDetails array
item As Long ' hwndOwner or cMultipleItems
cbDetails As Long ' size of _one_ details_XX struct
paDetails As Long ' pointer to array of details_XX structs
End Type

Private Type MIXERCONTROLDETAILS_UNSIGNED
dwValue As Long ' value of the control
End Type

Private Type MIXERLINE
cbStruct As Long ' size of MIXERLINE structure
dwDestination As Long ' zero based destination index
dwSource As Long ' zero based source index (if source)
dwLineID As Long ' unique line id for mixer device
fdwLine As Long ' state/information about line
dwUser As Long ' driver specific information
dwComponentType As Long ' component type line connects to
cChannels As Long ' number of channels line supports
cConnections As Long ' number of connections (possible)
cControls As Long ' number of controls at this line
szShortName As String * MIXER_SHORT_NAME_CHARS
szName As String * MIXER_LONG_NAME_CHARS
dwType As Long
dwDeviceID As Long
wMid As Integer
wPid As Integer
vDriverVersion As Long
szPname As String * MAXPNAMELEN
End Type

Private Type MIXERLINECONTROLS
cbStruct As Long ' size in Byte of MIXERLINECONTROLS
dwLineID As Long ' line id (from MIXERLINE.dwLineID)
' MIXER_GETLINECONTROLSF_ONEBYID or
dwControl As Long ' MIXER_GETLINECONTROLSF_ONEBYTYPE
cControls As Long ' count of controls pmxctrl points to
cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL
pamxctrl As Long ' pointer to first MIXERCONTROL array
End Type

Type myVolume
Min As Long
Max As Long
Volume As Long
End Type

Function GetVolume() As myVolume
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED

If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR
Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS

If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then

mxlc.cbStruct = Len(mxlc)
mxlc.dwLineID = mxl.dwLineID
mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME
mxlc.cControls = 1
mxlc.cbmxctrl = Len(mxc)
mxlc.pamxctrl = VarPtr(mxc)
mxc.cbStruct = Len(mxc)

If mixerGetLineControls(hMixer, _
mxlc, _
MIXER_GETLINECONTROLSF_ONEBYTYPE) _
= MMSYSERR_NOERROR Then

GetVolume.Max = mxc.lMaximum
GetVolume.Min = mxc.lMinimum

mxcd.dwControlID = mxc.dwControlID
mxcd.cbStruct = Len(mxcd)
mxcd.item = 0
mxcd.cbDetails = Len(mxcdu)
mxcd.paDetails = VarPtr(mxcdu)
mxcd.cChannels = 1
If mixerGetControlDetails(hMixer, _
mxcd, _
MIXER_GETCONTROLDETAILSF_VALUE) _
= MMSYSERR_NOERROR Then
GetVolume.Volume = mxcdu.dwValue
End If
End If
End If

mixerClose hMixer
End If
End Function

Sub SetVolume(NewVolume As Long)
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED

If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR
Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS

If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then

mxlc.cbStruct = Len(mxlc)
mxlc.dwLineID = mxl.dwLineID
mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME
mxlc.cControls = 1
mxlc.cbmxctrl = Len(mxc)
mxlc.pamxctrl = VarPtr(mxc)
mxc.cbStruct = Len(mxc)

If mixerGetLineControls(hMixer, _
mxlc, _
MIXER_GETLINECONTROLSF_ONEBYTYPE) _
= MMSYSERR_NOERROR Then

GetVolume.Max = mxc.lMaximum
GetVolume.Min = mxc.lMinimum

mxcd.dwControlID = mxc.dwControlID
mxcd.cbStruct = Len(mxcd)
mxcd.item = 0
mxcd.cbDetails = Len(mxcdu)
mxcd.paDetails = VarPtr(mxcdu)
mxcd.cChannels = 1
mxcdu.dwValue = NewVolume

mixerSetControlDetails hMixer, _
mxcd, _
MIXER_SETCONTROLDETAILSF_VALUE
End If
End If

mixerClose hMixer
End If
End Sub

--
François Picalausa (MVP VB)
FAQ VB : http://faq.vb.free.fr
MSDN : http://msdn.microsoft.com


Joseph PUSZTAY wrote:
Comment régler le son ?

Bonjour mes amis,

Prologue :
J'ai déjà posté la question, et j'ai eu quelques réponses avisées,
dans le genre "va voir là-bas", ou "attrape cette API", quand on ne
me met pas simplement un hyperlien...
Certes! Mais comme je n'ai pas de doc d'API (pas ma faute, c'est plus
édité), et puis, faut dire que je parle français, oui je sais en
France c'est pas normal, je devrais pas c'est ma faute, mais je parle
français seulement, alors si la doc est écrite en chinois,
évidemment, je ne suis pas plus avancé, ou si peu...

Chapitre I : Passons à la question :
Je voudrais tester le son, et si = 0, proposer de l'augmenter (je
parle du son n'est-ce pas), et suivant la réponse, sortir ou
augmenter le son (c'est pour une alarme, c'est mieux si on
l'entend)...

Epilogue :
Si vous voulez bien m'envoyer (à cause de ce qui est susdit dans le
prologue), le code susceptible de fonctionner, vous serez bien
aimable, c'est-à-dire :
Les 2 api + les constantes et variables + le mode d'emploi ou un
exemple, car je n'y connais rien en son...

Merci beaucoup, au revoir et à bientôt.

Joe.


Avatar
François Picalausa
Bonjour/soir,

Essaye de le mettre à Min du Type MyVolume retourné par GetVolume...
Peut-être que...
Tu peux vérifier l'évolution du volume via le "controle du volume" de
windows...

Sinon, je veux bien essayer de changer la valeur de la case "muet"...

--
François Picalausa (MVP VB)
FAQ VB : http://faq.vb.free.fr
MSDN : http://msdn.microsoft.com


Joseph PUSZTAY wrote:
Merci François, ça marche, qui aurait crus qu'avec si peu de code on
puisse augmenter ou diminuer le volume...
Cependant, quand je mets à 0 avec le code ou le curseur, le son n'est
pas à 0 car je l'entend, à moins qu'il faille aller dans les négatifs?
@+, bye, Joe.
----------------

"François Picalausa" a écrit dans le message de
news:
Bonjour/soir,

Essaye comme ceci:
'Dans un form : form1
' une textbox : text1
' un commandbutton : command1
' caption = "récupérer le volume"
' un commandbutton : command2
' caption = "définir le volume"
Option Explicit

Private Sub Command1_Click()
Dim vol As myVolume
vol = Module1.GetVolume
Text1.Text = vol.Volume
End Sub

Private Sub Command2_Click()
SetVolume (CLng(Text1.Text))
End Sub

'Dans un module : module1
'(je sais que tu n'aimes pas les modules séparés mais vu la taille
du code, 'il me semble judicieux de séparer ces fonctions pour la
lisibilité.) Option Explicit

Private Const MIXER_SETCONTROLDETAILSF_VALUE = &H0&
Private Const MIXER_GETCONTROLDETAILSF_VALUE = &H0&
Private Const MIXER_OBJECTF_MIXER = &H0&
Private Const MMSYSERR_NOERROR = 0
Private Const MAXPNAMELEN = 32
Private Const MIXER_LONG_NAME_CHARS = 64
Private Const MIXER_SHORT_NAME_CHARS = 16
Private Const MIXER_GETLINEINFOF_COMPONENTTYPE = &H3&
Private Const MIXER_GETLINECONTROLSF_ONEBYTYPE = &H2&
Private Const MIXERLINE_COMPONENTTYPE_DST_FIRST = &H0&
Private Const MIXERLINE_COMPONENTTYPE_SRC_FIRST = &H1000&

Private Const MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = _
(MIXERLINE_COMPONENTTYPE_DST_FIRST + 4)

Private Const MIXERCONTROL_CT_CLASS_FADER = &H50000000
Private Const MIXERCONTROL_CT_UNITS_UNSIGNED = &H30000

Private Const MIXERCONTROL_CONTROLTYPE_FADER = _
(MIXERCONTROL_CT_CLASS_FADER Or _
MIXERCONTROL_CT_UNITS_UNSIGNED)

Private Const MIXERCONTROL_CONTROLTYPE_VOLUME = _
(MIXERCONTROL_CONTROLTYPE_FADER + 1)

Private Declare Function mixerClose _
Lib "winmm.dll" ( _
ByVal hmx As Long _
) As Long

Private Declare Function mixerGetControlDetails _
Lib "winmm.dll" _
Alias "mixerGetControlDetailsA" ( _
ByVal hmxobj As Long, _
pmxcd As MIXERCONTROLDETAILS, _
ByVal fdwDetails As Long _
) As Long

Private Declare Function mixerGetLineControls _
Lib "winmm.dll" _
Alias "mixerGetLineControlsA" ( _
ByVal hmxobj As Long, _
pmxlc As MIXERLINECONTROLS, _
ByVal fdwControls As Long _
) As Long

Private Declare Function mixerGetLineInfo _
Lib "winmm.dll" _
Alias "mixerGetLineInfoA" ( _
ByVal hmxobj As Long, _
pmxl As MIXERLINE, _
ByVal fdwInfo As Long _
) As Long

Private Declare Function mixerOpen _
Lib "winmm.dll" ( _
phmx As Long, _
ByVal uMxId As Long, _
ByVal dwCallback As Long, _
ByVal dwInstance As Long, _
ByVal fdwOpen As Long _
) As Long

Private Declare Function mixerSetControlDetails _
Lib "winmm.dll" ( _
ByVal hmxobj As Long, _
pmxcd As MIXERCONTROLDETAILS, _
ByVal fdwDetails As Long _
) As Long

Private Type MIXERCAPS
wMid As Integer ' manufacturer id
wPid As Integer ' product id
vDriverVersion As Long ' version of the driver
szPname As String * MAXPNAMELEN ' product name
fdwSupport As Long ' misc. support bits
cDestinations As Long ' count of destinations
End Type

Private Type MIXERCONTROL
cbStruct As Long ' size in Byte of MIXERCONTROL
dwControlID As Long ' unique control id for mixer device
dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_xxx
fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx
cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULTIPLE
set szShortName As String * MIXER_SHORT_NAME_CHARS ' short name
of control szName As String * MIXER_LONG_NAME_CHARS '
long name of control lMinimum As Long ' Minimum value
lMaximum As Long ' Maximum value
reserved(10) As Long ' reserved structure space
End Type

Private Type MIXERCONTROLDETAILS
cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS
dwControlID As Long ' control id to get/set details on
cChannels As Long ' number of channels in paDetails array
item As Long ' hwndOwner or cMultipleItems
cbDetails As Long ' size of _one_ details_XX struct
paDetails As Long ' pointer to array of details_XX structs
End Type

Private Type MIXERCONTROLDETAILS_UNSIGNED
dwValue As Long ' value of the control
End Type

Private Type MIXERLINE
cbStruct As Long ' size of MIXERLINE structure
dwDestination As Long ' zero based destination index
dwSource As Long ' zero based source index (if
source) dwLineID As Long ' unique line id for
mixer device fdwLine As Long ' state/information
about line dwUser As Long ' driver specific
information dwComponentType As Long ' component type
line connects to cChannels As Long ' number of
channels line supports cConnections As Long ' number
of connections (possible) cControls As Long '
number of controls at this line szShortName As String *
MIXER_SHORT_NAME_CHARS szName As String * MIXER_LONG_NAME_CHARS
dwType As Long
dwDeviceID As Long
wMid As Integer
wPid As Integer
vDriverVersion As Long
szPname As String * MAXPNAMELEN
End Type

Private Type MIXERLINECONTROLS
cbStruct As Long ' size in Byte of MIXERLINECONTROLS
dwLineID As Long ' line id (from MIXERLINE.dwLineID)
' MIXER_GETLINECONTROLSF_ONEBYID or
dwControl As Long ' MIXER_GETLINECONTROLSF_ONEBYTYPE
cControls As Long ' count of controls pmxctrl points to
cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL
pamxctrl As Long ' pointer to first MIXERCONTROL array
End Type

Type myVolume
Min As Long
Max As Long
Volume As Long
End Type

Function GetVolume() As myVolume
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED

If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) >> MMSYSERR_NOERROR Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS

If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then

mxlc.cbStruct = Len(mxlc)
mxlc.dwLineID = mxl.dwLineID
mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME
mxlc.cControls = 1
mxlc.cbmxctrl = Len(mxc)
mxlc.pamxctrl = VarPtr(mxc)
mxc.cbStruct = Len(mxc)

If mixerGetLineControls(hMixer, _
mxlc, _
MIXER_GETLINECONTROLSF_ONEBYTYPE) _
= MMSYSERR_NOERROR Then

GetVolume.Max = mxc.lMaximum
GetVolume.Min = mxc.lMinimum

mxcd.dwControlID = mxc.dwControlID
mxcd.cbStruct = Len(mxcd)
mxcd.item = 0
mxcd.cbDetails = Len(mxcdu)
mxcd.paDetails = VarPtr(mxcdu)
mxcd.cChannels = 1
If mixerGetControlDetails(hMixer, _
mxcd, _
MIXER_GETCONTROLDETAILSF_VALUE) _
= MMSYSERR_NOERROR Then
GetVolume.Volume = mxcdu.dwValue
End If
End If
End If

mixerClose hMixer
End If
End Function

Sub SetVolume(NewVolume As Long)
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED

If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) >> MMSYSERR_NOERROR Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS

If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then

mxlc.cbStruct = Len(mxlc)
mxlc.dwLineID = mxl.dwLineID
mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME
mxlc.cControls = 1
mxlc.cbmxctrl = Len(mxc)
mxlc.pamxctrl = VarPtr(mxc)
mxc.cbStruct = Len(mxc)

If mixerGetLineControls(hMixer, _
mxlc, _
MIXER_GETLINECONTROLSF_ONEBYTYPE) _
= MMSYSERR_NOERROR Then

GetVolume.Max = mxc.lMaximum
GetVolume.Min = mxc.lMinimum

mxcd.dwControlID = mxc.dwControlID
mxcd.cbStruct = Len(mxcd)
mxcd.item = 0
mxcd.cbDetails = Len(mxcdu)
mxcd.paDetails = VarPtr(mxcdu)
mxcd.cChannels = 1
mxcdu.dwValue = NewVolume

mixerSetControlDetails hMixer, _
mxcd, _
MIXER_SETCONTROLDETAILSF_VALUE
End If
End If

mixerClose hMixer
End If
End Sub

--
François Picalausa (MVP VB)
FAQ VB : http://faq.vb.free.fr
MSDN : http://msdn.microsoft.com


Joseph PUSZTAY wrote:
Comment régler le son ?

Bonjour mes amis,

Prologue :
J'ai déjà posté la question, et j'ai eu quelques réponses avisées,
dans le genre "va voir là-bas", ou "attrape cette API", quand on ne
me met pas simplement un hyperlien...
Certes! Mais comme je n'ai pas de doc d'API (pas ma faute, c'est
plus édité), et puis, faut dire que je parle français, oui je sais
en
France c'est pas normal, je devrais pas c'est ma faute, mais je
parle français seulement, alors si la doc est écrite en chinois,
évidemment, je ne suis pas plus avancé, ou si peu...

Chapitre I : Passons à la question :
Je voudrais tester le son, et si = 0, proposer de l'augmenter (je
parle du son n'est-ce pas), et suivant la réponse, sortir ou
augmenter le son (c'est pour une alarme, c'est mieux si on
l'entend)...

Epilogue :
Si vous voulez bien m'envoyer (à cause de ce qui est susdit dans le
prologue), le code susceptible de fonctionner, vous serez bien
aimable, c'est-à-dire :
Les 2 api + les constantes et variables + le mode d'emploi ou un
exemple, car je n'y connais rien en son...

Merci beaucoup, au revoir et à bientôt.

Joe.






Avatar
Joseph PUSZTAY
Merci François, ça marche, qui aurait crus qu'avec si peu de code on puisse
augmenter ou diminuer le volume...
Cependant, quand je mets à 0 avec le code ou le curseur, le son n'est pas à
0 car je l'entend, à moins qu'il faille aller dans les négatifs?
@+, bye, Joe.
----------------

"François Picalausa" a écrit dans le message de
news:
Bonjour/soir,

Essaye comme ceci:
'Dans un form : form1
' une textbox : text1
' un commandbutton : command1
' caption = "récupérer le volume"
' un commandbutton : command2
' caption = "définir le volume"
Option Explicit

Private Sub Command1_Click()
Dim vol As myVolume
vol = Module1.GetVolume
Text1.Text = vol.Volume
End Sub

Private Sub Command2_Click()
SetVolume (CLng(Text1.Text))
End Sub

'Dans un module : module1
'(je sais que tu n'aimes pas les modules séparés mais vu la taille du


code,
'il me semble judicieux de séparer ces fonctions pour la lisibilité.)
Option Explicit

Private Const MIXER_SETCONTROLDETAILSF_VALUE = &H0&
Private Const MIXER_GETCONTROLDETAILSF_VALUE = &H0&
Private Const MIXER_OBJECTF_MIXER = &H0&
Private Const MMSYSERR_NOERROR = 0
Private Const MAXPNAMELEN = 32
Private Const MIXER_LONG_NAME_CHARS = 64
Private Const MIXER_SHORT_NAME_CHARS = 16
Private Const MIXER_GETLINEINFOF_COMPONENTTYPE = &H3&
Private Const MIXER_GETLINECONTROLSF_ONEBYTYPE = &H2&
Private Const MIXERLINE_COMPONENTTYPE_DST_FIRST = &H0&
Private Const MIXERLINE_COMPONENTTYPE_SRC_FIRST = &H1000&

Private Const MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = _
(MIXERLINE_COMPONENTTYPE_DST_FIRST + 4)

Private Const MIXERCONTROL_CT_CLASS_FADER = &H50000000
Private Const MIXERCONTROL_CT_UNITS_UNSIGNED = &H30000

Private Const MIXERCONTROL_CONTROLTYPE_FADER = _
(MIXERCONTROL_CT_CLASS_FADER Or _
MIXERCONTROL_CT_UNITS_UNSIGNED)

Private Const MIXERCONTROL_CONTROLTYPE_VOLUME = _
(MIXERCONTROL_CONTROLTYPE_FADER + 1)

Private Declare Function mixerClose _
Lib "winmm.dll" ( _
ByVal hmx As Long _
) As Long

Private Declare Function mixerGetControlDetails _
Lib "winmm.dll" _
Alias "mixerGetControlDetailsA" ( _
ByVal hmxobj As Long, _
pmxcd As MIXERCONTROLDETAILS, _
ByVal fdwDetails As Long _
) As Long

Private Declare Function mixerGetLineControls _
Lib "winmm.dll" _
Alias "mixerGetLineControlsA" ( _
ByVal hmxobj As Long, _
pmxlc As MIXERLINECONTROLS, _
ByVal fdwControls As Long _
) As Long

Private Declare Function mixerGetLineInfo _
Lib "winmm.dll" _
Alias "mixerGetLineInfoA" ( _
ByVal hmxobj As Long, _
pmxl As MIXERLINE, _
ByVal fdwInfo As Long _
) As Long

Private Declare Function mixerOpen _
Lib "winmm.dll" ( _
phmx As Long, _
ByVal uMxId As Long, _
ByVal dwCallback As Long, _
ByVal dwInstance As Long, _
ByVal fdwOpen As Long _
) As Long

Private Declare Function mixerSetControlDetails _
Lib "winmm.dll" ( _
ByVal hmxobj As Long, _
pmxcd As MIXERCONTROLDETAILS, _
ByVal fdwDetails As Long _
) As Long

Private Type MIXERCAPS
wMid As Integer ' manufacturer id
wPid As Integer ' product id
vDriverVersion As Long ' version of the driver
szPname As String * MAXPNAMELEN ' product name
fdwSupport As Long ' misc. support bits
cDestinations As Long ' count of destinations
End Type

Private Type MIXERCONTROL
cbStruct As Long ' size in Byte of MIXERCONTROL
dwControlID As Long ' unique control id for mixer device
dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_xxx
fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx
cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULTIPLE set
szShortName As String * MIXER_SHORT_NAME_CHARS ' short name of


control
szName As String * MIXER_LONG_NAME_CHARS ' long name of control
lMinimum As Long ' Minimum value
lMaximum As Long ' Maximum value
reserved(10) As Long ' reserved structure space
End Type

Private Type MIXERCONTROLDETAILS
cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS
dwControlID As Long ' control id to get/set details on
cChannels As Long ' number of channels in paDetails array
item As Long ' hwndOwner or cMultipleItems
cbDetails As Long ' size of _one_ details_XX struct
paDetails As Long ' pointer to array of details_XX structs
End Type

Private Type MIXERCONTROLDETAILS_UNSIGNED
dwValue As Long ' value of the control
End Type

Private Type MIXERLINE
cbStruct As Long ' size of MIXERLINE structure
dwDestination As Long ' zero based destination index
dwSource As Long ' zero based source index (if source)
dwLineID As Long ' unique line id for mixer device
fdwLine As Long ' state/information about line
dwUser As Long ' driver specific information
dwComponentType As Long ' component type line connects to
cChannels As Long ' number of channels line supports
cConnections As Long ' number of connections (possible)
cControls As Long ' number of controls at this line
szShortName As String * MIXER_SHORT_NAME_CHARS
szName As String * MIXER_LONG_NAME_CHARS
dwType As Long
dwDeviceID As Long
wMid As Integer
wPid As Integer
vDriverVersion As Long
szPname As String * MAXPNAMELEN
End Type

Private Type MIXERLINECONTROLS
cbStruct As Long ' size in Byte of MIXERLINECONTROLS
dwLineID As Long ' line id (from MIXERLINE.dwLineID)
' MIXER_GETLINECONTROLSF_ONEBYID or
dwControl As Long ' MIXER_GETLINECONTROLSF_ONEBYTYPE
cControls As Long ' count of controls pmxctrl points to
cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL
pamxctrl As Long ' pointer to first MIXERCONTROL array
End Type

Type myVolume
Min As Long
Max As Long
Volume As Long
End Type

Function GetVolume() As myVolume
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED

If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR
Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS

If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then

mxlc.cbStruct = Len(mxlc)
mxlc.dwLineID = mxl.dwLineID
mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME
mxlc.cControls = 1
mxlc.cbmxctrl = Len(mxc)
mxlc.pamxctrl = VarPtr(mxc)
mxc.cbStruct = Len(mxc)

If mixerGetLineControls(hMixer, _
mxlc, _
MIXER_GETLINECONTROLSF_ONEBYTYPE) _
= MMSYSERR_NOERROR Then

GetVolume.Max = mxc.lMaximum
GetVolume.Min = mxc.lMinimum

mxcd.dwControlID = mxc.dwControlID
mxcd.cbStruct = Len(mxcd)
mxcd.item = 0
mxcd.cbDetails = Len(mxcdu)
mxcd.paDetails = VarPtr(mxcdu)
mxcd.cChannels = 1
If mixerGetControlDetails(hMixer, _
mxcd, _
MIXER_GETCONTROLDETAILSF_VALUE) _
= MMSYSERR_NOERROR Then
GetVolume.Volume = mxcdu.dwValue
End If
End If
End If

mixerClose hMixer
End If
End Function

Sub SetVolume(NewVolume As Long)
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED

If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR
Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS

If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then

mxlc.cbStruct = Len(mxlc)
mxlc.dwLineID = mxl.dwLineID
mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME
mxlc.cControls = 1
mxlc.cbmxctrl = Len(mxc)
mxlc.pamxctrl = VarPtr(mxc)
mxc.cbStruct = Len(mxc)

If mixerGetLineControls(hMixer, _
mxlc, _
MIXER_GETLINECONTROLSF_ONEBYTYPE) _
= MMSYSERR_NOERROR Then

GetVolume.Max = mxc.lMaximum
GetVolume.Min = mxc.lMinimum

mxcd.dwControlID = mxc.dwControlID
mxcd.cbStruct = Len(mxcd)
mxcd.item = 0
mxcd.cbDetails = Len(mxcdu)
mxcd.paDetails = VarPtr(mxcdu)
mxcd.cChannels = 1
mxcdu.dwValue = NewVolume

mixerSetControlDetails hMixer, _
mxcd, _
MIXER_SETCONTROLDETAILSF_VALUE
End If
End If

mixerClose hMixer
End If
End Sub

--
François Picalausa (MVP VB)
FAQ VB : http://faq.vb.free.fr
MSDN : http://msdn.microsoft.com


Joseph PUSZTAY wrote:
> Comment régler le son ?
>
> Bonjour mes amis,
>
> Prologue :
> J'ai déjà posté la question, et j'ai eu quelques réponses avisées,
> dans le genre "va voir là-bas", ou "attrape cette API", quand on ne
> me met pas simplement un hyperlien...
> Certes! Mais comme je n'ai pas de doc d'API (pas ma faute, c'est plus
> édité), et puis, faut dire que je parle français, oui je sais en
> France c'est pas normal, je devrais pas c'est ma faute, mais je parle
> français seulement, alors si la doc est écrite en chinois,
> évidemment, je ne suis pas plus avancé, ou si peu...
>
> Chapitre I : Passons à la question :
> Je voudrais tester le son, et si = 0, proposer de l'augmenter (je
> parle du son n'est-ce pas), et suivant la réponse, sortir ou
> augmenter le son (c'est pour une alarme, c'est mieux si on
> l'entend)...
>
> Epilogue :
> Si vous voulez bien m'envoyer (à cause de ce qui est susdit dans le
> prologue), le code susceptible de fonctionner, vous serez bien
> aimable, c'est-à-dire :
> Les 2 api + les constantes et variables + le mode d'emploi ou un
> exemple, car je n'y connais rien en son...
>
> Merci beaucoup, au revoir et à bientôt.
>
> Joe.




Avatar
Joseph PUSZTAY
Oui, j'ai essayé de régler avec la valeur, mais 0 ça s'entend encore
faiblement...
---------------------


"François Picalausa" a écrit dans le message de
news:
Bonjour/soir,

Essaye de le mettre à Min du Type MyVolume retourné par GetVolume...
Peut-être que...
Tu peux vérifier l'évolution du volume via le "controle du volume" de
windows...

Sinon, je veux bien essayer de changer la valeur de la case "muet"...

--
François Picalausa (MVP VB)
FAQ VB : http://faq.vb.free.fr
MSDN : http://msdn.microsoft.com


Joseph PUSZTAY wrote:
> Merci François, ça marche, qui aurait crus qu'avec si peu de code on
> puisse augmenter ou diminuer le volume...
> Cependant, quand je mets à 0 avec le code ou le curseur, le son n'est
> pas à 0 car je l'entend, à moins qu'il faille aller dans les négatifs?
> @+, bye, Joe.
> ----------------
>
> "François Picalausa" a écrit dans le message de
> news:
>> Bonjour/soir,
>>
>> Essaye comme ceci:
>> 'Dans un form : form1
>> ' une textbox : text1
>> ' un commandbutton : command1
>> ' caption = "récupérer le volume"
>> ' un commandbutton : command2
>> ' caption = "définir le volume"
>> Option Explicit
>>
>> Private Sub Command1_Click()
>> Dim vol As myVolume
>> vol = Module1.GetVolume
>> Text1.Text = vol.Volume
>> End Sub
>>
>> Private Sub Command2_Click()
>> SetVolume (CLng(Text1.Text))
>> End Sub
>>
>> 'Dans un module : module1
>> '(je sais que tu n'aimes pas les modules séparés mais vu la taille
>> du code, 'il me semble judicieux de séparer ces fonctions pour la
>> lisibilité.) Option Explicit
>>
>> Private Const MIXER_SETCONTROLDETAILSF_VALUE = &H0&
>> Private Const MIXER_GETCONTROLDETAILSF_VALUE = &H0&
>> Private Const MIXER_OBJECTF_MIXER = &H0&
>> Private Const MMSYSERR_NOERROR = 0
>> Private Const MAXPNAMELEN = 32
>> Private Const MIXER_LONG_NAME_CHARS = 64
>> Private Const MIXER_SHORT_NAME_CHARS = 16
>> Private Const MIXER_GETLINEINFOF_COMPONENTTYPE = &H3&
>> Private Const MIXER_GETLINECONTROLSF_ONEBYTYPE = &H2&
>> Private Const MIXERLINE_COMPONENTTYPE_DST_FIRST = &H0&
>> Private Const MIXERLINE_COMPONENTTYPE_SRC_FIRST = &H1000&
>>
>> Private Const MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = _
>> (MIXERLINE_COMPONENTTYPE_DST_FIRST + 4)
>>
>> Private Const MIXERCONTROL_CT_CLASS_FADER = &H50000000
>> Private Const MIXERCONTROL_CT_UNITS_UNSIGNED = &H30000
>>
>> Private Const MIXERCONTROL_CONTROLTYPE_FADER = _
>> (MIXERCONTROL_CT_CLASS_FADER Or _
>> MIXERCONTROL_CT_UNITS_UNSIGNED)
>>
>> Private Const MIXERCONTROL_CONTROLTYPE_VOLUME = _
>> (MIXERCONTROL_CONTROLTYPE_FADER + 1)
>>
>> Private Declare Function mixerClose _
>> Lib "winmm.dll" ( _
>> ByVal hmx As Long _
>> ) As Long
>>
>> Private Declare Function mixerGetControlDetails _
>> Lib "winmm.dll" _
>> Alias "mixerGetControlDetailsA" ( _
>> ByVal hmxobj As Long, _
>> pmxcd As MIXERCONTROLDETAILS, _
>> ByVal fdwDetails As Long _
>> ) As Long
>>
>> Private Declare Function mixerGetLineControls _
>> Lib "winmm.dll" _
>> Alias "mixerGetLineControlsA" ( _
>> ByVal hmxobj As Long, _
>> pmxlc As MIXERLINECONTROLS, _
>> ByVal fdwControls As Long _
>> ) As Long
>>
>> Private Declare Function mixerGetLineInfo _
>> Lib "winmm.dll" _
>> Alias "mixerGetLineInfoA" ( _
>> ByVal hmxobj As Long, _
>> pmxl As MIXERLINE, _
>> ByVal fdwInfo As Long _
>> ) As Long
>>
>> Private Declare Function mixerOpen _
>> Lib "winmm.dll" ( _
>> phmx As Long, _
>> ByVal uMxId As Long, _
>> ByVal dwCallback As Long, _
>> ByVal dwInstance As Long, _
>> ByVal fdwOpen As Long _
>> ) As Long
>>
>> Private Declare Function mixerSetControlDetails _
>> Lib "winmm.dll" ( _
>> ByVal hmxobj As Long, _
>> pmxcd As MIXERCONTROLDETAILS, _
>> ByVal fdwDetails As Long _
>> ) As Long
>>
>> Private Type MIXERCAPS
>> wMid As Integer ' manufacturer id
>> wPid As Integer ' product id
>> vDriverVersion As Long ' version of the driver
>> szPname As String * MAXPNAMELEN ' product name
>> fdwSupport As Long ' misc. support bits
>> cDestinations As Long ' count of destinations
>> End Type
>>
>> Private Type MIXERCONTROL
>> cbStruct As Long ' size in Byte of MIXERCONTROL
>> dwControlID As Long ' unique control id for mixer device
>> dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_xxx
>> fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx
>> cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULTIPLE
>> set szShortName As String * MIXER_SHORT_NAME_CHARS ' short name
>> of control szName As String * MIXER_LONG_NAME_CHARS '
>> long name of control lMinimum As Long ' Minimum value
>> lMaximum As Long ' Maximum value
>> reserved(10) As Long ' reserved structure space
>> End Type
>>
>> Private Type MIXERCONTROLDETAILS
>> cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS
>> dwControlID As Long ' control id to get/set details on
>> cChannels As Long ' number of channels in paDetails array
>> item As Long ' hwndOwner or cMultipleItems
>> cbDetails As Long ' size of _one_ details_XX struct
>> paDetails As Long ' pointer to array of details_XX structs
>> End Type
>>
>> Private Type MIXERCONTROLDETAILS_UNSIGNED
>> dwValue As Long ' value of the control
>> End Type
>>
>> Private Type MIXERLINE
>> cbStruct As Long ' size of MIXERLINE structure
>> dwDestination As Long ' zero based destination index
>> dwSource As Long ' zero based source index (if
>> source) dwLineID As Long ' unique line id for
>> mixer device fdwLine As Long ' state/information
>> about line dwUser As Long ' driver specific
>> information dwComponentType As Long ' component type
>> line connects to cChannels As Long ' number of
>> channels line supports cConnections As Long ' number
>> of connections (possible) cControls As Long '
>> number of controls at this line szShortName As String *
>> MIXER_SHORT_NAME_CHARS szName As String * MIXER_LONG_NAME_CHARS
>> dwType As Long
>> dwDeviceID As Long
>> wMid As Integer
>> wPid As Integer
>> vDriverVersion As Long
>> szPname As String * MAXPNAMELEN
>> End Type
>>
>> Private Type MIXERLINECONTROLS
>> cbStruct As Long ' size in Byte of MIXERLINECONTROLS
>> dwLineID As Long ' line id (from MIXERLINE.dwLineID)
>> ' MIXER_GETLINECONTROLSF_ONEBYID or
>> dwControl As Long ' MIXER_GETLINECONTROLSF_ONEBYTYPE
>> cControls As Long ' count of controls pmxctrl points to
>> cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL
>> pamxctrl As Long ' pointer to first MIXERCONTROL array
>> End Type
>>
>> Type myVolume
>> Min As Long
>> Max As Long
>> Volume As Long
>> End Type
>>
>> Function GetVolume() As myVolume
>> Dim hMixer As Long
>> Dim mxlc As MIXERLINECONTROLS
>> Dim mxl As MIXERLINE
>> Dim mxc As MIXERCONTROL
>> Dim mxcd As MIXERCONTROLDETAILS
>> Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED
>>
>> If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) > >> MMSYSERR_NOERROR Then
>> mxl.cbStruct = Len(mxl)
>> mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
>>
>> If mixerGetLineInfo(hMixer, _
>> mxl, _
>> MIXER_GETLINEINFOF_COMPONENTTYPE) _
>> = MMSYSERR_NOERROR Then
>>
>> mxlc.cbStruct = Len(mxlc)
>> mxlc.dwLineID = mxl.dwLineID
>> mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME
>> mxlc.cControls = 1
>> mxlc.cbmxctrl = Len(mxc)
>> mxlc.pamxctrl = VarPtr(mxc)
>> mxc.cbStruct = Len(mxc)
>>
>> If mixerGetLineControls(hMixer, _
>> mxlc, _
>> MIXER_GETLINECONTROLSF_ONEBYTYPE) _
>> = MMSYSERR_NOERROR Then
>>
>> GetVolume.Max = mxc.lMaximum
>> GetVolume.Min = mxc.lMinimum
>>
>> mxcd.dwControlID = mxc.dwControlID
>> mxcd.cbStruct = Len(mxcd)
>> mxcd.item = 0
>> mxcd.cbDetails = Len(mxcdu)
>> mxcd.paDetails = VarPtr(mxcdu)
>> mxcd.cChannels = 1
>> If mixerGetControlDetails(hMixer, _
>> mxcd, _
>> MIXER_GETCONTROLDETAILSF_VALUE) _
>> = MMSYSERR_NOERROR Then
>> GetVolume.Volume = mxcdu.dwValue
>> End If
>> End If
>> End If
>>
>> mixerClose hMixer
>> End If
>> End Function
>>
>> Sub SetVolume(NewVolume As Long)
>> Dim hMixer As Long
>> Dim mxlc As MIXERLINECONTROLS
>> Dim mxl As MIXERLINE
>> Dim mxc As MIXERCONTROL
>> Dim mxcd As MIXERCONTROLDETAILS
>> Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED
>>
>> If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) > >> MMSYSERR_NOERROR Then
>> mxl.cbStruct = Len(mxl)
>> mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
>>
>> If mixerGetLineInfo(hMixer, _
>> mxl, _
>> MIXER_GETLINEINFOF_COMPONENTTYPE) _
>> = MMSYSERR_NOERROR Then
>>
>> mxlc.cbStruct = Len(mxlc)
>> mxlc.dwLineID = mxl.dwLineID
>> mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME
>> mxlc.cControls = 1
>> mxlc.cbmxctrl = Len(mxc)
>> mxlc.pamxctrl = VarPtr(mxc)
>> mxc.cbStruct = Len(mxc)
>>
>> If mixerGetLineControls(hMixer, _
>> mxlc, _
>> MIXER_GETLINECONTROLSF_ONEBYTYPE) _
>> = MMSYSERR_NOERROR Then
>>
>> GetVolume.Max = mxc.lMaximum
>> GetVolume.Min = mxc.lMinimum
>>
>> mxcd.dwControlID = mxc.dwControlID
>> mxcd.cbStruct = Len(mxcd)
>> mxcd.item = 0
>> mxcd.cbDetails = Len(mxcdu)
>> mxcd.paDetails = VarPtr(mxcdu)
>> mxcd.cChannels = 1
>> mxcdu.dwValue = NewVolume
>>
>> mixerSetControlDetails hMixer, _
>> mxcd, _
>> MIXER_SETCONTROLDETAILSF_VALUE
>> End If
>> End If
>>
>> mixerClose hMixer
>> End If
>> End Sub
>>
>> --
>> François Picalausa (MVP VB)
>> FAQ VB : http://faq.vb.free.fr
>> MSDN : http://msdn.microsoft.com
>>
>>
>> Joseph PUSZTAY wrote:
>>> Comment régler le son ?
>>>
>>> Bonjour mes amis,
>>>
>>> Prologue :
>>> J'ai déjà posté la question, et j'ai eu quelques réponses avisées,
>>> dans le genre "va voir là-bas", ou "attrape cette API", quand on ne
>>> me met pas simplement un hyperlien...
>>> Certes! Mais comme je n'ai pas de doc d'API (pas ma faute, c'est
>>> plus édité), et puis, faut dire que je parle français, oui je sais
>>> en
>>> France c'est pas normal, je devrais pas c'est ma faute, mais je
>>> parle français seulement, alors si la doc est écrite en chinois,
>>> évidemment, je ne suis pas plus avancé, ou si peu...
>>>
>>> Chapitre I : Passons à la question :
>>> Je voudrais tester le son, et si = 0, proposer de l'augmenter (je
>>> parle du son n'est-ce pas), et suivant la réponse, sortir ou
>>> augmenter le son (c'est pour une alarme, c'est mieux si on
>>> l'entend)...
>>>
>>> Epilogue :
>>> Si vous voulez bien m'envoyer (à cause de ce qui est susdit dans le
>>> prologue), le code susceptible de fonctionner, vous serez bien
>>> aimable, c'est-à-dire :
>>> Les 2 api + les constantes et variables + le mode d'emploi ou un
>>> exemple, car je n'y connais rien en son...
>>>
>>> Merci beaucoup, au revoir et à bientôt.
>>>
>>> Joe.