Skip to content

Instantly share code, notes, and snippets.

@msg555
Created October 20, 2017 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msg555/821c3aec14852e67fd15c7ec96a851f2 to your computer and use it in GitHub Desktop.
Save msg555/821c3aec14852e67fd15c7ec96a851f2 to your computer and use it in GitHub Desktop.
An example of how to embed and use custom sounds with dustscripting.
const string EMBED_sound1 = "test1.ogg";
class script {
scene@ g;
script() {
@g = get_scene();
}
void build_sounds(message@ msg) {
msg.set_string("test1", "sound1");
msg.set_int("test1|loop", 44100 * 2); // 2 seconds in
}
void on_level_start() {
g.play_script_stream("test1", 1, 0, 0, true, 1.0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment