-
Notifications
You must be signed in to change notification settings - Fork 37
Scripting Audio and Sound
Robosturm edited this page Aug 3, 2019
·
2 revisions
The Commnader Wars Sound/Audio System is fully accessable in Scripts via the "audio" object.
For example would load adders soundtrack to the :
audio.addMusic("resources/music/cos/adder.mp3");
The fully avaiable interface in javascript can be found in the source folder "coreengine/audiothread.h" under public slots.
The most important functions are:
audio.addMusic("resources/music/cos/adder.mp3", 1000, 10000);
This would add Adders Music and when played start at second 1 and end the file at second 10.
audio.clearPlayList();
Empties the playlist nothing will be played now.
audio.playRandom();
Starts a new track randomly selected from the playlist
audio.playSound("trap.wav", 1, "resources/sounds/");
Plays a background sound in this case "trap.wav" in the folder "resources/sounds/" and repeats it 1 time.
E-Mail-Contact: commanderwars@gmx.de ask for help here. :)