Version
menu

Wwise SDK 2025.1.0
Integration Details - Dynamic Dialogue

Introduction

Dialogue Events are created by the Wwise user. At runtime, a dialogue event is resolved into an audio node ID using a specified argument path, which corresponds to the arguments chosen by the Wwise user.

This audio node ID can then be placed into the playlist of a dynamic sequence for playback. The dynamic sequence is essentially a runtime-created sample-accurate sequence container.

Integrating Dialogue Events

You can resolve a dialogue event into an audio node ID using a specified argument path. The order of argument values in the path needs to match the order of arguments set in the Wwise authoring application.

The argument path can be specified either using either argument value IDs or names. To indicate a fallback argument value, AK_FALLBACK_ARGUMENTVALUE_ID or an empty name (L"") is used.

Using Dynamic Sequences

Dynamic sequences allow you to:

  • Enqueue several audio nodes to play with sample-accurate behavior, with an optional delay between items.
  • Modify the playlist during playback.
  • Pause, Resume and Stop playback.
  • Be notified at the end of each playlist item through a callback (in addition to all normal event-related callbacks).

Opening a Dynamic Sequence yields an AkPlayingID used for further interaction. Close should be the last call to be made using a given AkPlayingID. Closing a playing dynamic sequence will not stop it: it will play until finished and then deallocate itself. Play starts playback. During playback, the dynamic sequence takes items either from a playlist or a user callback.

Playlist-based sequences

Playlist-based sequences determine the next item to play from a AK::SoundEngine::DynamicSequence::Playlist object. The playlist is progressively emptied until it contains no more items and playback stops.

To modify the playlist, you must lock it. A corresponding unlock call needs to be made once the modifications are done. Holding the lock will block the sound engine thread from accessing the playlist. It is therefore necessary to hold the lock for as little time as possible.

Note: Modifying the playlist content is a synchronous call while Pause, Stop, Resume, and Break are done asynchronously.

The Playlist class is derived from AkArray, so standard array access methods can be used to modify the playlist. A simple Enqueue method is provided for convenience. A playlist item consists of an audio node ID, a delay time in milliseconds and a user-data field.

Callback-based sequences

Callback-based sequences determine the next item to play from an event callback. A sequence opened with the AK_DynamicSequenceSelect callback flag is a callback-based dynamic sequence. Callback-based sequences have no associated Playlist object.

When a new item must be selected, the user event callback is invoked with type AK_DynamicSequenceSelect. The callback info pointer can be cast to AkDynamicSequenceSelectCallbackInfo and then filled out with the playback information for the next item to play. The callback blocks the sound engine thread. It is therefore necessary to return from the callback as soon as possible.

If the user callback fails to provide a valid audio node ID, the sequence is stopped. Use AK::SoundEngine::DynamicSequence::Play to start it when you are ready to provide a new playback item.


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