Jump to content

SoundPlay doesn't work in x86 when no AutoIt


Aether
 Share

Recommended Posts

I wrote a small script with a sound resource.  I use something along those lines:

#AutoIt3Wrapper_Res_File_Add=Failure.wav, sound, Son

_ResourcePlaySound ("Son", $SND_ASYNC)
if @error then Exit MsgBox (0,"Error","Sound")

Func _ResourcePlaySound($ResName, $Flag = 0)
    Local $ret = DllCall("winmm.dll", "int", "PlaySound", "str", $ResName, "hwnd", 0, "int", BitOr($SND_RESOURCE,$Flag))
    If @error Then Return SetError(1, 0, 0)
    Return $ret[0]
EndFunc

Everything works fine on development machine. I wanted to deploy this script to other machines that don't have AutoIt installed.  But, surprise, no sound !  I tried to replace the resource by the .wav file and use SoundPlay, same result.  After looking at the web, someone says that it was working using x64, I tested it and, new surprise, it was working !  Why would that be ?  Bug ?  Is the DLL is only x64 ? 

Enlightment would be appreciated.

Link to comment
Share on other sites

  • 1 month later...

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...