derda Posted December 3, 2007 Share Posted December 3, 2007 hi I tried to figure out how to control the Waveoutport. This happens with the WinApi(winmm.dll) but i'm getting desperately with it all i could code in two weeks was this lousy bit of code:( : ;works: Func waveOutGetNumDevs($dll="winmm.dll") $ret = DllCall($dll,"int","waveOutGetNumDevs") If IsArray($ret) Then Return $ret[0] Else Return -1 EndIf EndFunc ;may works: Func waveOutClose($hno,$dll="winmm.dll") $ret = DllCall($dll,"int","waveOutClose","int",$hno) If IsArray($ret) Then Return 1 Else Return -1 EndIf EndFunc ;don't works: Func WAVEOUTCAPS($dll="winmm.dll") $stc = "int wMid;int wPid;long vDriverVersion;char szPname[255];long dwFormats;int wChannels;long dwSupport;" $struct = DllStructCreate($stc) $ret = DllCall($dll,"none","WAVEOUTCAPS","ptr",DllStructGetPtr($struct,1),"ptr",DllStructGetPtr($struct,2),"ptr",DllStructGetPtr($struct,3),"ptr",DllStructGetPtr($struct,4),"ptr",DllStructGetPtr($struct,5),"ptr",DllStructGetPtr($struct,6),"ptr",DllStructGetPtr($struct,7)) EndFunc my biggest Problem is i don't know how to create buffers or special structures like WAVEOUTCAPS has anybody a good link on how to create structures? grez derda P.S: sorry for my bad English :/ Link to comment Share on other sites More sharing options...
weaponx Posted December 4, 2007 Share Posted December 4, 2007 First off, why did you quote yourself? Second, you didn't give a description of what this script is for. Third you didn't tell us what the problem is. Link to comment Share on other sites More sharing options...
derda Posted December 4, 2007 Author Share Posted December 4, 2007 hisorry about that :/ i wanted to edit something but haven't found the edit-button...so i tried every button i saw... and hit the apply-button by mistake...i need this script for creating a pwm i need in school.... the problem is i don't really know how to create a structure i need for eg WAVEOUTCAPSthere are so many data types on msdn and i don't know witch one of autoit fits to them...(i hope you understand this sentence :/)the function, i posted before, checks how many waveoutports are available. The second function closes an previously opened Waveoutdevice and the third fills in some information in a WAVEOUTCAPS-structure. Link to comment Share on other sites More sharing options...
weaponx Posted December 4, 2007 Share Posted December 4, 2007 Are you trying to display a waveform graphically like here?:http://www.autoitscript.com/forum/index.ph...625&hl=wave Link to comment Share on other sites More sharing options...
derda Posted December 4, 2007 Author Share Posted December 4, 2007 (edited) wow thats great but this isnt exactly the thing i need... he displayed the wavein... i wan't to control the waveout but i think i can learn much from his code grez derda edit: hi anyone a guess why this don't works? Func WAVEOUTCAPS($dll="winmm.dll") $stc = "int wMid;int wPid;long vDriverVersion;char szPname[5000];long dwFormats;int wChannels;long dwSupport;" $struct = DllStructCreate($stc) Return $struct EndFunc Func waveOutGetDevCaps($struct,$id=1,$dll="winmm.dll") $ret = DllCall($dll,"none","waveOutGetDevCaps","ptr",DllStructGetPtr($struct),"byte",DllStructGetSize($struct)) MsgBox(0,"",DllStructGetData($struct,"wMid")&@CRLF&DllStructGetData($struct,"wPid")&@CRLF&DllStructGetData($struct,"vDriverVersion")&@CRLF&DllStructGetData($struct,"szPname")&@CRLF&DllStructGetData($struct,"dwFormats")&@CRLF&DllStructGetData($struct,"wChannels")&@CRLF&DllStructGetData($struct,"dwSupport")) EndFunc waveOutGetDevCaps(WAVEOUTCAPS()) is it possible to use all dataformats on msdn in dllstructs? for example tchar... grez derda edit2: i thing szPname is the problem... it has to have the length of "MAXPNAMELEN" but i don't have a glue how i could get this in autoit none got a glue? Edited December 8, 2007 by derda Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now