Version
menu_open
Wwise SDK 2021.1.14
Simulating Rapid Gunfire

If you are working on a project that includes a firearm with a rapid rate of fire, such as a machine gun, it can be difficult to accurately synchronize the bullet sounds with the firing action. Because Wwise events are processed asynchronously on the audio thread, there might be a slight delay between the break action and the termination of a gunshot sound if you implement the sound through a Sample Accurate transition on a looping container.

To achieve a sample-accurate trigger rate with rapid gunshots, we recommend that you use MIDI to trigger each bullet sound. PostMIDIOnEvent makes it possible to respect the exact offset (in samples) within a given audio frame, which allows for high accuracy.

A MIDI-based solution requires the following:

  • Use one of the following options to manage audio rendering:
  • The Integration Demo contains a sample MIDI implementation that uses a metronome sound. You can apply the same principles to rapid gunfire. The relevant file is available at <WwiseInstallationFolder>\SDK\samples\IntegrationDemo\DemoMIDIMetronome.cpp and the corresponding documentation is available at Integration Demo Sample (see the MIDI API section).
  • The relevant APIs are PostMIDIOnEvent() and StopMIDIOnEvent().

Cette page a-t-elle été utile ?

Besoin d'aide ?

Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !

Visitez notre page d'Aide

Décrivez-nous de votre projet. Nous sommes là pour vous aider.

Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !

Partir du bon pied avec Wwise