SoundPlay not working

Report problems with documented functionality
CallEyeDuhScope
Posts: 3
Joined: 25 Jun 2019, 16:59

SoundPlay not working

25 Jun 2019, 17:15

SoundPlay function works (is audible) only once per reload. Any sound after that is inaudible, and script gets stuck there if waiting. The issue didn't exist before, but it is consistently failing now

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


;; Tried removing the following auto-exec also
SoundPlay, C:\Users\AswinB\Downloads\great.mp3, 1
SoundPlay, C:\Users\AswinB\Downloads\great.mp3
MsgBox, %ErrorLevel%
SoundPlay, C:\Users\AswinB\Downloads\great.mp3, 1 ;stuck here
;

7::
SoundPlay, C:\Users\AswinB\Downloads\great.mp3, 1
SoundPlay, C:\Users\AswinB\Downloads\great.mp3
MsgBox, %ErrorLevel%
SoundPlay, C:\Users\AswinB\Downloads\great.mp3, 1 ;stuck here if auto-exec removed
Return

1::
Reload
;; recent lines shows:
;---- C:\Users\AswinB\Desktop\Doto+\test.ahk
;003: SendMode,Input
;004: SetWorkingDir,%A_ScriptDir%
;005: SoundPlay,C:\Users\AswinB\Downloads\great.mp3,1 (3.33)
;006: SoundPlay,C:\Users\AswinB\Downloads\great.mp3,1 (130.97)
;
;Press [F5] to refresh.
CallEyeDuhScope
Posts: 3
Joined: 25 Jun 2019, 16:59

Re: SoundPlay not working

26 Jun 2019, 06:20

The MsgBox shows ErrorLevel is 0 after SoundPlay (whether audible or not)
Running AutoHotkey version 1.1.30.03
Is there a way I can debug it from my end? This is some edge case, I guess, that only occurs on my device
joefiesta
Posts: 314
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Re: SoundPlay not working

27 Jun 2019, 10:11

I tested on Win7 Pro, 32-bit. running AHK 1.1.30.01.

Works perfectly fine and as expected for me.


Joe P.
CallEyeDuhScope
Posts: 3
Joined: 25 Jun 2019, 16:59

Re: SoundPlay not working

30 Jun 2019, 20:13

Yes, it used to work for me too. It stopped recently. It only works properly for the first audio played after loading the script.

Edit2: Okay, the audio was being redirected to that driver using windows' per-app settings, but that driver was not default for all apps. When setting it as default for all apps, AHK works with it normally again. I need only AHK's audio output routed to that driver

The sound driver itself is probably irrelevant, but the one I used was (Broken Link for safety): https www.vb-audio.com /Cable/index.htm

It plays just once when using this driver. I have tested other apps using this driver and the above bug-inducing configuration they seem to work fine.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 4 guests