Jump to content

API function calls in AutoI


Recommended Posts

for example, how do I want to use PlaySound function in the library winmm.dll

I write an example:

$SND_SYNC = 0x0000 ;// play synchronously (default) 
$SND_ASYNC = 0x0001 ;// play asynchronously 
$SND_NODEFAULT = 0x0002 ;// silence (!default) if sound not found 
$SND_MEMORY = 0x0004 ;// pszSound points to a memory file
$SND_LOOP = 0x0008 ;// loop the sound until next sndPlaySound 
$SND_NOSTOP = 0x0010 ;// don't stop any currently playing sound 
$SND_NOWAIT = 0x2000;// don't wait if the driver is busy

Func PlaySound($FILENAME,$MODE)
    DllCall("winmm.dll","int","PlaySound","str",$FILENAME,"int",0,"uint",$MODE)
EndFunc

PlaySound(@ScriptDir & "\Ferrari.wav",$SND_SYNC)

but exists functions in Autoit (search in help file about SoundPlay and _SoundPlay).

When the words fail... music speaks.

Link to comment
Share on other sites

$SND_SYNC = 0x0000;// play synchronously (default)
$SND_ASYNC = 0x0001;// play asynchronously
$SND_NODEFAULT = 0x0002;// silence (!default) if sound not found
$SND_MEMORY = 0x0004;// pszSound points to a memory file
$SND_LOOP = 0x0008;// loop the sound until next sndPlaySound
$SND_NOSTOP = 0x0010;// don't stop any currently playing sound
$SND_NOWAIT = 0x2000;// don't wait if the driver is busy

Func PlaySound($FILENAME,$MODE)
    DllCall("winmm.dll","int","PlaySound","str",$FILENAME,"int",0,"uint",$MODE)
EndFunc

PlaySound(@ScriptDir & "C:\WINDOWS\MEDIA\TADA.wav",$SND_SYNC)

I was able to transfer from your code, but I can not be called "C: \ WINDOWS \ MEDIA \ TADA.wav"

here is 1 songs available in the window

why???

no one

Link to comment
Share on other sites

$SND_SYNC = 0x0000;// play synchronously (default)
$SND_ASYNC = 0x0001;// play asynchronously
$SND_NODEFAULT = 0x0002;// silence (!default) if sound not found
$SND_MEMORY = 0x0004;// pszSound points to a memory file
$SND_LOOP = 0x0008;// loop the sound until next sndPlaySound
$SND_NOSTOP = 0x0010;// don't stop any currently playing sound
$SND_NOWAIT = 0x2000;// don't wait if the driver is busy

Func PlaySound($FILENAME,$MODE)
    DllCall("winmm.dll","int","PlaySound","str",$FILENAME,"int",0,"uint",$MODE)
EndFunc

PlaySound("C:\WINDOWS\MEDIA\TADA.wav",$SND_SYNC)

Read in help file about @ScriptDir.

When the words fail... music speaks.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...