04-01-2024 10:49 PM
Hello.I am trying to make a case structure where when I switch states,I can also switch the song that is being played.While I am managing to make that work,I cant figure out how to fix the issue where the playback of the wav file is being looped constantly.
I am providing below the VI file,along with the wav files(Please make sure to path them accordingly).
Thanks in advance for your time!
04-02-2024 01:01 AM
Hi Fefes,
@Fefes wrote:
I cant figure out how to fix the issue where the playback of the wav file is being looped constantly.
Which "issue" do you talk about?
Your case structure is placed inside a loop and as long as the loop iterates it will execute the selected case - and so it also plays the wav file as programmed by you inside the cases!
@Fefes wrote:
Hello.I am trying to make a case structure where when I switch states,I can also switch the song that is being played.
Do you want to play the sound ONLY when the boolean button is switched?
Then you should use an event structure or check for boolean changes using the PtByPt-BooleanCrossing function…
04-02-2024 10:26 AM
Keep the opened Play-reference in a shift register and use it in the other case to stop it. The open+close combo most probably creates a new ID that's separate and stops that.