Before AppStudio 4, sounds were played using the Audio control. This had a few drawbacks: it was a bit complicated to set up, there was a noticeable delay before the sound started, only one sound could play at a time and it would insist on putting Play/Resume buttons on the screen. These made sounds useless for many applications, including user feedback and gaming.
In AppStudio 4, we have added a new function, PlaySound:
PlaySound("Bubbles.wav")
It plays the sound immediately, with nothing appearing on the screen. Sound files can be .wav or .mp3 format.
To add a sound to your project, drag and drop it from the desktop into your Project Explorer:
The sound file will then be included in the project, so the PlaySound function can work.
Virtually any .wav or .mp3 file can be used. If you do a PlaySound() before the current one finishes, both will play at the same time.
PlaySound is supported starting with iOS Safari 6 and Chrome 31, so it will work on all current and recent iOS and Android devices. It is not supported in the Android browser or Internet Explorer.