Trigger repeating audio using SDL Mixer

#1
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

#2
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.

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++
Image
Attachments
Immagine.png
Immagine.png (189.23 KiB) Viewed 1036 times

Re: Trigger repeating audio using SDL Mixer

#3
Hi 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.
looping.png
looping.png (41.28 KiB) Viewed 1034 times
@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.
mfx_debug.jpg
mfx_debug.jpg (48.29 KiB) Viewed 1034 times
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.
material_effects.png
material_effects.png (3.61 KiB) Viewed 1034 times
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

#8
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.
Sure, here's a short video clip showing the settings and the described behavior.
Attachments
bullet_impact.JPG
bullet_impact.JPG (70.79 KiB) Viewed 990 times

Re: Trigger repeating audio using SDL Mixer

#9
If 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.

Who is online

Users browsing this forum: No registered users and 1 guest