I use, the command
Code: Select all
SoundPlay, backgroundMusic.mp3
Code: Select all
SoundPlay, soundOption.wav
Any idea, please?
Code: Select all
SoundPlay, backgroundMusic.mp3
Code: Select all
SoundPlay, soundOption.wav
Code: Select all
playAudio(aF){
global
fNm++
fLoc := a_temp, cPF := fLoc "\pF_" fNm ".ahk"
sbCmd =
(
#NoTrayIcon
cSnd := "%aF%"
soundPlay, `% cSnd, 1
)
fileAppend, % sbCmd, % cPF
if fileExist(cPF)
run % cPF
sleep, 500 ; <- script hangs on exit if theres no delay.
fileDelete, % a_temp "\pF_*.ahk"
return
}
Are you testing that function?Helgef wrote:Add a hotkey to exitapp at the bottom of sbCmd or remove the notrayicon and right click the tray icon, then click exit.
Code: Select all
sbCmd =
(
#NoTrayIcon
cSnd := "%aF%"
soundPlay, `% cSnd, 1
exitapp
esc::exitapp
)
traHelgef wrote:Add a hotkey to exitapp at the bottom of sbCmd or remove the notrayicon and right click the tray icon, then click exit.
I thought I had fixed my problem using this:
Code: Select all
FileRead, Sound1, *c %rbackgroundSound%
PlaySound( Sound1 )
PlaySound( ByRef Sound ) {
Return DllCall( "winmm.dll\PlaySound" ( A_IsUnicode ? "W" : "A" ), UInt,&Sound, UInt,0, UInt, ((SND_MEMORY:=0x4)|(SND_ASYNC := 0x1)) )
}
Users browsing this forum: balawi28 and 238 guests