Version
menu_open
link
Wwise SDK 2023.1.4
AkCommunication.h
Go to the documentation of this file.
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  Copyright (c) 2024 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 /// \file AK/Comm/AkCommunication.h
28 /// The main communication interface (between the in-game sound engine and
29 /// authoring tool).
30 /// \sa
31 /// - \ref initialization_comm
32 /// - \ref termination_comm
33 
34 #ifndef _AK_COMMUNICATION_H
35 #define _AK_COMMUNICATION_H
36 
40 
41 #define AK_COMM_SETTINGS_MAX_STRING_SIZE 64
42 #define AK_COMM_SETTINGS_MAX_URL_SIZE 128
43 
44 /// Platform-independent initialization settings of communication module between the Wwise sound engine
45 /// and authoring tool.
46 /// \sa
47 /// - AK::Comm::Init()
49 {
52  {
53  szAppNetworkName[0] = 0;
54  szCommProxyServerUrl[0] = 0;
55  }
56 
57  /// Ports used for communication between the Wwise authoring application and your game.
58  /// All of these ports are opened in the game when Wwise communication is enabled.
59  ///
60  /// \sa
61  /// - \ref initialization_comm_ports
62  /// - AK::Comm::GetDefaultInitSettings()
63  /// - AK::Comm::Init()
64  struct Ports
65  {
66  /// Constructor
69 #if defined( AK_COMM_NO_DYNAMIC_PORTS )
71 #else
72  , uCommand( 0 )
73 #endif
74  {
75  }
76 
77  /// This is where the authoring application broadcasts "Game Discovery" requests
78  /// to discover games running on the network. Default value: 24024.
79  ///
80  /// \warning Unlike the other port in this structure, this port cannot be dynamic: setting it
81  /// to 0 will disable discovery. Refer to \ref initialization_comm_ports_discovery_broadcast
82  /// for more details.
84 
85  /// Used by the "command" channel.
86  /// \remark Set to 0 to request a dynamic/ephemeral port.
88  };
89 
90  /// Ports used for communication between the Wwise authoring application and your game.
91  /// \sa
92  /// - \ref initialization_comm
93  /// - AkCommSettings::Ports
94  /// - AK::Comm::Init()
96 
97  /// Allows selecting the communication system used to connect remotely the Authoring tool on the device.
99  {
100  AkCommSystem_Socket, /// The recommended default communication system
101  AkCommSystem_HTCS /// HTCS when available only, will default to AkCommSystem_Socket if the HTCS system is not available.
102  };
103 
104  /// Select the device of the communication system.
105  /// By default, connecting to the Authoring tool
106  /// \sa
107  /// - \ref initialization_comm
108  /// - AkCommSettings::AkCommSystem
109  /// - AK::Comm::Init()
111 
112  /// Tells if the base console communication library should be initialized.
113  /// If set to false, the game should load/initialize the console's communication library prior to calling this function.
114  /// Set to false only if your game already use sockets before the sound engine initialization.
115  /// Some consoles have critical requirements for initialization, see \ref initialization_comm_console_lib
117 
118  /// Optional name that will be displayed over network remote connection of Wwise.
119  /// It must be a NULL terminated string.
121 
122  /// Optional URL of Comm proxy server (only applicable for platforms incapable of acting as raw UDP/TCP servers)
124 };
125 
126 namespace AK
127 {
128  namespace Comm
129  {
130  ///////////////////////////////////////////////////////////////////////
131  /// @name Initialization
132  //@{
133 
134  /// Initializes the communication module. When this is called, and AK::SoundEngine::RenderAudio()
135  /// is called periodically, you may use the authoring tool to connect to the sound engine.
136  ///
137  /// \warning This function must be called after the sound engine and memory manager have
138  /// been properly initialized.
139  ///
140  ///
141  /// \remark The AkCommSettings structure should be initialized with
142  /// AK::Comm::GetDefaultInitSettings(). You can then change some of the parameters
143  /// before calling this function.
144  ///
145  /// \return
146  /// - AK_Success if initialization was successful.
147  /// - AK_InvalidParameter if one of the settings is invalid.
148  /// - AK_InsufficientMemory if the specified pool size is too small for initialization.
149  /// - AK_Fail for other errors.
150  ///
151  /// \sa
152  /// - \ref initialization_comm
153  /// - AK::Comm::GetDefaultInitSettings()
154  /// - AkCommSettings::Ports
156  const AkCommSettings & in_settings///< Initialization settings.
157  );
158 
159  /// Gets the last error from the OS-specific communication library.
160  /// \return The system error code. Check the code in the platform manufacturer documentation for details about the error.
162 
163  /// Gets the communication module's default initialization settings values.
164  /// \sa
165  /// - \ref initialization_comm
166  /// - AK::Comm::Init()
168  AkCommSettings & out_settings ///< Returned default initialization settings.
169  );
170 
171  /// Terminates the communication module.
172  /// \warning This function must be called before the memory manager is terminated.
173  /// \sa
174  /// - \ref termination_comm
175  AK_EXTERNAPIFUNC( void, Term )();
176 
177  /// Terminates and reinitialize the communication module using current settings.
178  ///
179  /// \return
180  /// - AK_Success if initialization was successful.
181  /// - AK_InvalidParameter if one of the settings is invalid.
182  /// - AK_InsufficientMemory if the specified pool size is too small for initialization.
183  /// - AK_Fail for other errors.
184  ///
185  /// \sa
186  /// - \ref AK::SoundEngine::iOS::WakeupFromSuspend()
188 
189 
190  /// Get the initialization settings currently in use by the CommunicationSystem
191  ///
192  /// \return
193  /// - AK_Success if initialization was successful.
195 
196 
197  /// Get the port currently in used by the command channel.
198  ///
199  /// \return
200  /// - Port number.
202 
203  //@}
204  }
205 }
206 
207 #endif // _AK_COMMUNICATION_H
char szCommProxyServerUrl[AK_COMM_SETTINGS_MAX_URL_SIZE]
Optional URL of Comm proxy server (only applicable for platforms incapable of acting as raw UDP/TCP s...
uint16_t AkUInt16
Unsigned 16-bit integer.
Audiokinetic namespace.
char szAppNetworkName[AK_COMM_SETTINGS_MAX_STRING_SIZE]
#define AK_EXTERNAPIFUNC(_type, _name)
AKRESULT
Standard function call result.
Definition: AkTypes.h:131
AKSOUNDENGINE_API AKRESULT Reset()
AKSOUNDENGINE_API AKRESULT Init(const AkCommSettings &in_settings)
AKSOUNDENGINE_API AkInt32 GetLastError()
int32_t AkInt32
Signed 32-bit integer.
AKSOUNDENGINE_API const AkCommSettings & GetCurrentSettings()
AKSOUNDENGINE_API void Term()
#define AK_COMM_SETTINGS_MAX_URL_SIZE
AKSOUNDENGINE_API void GetDefaultInitSettings(AkCommSettings &out_settings)
#define AK_COMM_NO_DYNAMIC_PORTS
Platform does not support dynamic/ephemeral ports for communication.
Definition: AkTypes.h:153
AkCommSystem
Allows selecting the communication system used to connect remotely the Authoring tool on the device.
AkCommSystem commSystem
@ AkCommSystem_HTCS
The recommended default communication system.
#define AK_COMM_SETTINGS_MAX_STRING_SIZE
AKSOUNDENGINE_API AkUInt16 GetCommandPort()
#define AK_COMM_DEFAULT_DISCOVERY_PORT
Default discovery port for most platforms using IP sockets for communication.
Definition: AkTypes.h:1253

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise