1/27/2024 0 Comments Gml play soundGain = (listener_distance / reference_distance) ^ (-falloff_factor)ĭistance = clamp(listener_distance, reference_distance, maximum_distance) iOS, for example, clamps to (1/256) - 8, so you may need to experiment on each target platform and have different versions of a sound resource, each one pre-shifted, should you require higher or lower octave values. NOTE: The clamped value given above is what GMS2 attempts to clamp the range to, but this value is not guaranteed on all target platforms. It is worth noting that the total pitch change permitted is clamped to (1/256) - 256 octaves, so any value over or under this will not be registered. It is best to use small increments for this function as any value under 0 or over 5 may not be audible anyway. The pitch argument is a pitch multiplier, in that the input value multiplies the current pitch by that amount, so the default value of 1 is no pitch change, while a value of less than 1 will lower the pitch and greater than 1 will raise the pitch. If it is an index of a playing sound, then only that instance will be changed, however when using a sound asset from the resource tree, all further instances being played of that sound will be changed. The sound can either be one referenced from an index for an individual sound being played which has been stored in a variable when using the audio_play_sound or audio_play_sound_at functions, or an actual sound asset from the resource tree. This function can be used to change the pitch of a given sound. Function Description: Set the pitch of the given sound. > pitch: The pitch multiplier (default 1). index: The index of the sound to change.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |