GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2019-08-13 13:57:27

SheepDog123
Member
Registered: 2019-08-13
Posts: 1

Play sound with pitch varient script

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:
---------------------------------------

/// @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);

Last edited by SheepDog123 (2019-08-14 13:48:26)

Offline

Board footer

Powered by FluxBB