Skip to content

Commit 0029b27

Browse files
committed
Fix lower notes not playing all the way through
The time that each emitter will remain active for now depends on the pitch of the sound -- lower sounds will remain for longer, and vice-versa.
1 parent da7e0a8 commit 0029b27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/play_sound/play_sound.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ audio_play_sound_on(emitter,ins.sound, 0, 0)
2626
//Schedule emitter to be deleted from memory
2727
newemitter = ds_list_create()
2828
ds_list_add(newemitter,emitter) //store emitter id
29-
ds_list_add(newemitter, (audio_sound_length(ins.sound) * 600000) + get_timer()) //store moment of which the emitter should be removed
29+
ds_list_add(newemitter, (audio_sound_length(ins.sound) * 1000000 * (1/audio_emitter_get_pitch(emitter))) + get_timer()) //store moment at which the emitter should be removed
3030
ds_list_add(emitters_to_remove, newemitter)

0 commit comments

Comments
 (0)