12-19-2019 11:16 AM
Hello Friends,
I like to add a beep sound to my VI, I tried two methods, one is to use Kernel32 Dll beep, another is to use beep.vi, however, none of them worked on labview 2015. I used both of them on older labview version prior to 2010. I do not know why they do not work on 2015.
Could someone help me with the issue? see attached vi.
Thanks.
Gu
Solved! Go to Solution.
12-19-2019 11:36 AM - edited 12-19-2019 11:38 AM
It works fine on my computer. Note that it plays the beep through the computer speakers, not an internal speaker, at least on my laptop.
Did you try it on yours with "use system alert?" set to True? From the help on Beep.vi:
"This VI might not work correctly if use system alert? is FALSE."
EDIT: By "works fine" I mean my computer starts making noise. The VI actually locked up for a while when I first ran it, screeching a high pitched tone out of my headphones 🙂
I'd add a Wait in there or something, as it basically locked up the environment. I also removed the dll call and was just using Beep.vi- I'm just trying to get my computer to beep.
12-19-2019 01:06 PM
Hi BertMcMahan,
Thanks for your reply.
I did try "use system alert" and set to True before my posting. It did not work either.
Which LabVIEW version are you using? My is 2015. It might be just related to my computer issue, I will try it on another computer later.
Regards,
Gu
12-19-2019 01:09 PM
I tried it in LV2018 32-bit.
Is the beep sound maybe coming out of a speaker system that's turned off?
12-19-2019 01:24 PM - edited 12-19-2019 01:29 PM
I don't even know if modern operating systems even support PC speaker any more. If I remember correctly, you had to send a square wave directly to that port (whatever it is).
Edit: LOL, I was thinking the OP was talking about the little speaker sometimes included with a PC desktop case.
12-19-2019 01:36 PM
@billko wrote:
LOL, I was thinking the OP was talking about the little speaker sometimes included with a PC desktop case.
Beep.vi used to make that little speaker beep, at least back in 8.2. I don't think it does anymore, but IIRC that was a Windows change, not a LabVIEW one.
12-19-2019 08:00 PM
I created a VI using Windows 10 and LabVIEW 2016 that consisted of just the Beep.vi function. When I ran it (without specifying any parameters), I got my system "alert" tone, "bdddring". I then added some parameters -- 440 (A above middle C, the pitch used to "tune" an orchestra; 500, half a second; F (don't use System Alert). When I ran it, I got half a second of A440.
I repeated this opening the VI in LabVIEW 2019. Same results. It works fine in Windows 10 with the last four versions of LabVIEW (OK, I didn't test it with 2017 and 2018, but I could, they're on this PC, but I'm too lazy ...).
Bob Schor
12-21-2019 12:58 PM - edited 12-21-2019 01:00 PM
Hi Everyone,
Thank you for all your efforts to address the sound issue.
I could not make beep.vi working in LabVIEW 2015 on my laptop, I checked the laptop's speaker and it works normal when playing YouTube videos and music files .
I solved the beep sound issue in LabVIEW by playing a wav sound file instead. Attached is the VI.
Regards,
Gu
12-21-2019 07:31 PM
I wouldn't really call it "solved". The issue remains that it isn't working correctly; you just found a workaround.
It's kind of like saying "driving around a pothole" is the solution to fixing the pothole when really the solution is to fill it in...
12-21-2019 09:10 PM
What happened when you tried (on your system) to run the one-function VI I posted? I'm pretty sure it should have worked ... Now, if it didn't make the kind of sound you wanted (i.e. if you wanted a different "beep" sound), then you stated the "problem" incorrectly, and your solution ("I wanted a particular .wav file to be played, but I didn't want to change the Windows setting for the "beep", so I simply played the .wav file that I wanted instead") is correct.
I hope you learned something about the "Beep" function, namely that in its Default setting, it plays a defined Windows sound, but you can make it play a tone instead.
Bob Schor