V2 SoundPlay Error

Report problems with documented functionality
Kiseki
Posts: 11
Joined: 12 Jan 2016, 13:24

V2 SoundPlay Error

Post by Kiseki » 21 Mar 2023, 16:55

So the problem is that i can no longer stop an audio playback. At least not without resorting to reload, which is not feasible for my application.

The documentation says:
To stop a file that is currently playing, use SoundPlay on a nonexistent filename as in this example: SoundPlay "Nonexistent.avi".
However, that throws an error dialog: "Failed"

That appears to be a bug. If it's not, then i guess the documentation should be updated. Anyway, if there's a work around for this, i'd appreciate any help.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: V2 SoundPlay Error

Post by swagfag » 21 Mar 2023, 19:03

if ure asking me this whole API's interface needs to be updated. having to pass garbage(and ensure its actually garbage) to stop a playback is just lol
in ur script, today, what u can to do fix it is just put it inside a Try block

neogna2
Posts: 586
Joined: 15 Sep 2016, 15:44

Re: V2 SoundPlay Error

Post by neogna2 » 22 Mar 2023, 10:26

Confirming that Try soundplay("") stops playback.

The SoundPlay doc example 2 says SoundPlay "*-1" generates a simple beep. But it doesn't. It does nothing AFAICT and does not throw error either. So that's another mismatch between the doc and actual behaviour.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: V2 SoundPlay Error

Post by swagfag » 22 Mar 2023, 11:43

SoundPlay('*-1') is MessageBeep(0xFFFFFFFF) // A simple beep. If the sound card is not available, the sound is generated using the speaker.
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messagebeep

its not entirely clear to me what that "beep" sound is supposed to be exactly, but on my win10 computer it plays this sound:
image.png
image.png (23.96 KiB) Viewed 533 times
if u dont hear anything, then probably something's wrong with ur audio config

Kiseki
Posts: 11
Joined: 12 Jan 2016, 13:24

Re: V2 SoundPlay Error

Post by Kiseki » 22 Mar 2023, 15:21

swagfag wrote:
21 Mar 2023, 19:03
in ur script, today, what u can to do fix it is just put it inside a Try block
That works. Thank you so much!
neogna2 wrote:
22 Mar 2023, 10:26
The SoundPlay doc example 2 says SoundPlay "*-1" generates a simple beep. But it doesn't. It does nothing AFAICT and does not throw error either. So that's another mismatch between the doc and actual behaviour.
Just confirming that the default beep does play on my end just fine as well.

neogna2
Posts: 586
Joined: 15 Sep 2016, 15:44

Re: V2 SoundPlay Error

Post by neogna2 » 22 Mar 2023, 16:24

swagfag wrote:
22 Mar 2023, 11:43
on my win10 computer it plays this sound
Ok, I normally have "sound scheme" set to "no sound" to avoid hearing various beeps and chimes. If I change it to "windows default" I do get a kind of chime sound. So the action works but is dependent on setting a sound scheme. Good to know and relevant info for the SoundPlay documentation page.

Post Reply

Return to “Bug Reports”