Aether Posted January 27, 2019 Share Posted January 27, 2019 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 More sharing options...
Aether Posted February 27, 2019 Author Share Posted February 27, 2019 I still haven't found a solution for that Link to comment Share on other sites More sharing options...
Dwalfware Posted February 28, 2019 Share Posted February 28, 2019 This worked for me on x86 $WAVFile = "Failure.wav" DllCall( "winmm.dll", "int", "mciExecute", "str", "play " & $WAVFile) Sleep(5700) from 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