@psDevUK - dont suppose you have a random component for this that you are hiding
The idea is, i have written a front end for woocommerce, when an order pops in, we need an audio alert! sounds easy but digging into it, not so easy! I would use the printer buzzers but they dont work either…
Hi @neo I got tomorrow off work, need to be looking for a job really, as I recently got made redundant, which sucks, but hey this covid thing has done a whole lot more damage to other people. Sound is one area I have not looked into yet in react, which is a bit weird as I used to love playing vinyl on my technic 1210s back in the day. Anyways man I am happy to do some research maybe today or tomorrow…I don’t want to promise anything but more than happy to be a have a go hero on the challenge.
Boom I do have a working solution…sadly I was having issues getting this to build as a component, I tried a few out there, but things didn’t quite go to plan…So I thought about the awesome Invoke-UDJavascript that @BoSen29 brought to the build a while back.
Went for something simple:-
New-UDDashboard -Title "Sound Demo" -Content {
New-UDButton -Text 'Click For Sound' -OnClick {
Show-UDToast -Message 'Wait for the rocket sound!'
Invoke-UDJavascript -Javascript "var audio = new Audio('https://assets.coderrocketfuel.com/pomodoro-times-up.mp3');audio.play();"
}
}
I tested this on remote desktop connection with sound (as not in office) and all was good. So this should allow you to play any sound using this technique shown above, for when you want an alert sound to play.
I hope this is what you are after to get the desired results.