When you click on 'Add script', you will see a few new options, one of which will say 'Add audio (NEW)'.
This will bring up this screen, where you can select a sound from your computer, just like the old
Using the sync option does NOT actually interrupt play. It only keeps the player from entering commands until the sound has finished, but we can add a script to run once the sound has finished to accomplish our needs.
Here is an example where a sound "interrupts play" in between rooms:
You can stop all sounds with
DestroyAllAudio. (This even stops sounds played with the old
play sound script command.)
You can stop one sound with
DestroyAudio(id), but you must know the ID. (An ID can be assigned when adding audio.)
The mp3 format will not work in the desktop player when using these functions. It will, however, play an ogg file. To exacerbate things, I am not sure if the Safari browser will play the ogg format. My solution is to include both formats, as seen in the above example.
To make sure your sound will work in the desktop player, either include an ogg along with an mp3, or use the old
play sound script command.
This works just like stopping audio. You can use
You can add backup sources for browser compatibility
However, the backup sources do not have to be on an external server (as in the example)?
And the good thing about this solution is that you can play several music pieces/sounds at the same time.
Would you give us additional functions to stop and resume the music? That would be very nice : -)
However, the backup sources do not have to be on an external server
the good thing about this solution is that you can play several music pieces/sounds at the same time.
additional functions to stop and resume the music
They are already in there, I just didn't add them to the GUI yet.
I just added video functions to the library, as well.
Here's a link to a list of all the functions:
This is truly amazing... being able to add an ambient sound with no effort at all, and not having it conflict with the sound effects is incredible, and I feel it can add a lot to the ambience in certain types of videogames.
Furthermore, it's compatible with the old
play sound function, so I could add it to my game on the fly. Truly a life saver.
Only one question, though... any details I should know as to how you should be credited, or how am I allowed to use it? I'd hate to piss someone off due to my own ignorance.
Thanks! I'm glad you like it!
No credits are necessary, either. Feel free to do whatever you like with it!