From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to play wav files without the sounds overlapping each other.

I am pretty new to LabView and I'm trying to create five push buttons that have their own unique wav files. I was able to create the push buttons and the sounds for each using the example built in LabView. The only problem I am having is when I push button one I get my sound but when I push button two it overlaps and plays both sounds. I would like the new button to stop the previous sound when pressed so for example if I am push button one sound plays but if I push button two the sound from button one stops and the sound from button two now plays and so on. Does anyone know what I need to do to accomplish this task? Thanks for the help in advance. 

0 Kudos
Message 1 of 10
(1,504 Views)

Thank you for attaching your code as a VI -- it is so much easier to give advice when we can actually see the VIs, edit them, try them out to "see for ourselves" the problem, maybe edit them to see if the "fix" we propose actually works.

 

Oops, no, you didn't help us to help you.  Guess what you need to do in order to get useful help ...

 

Bob Schor

 

P.S. -- attach all the relevant VIs that you wrote.

0 Kudos
Message 2 of 10
(1,473 Views)

Lol I see there is always a smart $$$ with every forum and I presume you are the one for this site. A simple more respectful way of presenting your answer goes a long way but since this is the internet I assume your chest gets poked out quite a bit behind a screen (Keyboard Gangster) and is a lot more humble face to face. I could not attach the vi because I do not have LabView on this current computer that I am on. Just looking for some insight that is all. 

0 Kudos
Message 3 of 10
(1,466 Views)

@ElecTexas,

 

There are a number of experienced users on this Forum who try to educate LabVIEW Newbies on how to best use the Forum and maximize the time and (unpaid) effort of those who like to provide help.  Many of them share the same sentiment that our ESP is not good enough to "see what you are doing" without your helping us by attaching your VIs.

 

Just trying to help (with a little humor, no snark intended -- I'm sorry you took offense).

 

Bob Schor

0 Kudos
Message 4 of 10
(1,462 Views)

No worries I appreciate the apology and I will make a note to attach some type of screenshot or something to better explain what I am having trouble with 🤙.

0 Kudos
Message 5 of 10
(1,457 Views)

@ElecTexas wrote:

attach some type of screenshot or something to better explain what I am having trouble with 🤙.


No! A picture does not explain anything. We prefer the actual VI. All controls should have typical defaults and it should be ready to run. Explain how you are using it, what you expect to see/hear, and what you want to see/hear instead.

 

What sound tools are you using? (express, high-level, low-level, etc.).

What is the mechanical action of the buttons (or do they form a radio-button control?)

What program architecture are you using?

 

(And please never say "... the only problem I have ..." That never turns out to be true. :D. Also note the correct letter case. It is spelled LabVIEW.)

0 Kudos
Message 6 of 10
(1,440 Views)

Lol obviously a boy with the lack of social skills and lack of tact when it comes to conversing with people. Look all I asked was a question so if it got you so torn inside to prevent you from coming to the table like a man to discuss then you could've easily moved on, you really didn't need to respond if felt so torn inside about it lol. I know for a fact that you do not talk with people like that face to face only on the internet but on that note thanks for the advice with "Labview" (Grammar Police) 😎🤙🏾😭😂 #STAYHUMBLE

0 Kudos
Message 7 of 10
(1,431 Views)

Okay guys, let us calm down and focus on the end goal.

 

My guidance would be

  • Before you play sound for the second button press make sure the first sound has stopped
  • Or abort any playing sounds before playing the sound for the second button
  • You might already be aware of how Windows does this sound playback, even if you're watching a movie or listening to a song, the notification sounds still play on top of any existing audio - this is a feature, but in your requirement, you don't want it

 

I cannot guide you on how to do these because I don't know your code enough to suggest the right edits. If you would need further guidance, we need to see your code to guide you on the right path, if you think the above idea is good enough to put you on the right track to figure things yourself, well and good.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 8 of 10
(1,411 Views)

Thank you sir I really appreciate your positive input with this. We did figure out a way which falls right inline with what you had mentioned. We ended up stopping the existing file completely and start the next one using a series of logic gates so the buttons that are assigned to those wav files stop completely. I know just like electronics there are many ways to create something and achieve the same outcome. Thanks again 🤙🏾

0 Kudos
Message 9 of 10
(1,406 Views)

In the spirit of "Community" (as in the LabVIEW Community), there may be other readers who follow the LabVIEW Forum and have the same problem that you raised, how to play .wav files without the sounds overlapping each other.  You would do a service to the community if you posted your "code that works" -- you could even mark your "solution" post as the "Solution", as it really helps to know that the question has a solution ...

 

Bob Schor

0 Kudos
Message 10 of 10
(1,396 Views)