Audio stuttering when playing Event continuously

I have a weapon sound event and in the Gamemaker engine I create and play the event every time I shoot with my weapon (weapon cooldown 0.078). The sound plays, but it seems to stutter occasionally. There is no such problem when I shoot less frequently. I don’t know what the problem is or how to fix it.

Hi,

Could you please share the version number of the FMOD studio you used and a code snippet of how you trigger the events? Also, could you please collect a profiler capture (12.2 Recording a New Session) while reproducing the issue you mentioned in-game, then package your profiler session (12.1 Managing Sessions) including banks (ticking the “Banks” option when exporting), and upload it to your FMOD Profile?

My fmod studio version is 2.02.10
The Fmod Extension For Gamemaker Engine: GitHub - YoYoGames/GMEXT-FMOD: Repository for GameMaker's FMOD Extension
Code:

The Profile (I don’t have a project right now, I’m just testing the plugin so I couldn’t uplaod it.)
But there seems to be a problem in the places I have drawn in yellow here.

Hi,
Please try updating to the most recent FMOD version (2.02.21) and let me know if the issue persists. Are there any errors or warning logs when you encountered the issue?
Could I please get a screenshot of the event in your FMOD Studio project? Specifically, if the gunshot event is a 3D sound or not. If it is a 3D sound, please try providing 3D attributes to the event instance right after creating it: FMOD Engine | 6. Studio API Reference | Studio::EventInstance::set3DAttributes
Thanks for the images, without the profiler recording or more information it is difficult to identify the potential issue.

Version 2.02.21 has the same error, I get no error message. gunshot event is from the default examples project.

Thank you for the video.
The machine_gun event was initially created to be played in a loop rather than starting a new instance per ‘shot’. Please try re-adding the loop region (FMOD Studio | 27.57 Loop Region) as the event was originally set.


and a parameter (FMOD Studio | 7 Parameters) to define whether the event loops or not. For documentation outlining the use of a parameter, please check FMOD Studio | 7.1.3 Parameter Trigger Conditions.

For ‘continuous’ firing set the parameter to a value that triggers the loop region to loop


While the ‘single’ can use the default value (0) as we do not wish it to loop.

For ‘continuous’ firing you could use mouse_check_button for starting the looping event, and mouse_check_button_released to stop it. Please note you will have to keep a reference to the event instance started by the mouse_check_button function so it can be passed into the released function. mouse_check_button_pressed can be used for the ‘single’ shot.

Hope this helps. If you have any more questions please do not hesitate to ask.

I understand, but the firing rate of each weapon will be different, if I use loop region, how will I set the firing rate with the code?

An option may be increasing the pitch of the event instance depending on the rate of fire fmod_studio_event_instance_set_pitch()
For more information about setting the pitch, please see FMOD Engine | 6. Studio API Reference | Studio::EventInstance::setPitch()

If I adjust the pitch of the sound, the sound changes. I need to adjust it without the sound changing.

I understand.

A solution may be creating events for each fire rate with different loop lengths, this will trigger the instrument more frequently without affecting the sound.