[Resolved] Play a .wav file when I press F9

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
thegame2010
Posts: 29
Joined: 04 Feb 2016, 18:14
Location: 'Murica

[Resolved] Play a .wav file when I press F9

Post by thegame2010 » 05 May 2016, 10:37

It's Cinco de Mayo, and I broke up part of the Mexican Hat Dance into 4 sound files. I hid a bluetooth speaker in the office, and I plan on playing the song every now and then to bother the hell out of everyone at work. 8-)

Unfortunately, I am unable to make it work.

Code: Select all

F8::
	SoundSetWaveVolume, 100
	Msgbox It worked.
return
F9::SoundPlay, MHD1.wav
F10::SoundPlay, MHD2.wav
F11::SoundPlay, MHD3.wav
F12::SoundPlay, MHD4.wav
This code is in the same folder as the wav files. I also tried putting the full C:\users\<username>\Sounds\MHD\MHD1.wav

It didn't help. What am I doing wrong?
Last edited by thegame2010 on 05 May 2016, 13:33, edited 1 time in total.
FranzyMonastic
Posts: 11
Joined: 03 May 2016, 00:49

Re: Play a .wav file when I press F9

Post by FranzyMonastic » 05 May 2016, 10:49

try to run this diagnostic script:

Code: Select all

SoundPlay, MHD1.wav

if ErrorLevel
    MsgBox, %ErrorLevel%
else
    MsgBox, OK
User avatar
thegame2010
Posts: 29
Joined: 04 Feb 2016, 18:14
Location: 'Murica

Re: Play a .wav file when I press F9

Post by thegame2010 » 05 May 2016, 13:28

This reads ErrorLevel 1.

Is there a way to know if this is a syntax error versus some other kind?
User avatar
thegame2010
Posts: 29
Joined: 04 Feb 2016, 18:14
Location: 'Murica

Re: Play a .wav file when I press F9

Post by thegame2010 » 05 May 2016, 13:32

I figured it out!! My issue was the wav files themselves: I made 32-bit .wav files rather than 16-bit .wav files.
Post Reply

Return to “Ask for Help (v1)”