Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method for playing a sound with a given pitch #14

Merged
merged 5 commits into from
Oct 1, 2023

Conversation

dillyo09
Copy link
Contributor

Changed sound_effects.play(), SoundManager.play_sound(), and SoundManager.play_ui_sound() functions to accept a pitch parameter.

Added an example of a random pitch sound effect to Example.tscn.

Comment on lines 54 to 59
func play_sound(resource: AudioStream, pitch: float = 1.0, override_bus: String = "") -> AudioStreamPlayer:
return sound_effects.play(resource, pitch, override_bus)


func play_ui_sound(resource: AudioStream, override_bus: String = "") -> AudioStreamPlayer:
return ui_sound_effects.play(resource, override_bus)
func play_ui_sound(resource: AudioStream, pitch: float = 1.0, override_bus: String = "") -> AudioStreamPlayer:
return ui_sound_effects.play(resource, pitch, override_bus)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be changing the public interface for these methods - they should be added as new methods (something like play_sound_with_pitch(..)).

@nathanhoad nathanhoad added the enhancement New feature or request label Oct 1, 2023
@nathanhoad nathanhoad changed the title Add Support for changing the Pitch of Sound Effects Add method for playing a sound with a given pitch Oct 1, 2023
@nathanhoad nathanhoad merged commit 3bfd869 into nathanhoad:main Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants