Skip to content

Commit

Permalink
Clamp sound pitch
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Sep 18, 2024
1 parent 25e8455 commit f2ffd0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arc-core/src/arc/audio/Sound.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void load(Fi file){
public int play(float volume, float pitch, float pan, boolean loop, boolean checkFrame){
if(handle == 0 || (checkFrame && framePlayed == Core.graphics.getFrameId()) || bus == null || !Core.audio.initialized) return -1;
framePlayed = Core.graphics.getFrameId();
return sourcePlayBus(handle, bus.handle, volume, pitch * Core.audio.globalPitch, pan, loop);
return sourcePlayBus(handle, bus.handle, volume, Mathf.clamp(pitch * Core.audio.globalPitch, 0.0001f, 10f), Mathf.clamp(pan, -1f, 1f), loop);
}

/** Sets the bus that will be used for the next play of this SFX. */
Expand Down

0 comments on commit f2ffd0e

Please sign in to comment.