Skip to main content

XApuConnect

Establishes a connection and allocate the necessary resources for an Audio Processing Unit (XAPU).

Syntax

Parameters

params   _In_
Type: XApuConnectInputParameters*
Parameters passed to XApuConnect to allocated resources. data   _Out_
Type: XApuConnectOutputParameters*
Parameters returned by XApuConnect. handle   _Outptr_
Type: XApuHandle*
Pointer to an XAPU handle returned. This handle is used to indicate which XAPU instance to manipulate when calling other XAPU APIs.

Return value

Type: HRESULT Returns S_OK if successful; otherwise, returns an error code.

Remarks

The caller must specify an XApuProcessType for the XAPU client to perform. An instance of an XAPU can work with one type of process during its lifetime. To perform two or more different processes, two or more XAPU instances must be instantiated. Inside the XApuConnectInputParameters, the caller must specify the following:
  • Maximum number of streams the XAPU is expected to process simultaneously.
  • Maximum number of queued commands for each stream.
  • Total required memory allocation for all commands and streams. This includes total allocations for input, output and processing data across the maximum number of streams times queued commands per stream.
If the call succeeded, the XApuConnectOutputParameters::baseData parameter will point to a memory chunk that the caller should use to pass input data and retrieve the output data of the streams. It is up to the caller to partition and recycle this memory chunk. The allocation will be freed upon XApuDisconnect call. XApuConnectOutputParameters::resultReadyEvent will contain a Win32 event handle when XApuConnectOptions::EnableResultReadyEvent is set. This handle will be closed upon an XApuDisconnect call. This handle will be closed upon a XApuDisconnect call. It is not recommended to call XapuConnect and XApuDisconnect often to start and stop streams as those calls are time consuming and could also lead to resource losses due to memory fragmentation. Instead XapuConnect should be called once upon initialization of the streaming session, then XApuCommandType::Activate and XApuCommandType::Deactivate should be used to start and stop streams during streaming. At the end of the streaming session, XApuDisconnect should be called. This is true for all XAPU clients.

Requirements

Header: xapu.h Library: xapu.lib Supported platforms: XBOX Series X|S

Conceptual documentation

See also

XAPU
XApuDecodeConvertCommand
XApuDequeueResult
XApuEnqueueCommand
XApuGetResultCount
Last modified on August 20, 2026