?API vista - Sons - Obtenir et modifier le volume principale

werdDomain Messages postés 60 Date d'inscription lundi 22 octobre 2007 Statut Membre Dernière intervention 1 novembre 2011 - 22 oct. 2008 à 07:15
gillardg Messages postés 3275 Date d'inscription jeudi 3 avril 2008 Statut Membre Dernière intervention 14 septembre 2014 - 22 oct. 2008 à 15:20
Bonjours, j'aimerais mettre la main sur les api de vista pour contrôler le volume principale ...
J'ai chercher sur le web, peut-être que je n'utilise pas les bon mots chef ...

J'aurais seulement besoin des nom d'api + nom de dll pour le son.

Si il existe des exemples qui montre comment l'utiliser et bien déclarer ces types sa serais pas de refus.
J'ai fait une application qui fonctionne bien sous xp... Mais elle marche pas sous vista...
J'aimerais donc que mon App. fonctionne sous vista :p

Merci.

Ben

5 réponses

cs_loulou69 Messages postés 672 Date d'inscription mercredi 22 janvier 2003 Statut Membre Dernière intervention 2 juin 2016 1
22 oct. 2008 à 10:26
Bonjour 

Il aurait été bon de dire quelles API tu utilises pour trouver de l'aide sur celles que tu n'utilises pas encore.
Je ne suis pas dans le même environnement (ni dev, ni exececution)
As tu recherché Winmm.dll fonction MixerOpen
0
cs_loulou69 Messages postés 672 Date d'inscription mercredi 22 janvier 2003 Statut Membre Dernière intervention 2 juin 2016 1
22 oct. 2008 à 11:02
Je vais faire des tests Vista le plus tot possible dans mon environnement de dev mais sous Vista


peut-être une solution .Net avec DirectX9





http://www.vbcodesource.com/vbNetExamples.php


ou



http://www.codeproject.com/KB/net-languages/DirectSoundJSharp.aspx


 
0
gillardg Messages postés 3275 Date d'inscription jeudi 3 avril 2008 Statut Membre Dernière intervention 14 septembre 2014 2
22 oct. 2008 à 12:34
Bonjour,

pour les Api il y  en  a quelques uns qui diffèrent sur vista je te conseille donc de chercher dans msdn  chaque api que tu  utilises pour connaitre sa compatibilité ou incompatibilité avec vista

en effet chaque api est détaillé dans MSDN .
=> tu peux normalement y acceder à partir de l'aide en ligne de vb

a+
0
werdDomain Messages postés 60 Date d'inscription lundi 22 octobre 2007 Statut Membre Dernière intervention 1 novembre 2011
22 oct. 2008 à 14:02
en premier, jai pas vista, donc je ne peut pas faire les test...
et je ne sait quelle api utiliser, il doit bien avoir un mixer ou une api quelquonque ...
sous xp j'utilise ces api:


Private
Declare
Ansi
Function mixerClose
Lib
"winmm.dll" (
ByVal hmx
As
Integer)
As
Integer









Private





Declare





Ansi





Function

mixerGetControlDetailsA


Lib





"winmm.dll"

(


ByVal

hmxobj


As





Integer

,


ByRef

pmxcd


As

MIXERCONTROLDETAILS,


ByVal

fdwDetails


As





Integer

)


As





Integer








Private





Declare





Ansi





Function

mixerGetDevCapsA


Lib





"winmm.dll"

(


ByVal

uMxId


As





Integer

,


ByVal

pmxcaps


As

MIXERCAPS,


ByVal

cbmxcaps


As





Integer

)


As





Integer








Private





Declare





Ansi





Function

mixerGetID


Lib





"winmm.dll"

(


ByVal

hmxobj


As





Integer

,


ByVal

pumxID


As





Integer

,


ByVal

fdwId


As





Integer

)


As





Integer








Private





Declare





Ansi





Function

mixerGetLineControlsA


Lib





"winmm.dll"

(


ByVal

hmxobj


As





Integer

,


ByRef

pmxlc


As

MIXERLINECONTROLS,


ByVal

fdwControls


As





Integer

)


As





Integer








Private





Declare





Ansi





Function

mixerGetLineInfoA


Lib





"winmm.dll"

(


ByVal

hmxobj


As





Integer

,


ByRef

pmxl


As

MIXERLINE,


ByVal

fdwInfo


As





Integer

)


As





Integer








Private





Declare





Ansi





Function

mixerGetNumDevs


Lib





"winmm.dll"

()


As





Integer








Private





Declare





Ansi





Function

mixerMessage


Lib





"winmm.dll"

(


ByVal

hmx


As





Integer

,


ByVal

uMsg


As





Integer

,


ByVal

dwParam1


As





Integer

,


ByVal

dwParam2


As





Integer

)


As





Integer








Private





Declare





Ansi





Function

mixerOpen


Lib





"winmm.dll"

(


ByRef

phmx


As





Integer

,


ByVal

uMxId


As





Integer

,


ByVal

dwCallback


As





Integer

,


ByVal

dwInstance


As





Integer

,


ByVal

fdwOpen


As





Integer

)


As





Integer








Private





Declare





Ansi





Function

mixerSetControlDetails


Lib





"winmm.dll"

(


ByVal

hmxobj


As





Integer

,


ByRef

pmxcd


As

MIXERCONTROLDETAILS,


ByVal

fdwDetails


As





Integer

)


As





Integer








Private





Declare





Function

mixerGetLineInfo


Lib





"winmm.dll"





Alias





"mixerGetLineInfoA"

(<MarshalAs(UnmanagedType.I4)>


ByVal

hmxobj


As





Integer

,


ByRef

pmxl


As

MIXERLINE,


ByVal

fdwInfo


As





Integer

)


As





Integer








Private





Declare





Function

mixerGetLineControls


Lib





"winmm.dll"





Alias





"mixerGetLineControlsA"

(<MarshalAs(UnmanagedType.I4)>


ByVal

hmxobj


As





Integer

,


ByRef

pmxlc


As

MIXERLINECONTROLS,


ByVal

fdwControls


As





Integer

)


As





Integer


pis les structure :

Private
Structure MIXERCAPS

Public wMid
As
Integer

Public wPid
As
Integer

Public vDriverVersion
As
Integer<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=MAXPNAMELEN)>

Public szPname
As
String

Public fdwSupport
As
Integer

Public cDestinations
As
Integer

End
Structure
'MIXERCAPS_

<StructLayout(LayoutKind.Sequential)> _

Private
Structure MIXERCONTROL<FieldOffset(0)>

Public cbStruct
As
Integer
' size in Byte of MIXERCONTROL<FieldOffset(4)>

Public dwControlID
As
Integer
' unique control id for mixer device<FieldOffset(8)>

Public dwControlType
As
Integer
' MIXERCONTROL_CONTROLTYPE_xxx<FieldOffset(12)>

Public fdwControl
As
Integer
' MIXERCONTROL_CONTROLF_xxx<FieldOffset(16)>

Public cMultipleItems
As
Integer
' if MIXERCONTROL_CONTROLF_MULTIPLE set<FieldOffset(20), MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst:=MIXER_SHORT_NAME_CHARS)>

Public szShortName
As
String
' * MIXER_SHORT_NAME_CHARS ' short name of control<FieldOffset(36), MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst:=MIXER_LONG_NAME_CHARS)>

Public szName
As
String
' * MIXER_LONG_NAME_CHARS ' Integer name of control<FieldOffset(100)>

Public lMinimum
As
Integer
' Minimum value<FieldOffset(104)>

Public lMaximum
As
Integer
' Maximum value<FieldOffset(108), MarshalAs(UnmanagedType.ByValArray, SizeConst:=11, ArraySubType:=UnmanagedType.AsAny)>

Public reserved()
As
Integer
' reserved structure space

End
Structure<StructLayout(LayoutKind.Sequential)> _

Private
Structure MIXERCONTROLDETAILS<FieldOffset(0)>

Public cbStruct
As
Integer
' size in Byte of MIXERCONTROLDETAILS<FieldOffset(4)>

Public dwControlID
As
Integer
' control id to get/set details on<FieldOffset(8)>

Public cChannels
As
Integer
' number of channels in paDetails array<FieldOffset(12)>

Public item
As
Integer
' hwndOwner or cMultipleItems<FieldOffset(16)>

Public cbDetails
As
Integer
' size of _one_ details_XX struct<FieldOffset(20)>

Public paDetails
As IntPtr
' pointer to array of details_XX structs

End
Structure<StructLayout(LayoutKind.Sequential)> _

Private
Structure MIXERCONTROLDETAILS_UNSIGNED<FieldOffset(0)>

Public dwValue
As
Integer
' value of the control

End
Structure<StructLayout(LayoutKind.Sequential)> _

Private
Structure MIXERLINE<FieldOffset(0)>

Public cbStruct
As
Integer
' size of MIXERLINE structure<FieldOffset(4)>

Public dwDestination
As
Integer
' zero based destination index<FieldOffset(8)>

Public dwSource
As
Integer
' zero based source index (if source)<FieldOffset(12)>

Public dwLineID
As
Integer
' unique line id for mixer device<FieldOffset(16)>

Public fdwLine
As
Integer
' state/information about line<FieldOffset(20)>

Public dwUser
As
Integer
' driver specific information<FieldOffset(24)>

Public dwComponentType
As
Integer
' component type line connects to<FieldOffset(28)>

Public cChannels
As
Integer
' number of channels line supports<FieldOffset(32)>

Public cConnections
As
Integer
' number of connections (possible)<FieldOffset(36)>

Public cControls
As
Integer
' number of controls at this line<FieldOffset(40), MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst:=MIXER_SHORT_NAME_CHARS)>

Public szShortName
As
String
' * MIXER_SHORT_NAME_CHARS<FieldOffset(56), MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst:=MIXER_LONG_NAME_CHARS)>

Public szName
As
String
' * MIXER_LONG_NAME_CHARS<FieldOffset(120)>

Public dwType
As
Integer<FieldOffset(124)>

Public dwDeviceID
As
Integer<FieldOffset(128)>

Public wMid
As
Integer<FieldOffset(132)>

Public wPid
As
Integer<FieldOffset(136)>

Public vDriverVersion
As
Integer<FieldOffset(168), MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst:=MAXPNAMELEN)>

Public szPname
As
String
' * MAXPNAMELEN

End
Structure<StructLayout(LayoutKind.Sequential)> _

Private
Structure MIXERLINECONTROLS<FieldOffset(0)>

Public cbStruct
As
Integer
' size in Byte of MIXERLINECONTROLS<FieldOffset(4)>

Public dwLineID
As
Integer
' line id (from MIXERLINE.dwLineID)<FieldOffset(8)>

Public dwControl
As
Integer
' MIXER_GETLINECONTROLSF_ONEBYTYPE<FieldOffset(12)>

Public cControls
As
Integer
' count of controls pmxctrl points to<FieldOffset(16)>

Public cbmxctrl
As
Integer
' size in Byte of _one_ MIXERCONTROL<FieldOffset(20)>

Public pamxctrl
As IntPtr
' pointer to first MIXERCONTROL array

End
Structure

Bon, ok, tout vas bien sous xp, mais sous vista, je ne sait meime pas ce que il y a de nouveau ...
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
gillardg Messages postés 3275 Date d'inscription jeudi 3 avril 2008 Statut Membre Dernière intervention 14 septembre 2014 2
22 oct. 2008 à 15:20
Bonjour,

pour faire une recherche , n'hésite pas : un chat= un chat  donc voici les recherches qui te meneront vers les réponses dont tu as besoin

google search :
vista + api + sound + mixer 

http://www.google.be/search?hl=fr&q=vista+%2B+api+%2B+sound+%2B+mixer&meta=

msdn search :
 vista + api + sound + mixer

http://social.msdn.microsoft.com/Search/en-US/?query=vista%20%2B%20api%20%2B%20sound%20%2B%20mixer&ac=8

a+
0
Rejoignez-nous