Sign in to follow this  
Followers 0
xuanmai

API function calls in AutoI

5 posts in this topic

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


no one

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

thank you


no one

Share this post


Link to post
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
Sign in to follow this  
Followers 0