Hello, I'm starting to delve into audio and for starters thought I'd play with what's already done - the bullet_impact trigger in the first person template. I added another sound to the trigger using the same settings as the bullet impact .ogg file that's there, but when the bullet impacts, the sound keeps on repeating. The bullet impact sound is fine, it just plays once. I'm not really sure what's there to do.
Also, how do I import audio so they show up in the asset browser? I have 16 bit 48kHz .wav files that show up fine in the ACE, but I can't import them into the asset browser and generate .cryasset files. Maybe that's part of the problem?
Another question: How exactly does the engine know to play the bullet impact sound? Is it through c++? I looked through the bullet header file but didn't find any mentions of audio.
Re: Trigger repeating audio using SDL Mixer
#2Hello, I'm starting to delve into audio and for starters thought I'd play with what's already done - the bullet_impact trigger in the first person template. I added another sound to the trigger using the same settings as the bullet impact .ogg file that's there, but when the bullet impacts, the sound keeps on repeating. The bullet impact sound is fine, it just plays once. I'm not really sure what's there to do.
Also, how do I import audio so they show up in the asset browser? I have 16 bit 48kHz .wav files that show up fine in the ACE, but I can't import them into the asset browser and generate .cryasset files. Maybe that's part of the problem?
Another question: How exactly does the engine know to play the bullet impact sound? Is it through c++? I looked through the bullet header file but didn't find any mentions of audio.
for your first question this should be the solution, why you want import your audio file in the asset browser, you don't need cryasset files for that. for the bullet sound i really don't know if is c++

STEAM: https://store.steampowered.com/app/673240/Room_54/
FB: https://www.facebook.com/Room54/
Twitter: https://twitter.com/Room54Thegame
- Attachments
-
- Immagine.png (189.23 KiB) Viewed 10547 times
Re: Trigger repeating audio using SDL Mixer
#3Hi quasarwei,
As ik-interactive already mentioned your "sound keeps on repeating" issue might stem from having the "Infinit Loops" checkbox enabled. Make sure that's off for the sounds that should not loop.
@Asset Browser
There's no connection between audio assets and the CRYENGINE Asset Browser. For audio the ACE is in fact the Asset Browser. This becomes especially apparent if one uses professional audio middleware such as Fmod or Wwise.
@How the bullet_impact audio trigger gets executed
At the time of the impact a material effect gets spawned. The audio trigger is executed as part of the material effect setup. You can debug that via setting cvar mfx_DebugVisual = 2.
It all starts at Assets\Libs\MaterialEffects\MaterialEffects.xml which is an Excel file. That's basically a matrix describing which effect to spawn depending on involved materials. The FPS template ships with a stripped down version of that file and only contains a setup for collisions between mat_bullet <-> mat_concrete and mat_bullet <-> mat_bullet.
As you can see the resulting material effect is collision:bullet_hit where collision is the library a XML file which can be found in Assets\Libs\MaterialEffects\FXLibs and bullet_hit the actual material effect. That file will hold an entry for the bullet_hit material effect which should look, in the case of the FPS template, like so.
<add below image here>
That's it, let me know if things are still unclear.
As ik-interactive already mentioned your "sound keeps on repeating" issue might stem from having the "Infinit Loops" checkbox enabled. Make sure that's off for the sounds that should not loop.
@Asset Browser
There's no connection between audio assets and the CRYENGINE Asset Browser. For audio the ACE is in fact the Asset Browser. This becomes especially apparent if one uses professional audio middleware such as Fmod or Wwise.
@How the bullet_impact audio trigger gets executed
At the time of the impact a material effect gets spawned. The audio trigger is executed as part of the material effect setup. You can debug that via setting cvar mfx_DebugVisual = 2.
It all starts at Assets\Libs\MaterialEffects\MaterialEffects.xml which is an Excel file. That's basically a matrix describing which effect to spawn depending on involved materials. The FPS template ships with a stripped down version of that file and only contains a setup for collisions between mat_bullet <-> mat_concrete and mat_bullet <-> mat_bullet.
As you can see the resulting material effect is collision:bullet_hit where collision is the library a XML file which can be found in Assets\Libs\MaterialEffects\FXLibs and bullet_hit the actual material effect. That file will hold an entry for the bullet_hit material effect which should look, in the case of the FPS template, like so.
<add below image here>
That's it, let me know if things are still unclear.
Last edited by Cry-Thomas on Sat Oct 21, 2017 6:38 pm, edited 2 times in total.
Re: Trigger repeating audio using SDL Mixer
#5very helpful thomas thanks for this infocry-thomas

Re: Trigger repeating audio using SDL Mixer
#6Thanks a lot cry-Thomas, that makes sense. I did make sure that "infinite" is unchcked, and count is set to 1 but it still repeats endlessly.
Re: Trigger repeating audio using SDL Mixer
#7That's unfortunate. Can you post a bit more data? Screenshots of your ACE setup and at best a short video showing the described behavior. For that make sure to turn on-screen audio debugging on. Set cvar s_DrawAudioDebug = abcdefvw.
Re: Trigger repeating audio using SDL Mixer
#8Sure, here's a short video clip showing the settings and the described behavior.That's unfortunate. Can you post a bit more data? Screenshots of your ACE setup and at best a short video showing the described behavior. For that make sure to turn on-screen audio debugging on. Set cvar s_DrawAudioDebug = abcdefvw.
- Attachments
-
- bullet_impact.JPG (70.79 KiB) Viewed 10501 times
Re: Trigger repeating audio using SDL Mixer
#9If I'm right then this is not a bug but expected behavior. It seems that you connected some sort of longer wind sound to the trigger. How long is gust_res_b.wav? See video below that shows the same behavior with a sound of about 6 seconds length. You can see that the trigger stays active at impact position for exactly that amount of time.
Re: Trigger repeating audio using SDL Mixer
#10ahhhhh yep, I'm sorry. This is embarrassing, I just checked and the file is 3 minutes long...I really should've double checked my export settings and length afterwards. It should've been like 7 seconds long. But thanks a lot for your assistance with this as well as my other questions.