Switching audio files on a single page

sirwise23 Community Member Posts: 442 ☆ Roadie ☆
I know I have asked the question a few times myself about playing more than one audio file on a page controlled by buttons. In the past I used 5 buttons and had each button stop playing 4 other files, then start playing the file I needed it to play.The problem with this is that when it is on the LMS, the process of having each button try to stop all these audio files, rather they were playing ot not, really made things run slow for me. It would make the page take long to load, as well as give me a noticeable delay on each click. I started using another way to do this that worked much better:I created a group (named CurrentAudio) with a single audio file (Let's call it START.wma) and an action that says Action: Play --- TARGET: START.wma (With a .1 second delay)I have this audio file set for autostart because for me it is usualy the first audio file that places when I go to the page.I then have 5 buttons and 5 audio files to play (Audio01.wma - Audio05.wma). I created 5 action groups (Let's call them Group1 - Group5) and have each of those buttons run the needed action group.The first action in each group is ACTION: Change Contents --- New Contents: Audio01.wmaThe second action is ACTION: Run Action Group --- Target: CurrentAudio (with a .1 second delay)I did the same thing with all 5 groups.This makes an audio file start at the page launch. If you do not need a audio file at launch, then I am prtty sure you can put a 1 second blank audio or just any of the audios with no auto play. When you click a button, it will change the contents of that audio file to the new audio file, and then play it. This stops the need for all the actions to stop playing every possible audio file that could be playing, and makes the page much more responsive.