Table of Contents

Wwise SDK 2019.1.9
AkMusicEngine.h
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Version: <VERSION> Build: <BUILDNUMBER>
25  Copyright (c) <COPYRIGHTYEAR> Audiokinetic Inc.
26 *******************************************************************************/
27 
28 // AkMusicEngine.h
29 
30 /// \file
31 /// The main music engine interface.
32 
33 
34 #ifndef _AK_MUSICENGINE_H_
35 #define _AK_MUSICENGINE_H_
36 
37 #include <AK/SoundEngine/Common/AkSoundEngineExport.h>
38 #include <AK/SoundEngine/Common/AkTypes.h>
39 #include <AK/SoundEngine/Common/AkCallback.h>
40 
41 /// Platform-independent initialization settings of the music engine
42 /// \sa
43 /// - AK::MusicEngine::Init()
44 /// - \ref soundengine_integration_init_advanced
46 {
47  AkReal32 fStreamingLookAheadRatio; ///< Multiplication factor for all streaming look-ahead heuristic values.
48 };
49 
50 // Audiokinetic namespace
51 namespace AK
52 {
53  /// Music engine namespace
54  /// \warning The functions in this namespace are not thread-safe, unless stated otherwise.
55  namespace MusicEngine
56  {
57  ///////////////////////////////////////////////////////////////////////
58  /// @name Initialization
59  //@{
60 
61  /// Initialize the music engine.
62  /// \warning This function must be called after the base sound engine has been properly initialized.
63  /// There should be no AK API call between AK::SoundEngine::Init() and this call. Any call done in between is potentially unsafe.
64  /// \return AK_Success if the Init was successful, AK_Fail otherwise.
65  /// \sa
66  /// - \ref workingwithsdks_initialization
67  AK_EXTERNAPIFUNC( AKRESULT, Init )(
68  AkMusicSettings * in_pSettings ///< Initialization settings (can be NULL, to use the default values)
69  );
70 
71  /// Get the music engine's default initialization settings values
72  /// \sa
73  /// - \ref soundengine_integration_init_advanced
74  /// - AK::MusicEngine::Init()
75  AK_EXTERNAPIFUNC( void, GetDefaultInitSettings )(
76  AkMusicSettings & out_settings ///< Returned default platform-independent music engine settings
77  );
78 
79  /// Terminate the music engine.
80  /// \warning This function must be called before calling Term() on the base sound engine.
81  /// \sa
82  /// - \ref workingwithsdks_termination
83  AK_EXTERNAPIFUNC( void, Term )(
84  );
85 
86  /// Query information on the active segment of a music object that is playing. Use the playing ID
87  /// that was returned from AK::SoundEngine::PostEvent(), provided that the event contained a play
88  /// action that was targetting a music object. For any configuration of interactive music hierarchy,
89  /// there is only one segment that is active at a time.
90  /// To be able to query segment information, you must pass the AK_EnableGetMusicPlayPosition flag
91  /// to the AK::SoundEngine::PostEvent() method. This informs the sound engine that the source associated
92  /// with this event should be given special consideration because GetPlayingSegmentInfo() can be called
93  /// at any time for this AkPlayingID.
94  /// Notes:
95  /// - If the music object is a single segment, you will get negative values for AkSegmentInfo::iCurrentPosition
96  /// during the pre-entry. This will never occur with other types of music objects because the
97  /// pre-entry of a segment always overlaps another active segment.
98  /// - The active segment during the pre-entry of the first segment of a Playlist Container or a Music Switch
99  /// Container is "nothing", as well as during the post-exit of the last segment of a Playlist (and beyond).
100  /// - When the active segment is "nothing", out_uSegmentInfo is filled with zeros.
101  /// - If in_bExtrapolate is true (default), AkSegmentInfo::iCurrentPosition is corrected by the amount of time elapsed
102  /// since the beginning of the audio frame. It is thus possible that it slightly overshoots the total segment length.
103  /// \return AK_Success if there is a playing music structure associated with the specified playing ID.
104  /// \sa
105  /// - AK::SoundEngine::PostEvent
106  /// - AkSegmentInfo
107  AK_EXTERNAPIFUNC( AKRESULT, GetPlayingSegmentInfo )(
108  AkPlayingID in_PlayingID, ///< Playing ID returned by AK::SoundEngine::PostEvent().
109  AkSegmentInfo & out_segmentInfo, ///< Structure containing information about the active segment of the music structure that is playing.
110  bool in_bExtrapolate = true ///< Position is extrapolated based on time elapsed since last sound engine update.
111  );
112 
113  //@}
114  }
115 }
116 
117 #endif // _AK_MUSICENGINE_H_
118 
Audiokinetic namespace.
AKSOUNDENGINE_API void __cdecl GetDefaultInitSettings(AkMusicSettings &out_settings)
AKSOUNDENGINE_API AKRESULT __cdecl GetPlayingSegmentInfo(AkPlayingID in_PlayingID, AkSegmentInfo &out_segmentInfo, bool in_bExtrapolate=true)
Structure used to query info on active playing segments.
Definition: AkCallback.h:193
AKSOUNDENGINE_API AKRESULT __cdecl Init(AkMusicSettings *in_pSettings)
AkReal32 fStreamingLookAheadRatio
Multiplication factor for all streaming look-ahead heuristic values.
Definition: AkMusicEngine.h:47
AKSOUNDENGINE_API void __cdecl Term()