fmod-gdextension
fmod-gdextension copied to clipboard
FMOD won't play more than 1 instance of same event.
Context:
I'm trying to create a rifle sound for a 2d godot game, and within FMOD I have an event ("Automatic Rifle") with a logic track, so the gun sounds get "airy-er" as the ammo runs out.
The event contains a few multi-instruments all creating one bullet shot.
The event is played currently every 0.1s and the "airyness" goes from 0 to 100 over 10s
The issue:
Every time the event fires it cuts off the previous one, meaning that when the gun is fired at high speeds it sounds choppy and the reverb doesnt work properly.
I cant find any way to increase event polyphony. I've looked in FMOD for polyphony options and they're all at max, and within godot I can't find any polyphony options for the FMOD extension specifically.
Relevant code:
(within a test script - attached to an FmodEventEmitter2D Node)
extends FmodEventEmitter2D
var shotDelay = 0.0
var shotDelayLimit = 0.1
var airModulate=0.0
var airModulateLimit=10
func _physics_process(delta):
air_modulate(delta)
play_gunshot(delta)
func air_modulate(delta):
airModulate+=delta
self["event_parameter/Ammo Airyness/value"] = airModulate * 10
if airModulate>=airModulateLimit:
airModulate=0.0
func play_gunshot(delta):
shotDelay += delta
if shotDelay >= shotDelayLimit:
shotDelay = 0.0
self.play()
print("Sound played")