GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 Script Submission » Play sound with pitch varient script » 2019-08-13 13:57:27

SheepDog123
Replies: 1

Hello!

Here's a helpful script that I made.
It will play a sound at a slight pitch varient..


play_sound(sound,min_pitch,max_pitch,priority)



example:
play_sound(snd_click,.9,1,15);



Copy below this line:
---------------------------------------

Expand/// @description play_sound(sound,min_pitch,max_pitch,priority)
/// @param sound
/// @param min_pitch
/// @param max_pitch
/// @param priority

// Randomize
randomize();

// Set temp. varibles
var sound = argument0;
var min_pitch = argument1;
var max_pitch = argument2;
var priority = argument3;

// Set the pitch
var pitch = random_range(min_pitch,max_pitch);

// Play the sound
audio_play_sound(sound,priority,0);

// Change the pitch
audio_sound_pitch(sound,pitch);

Board footer

Powered by FluxBB