> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XDspDisconnect

> XDspDisconnect

# XDspDisconnect

Disconnect from the hardware server and release all resources allocated during [XDspConnect](/reference/audio/xdspaudio/functions/xdspconnect).

## Syntax

```cpp theme={null}
HRESULT XDspDisconnect(  
         XDspClientHandle handle  
)  
```

### Parameters

*handle*   \_In\_\
Type: [XDspClientHandle](/reference/audio/xdspaudio/handles/xdspclienthandle)

Handle created by calling [XDspConnect](/reference/audio/xdspaudio/functions/xdspconnect).

### Return value

Type: HRESULT

Returns S\_OK if successful. If the method fails, it returns one of the following codes (partial list):

| Return code                             | Description                                                         |
| --------------------------------------- | ------------------------------------------------------------------- |
| XDSP\_E\_NOT\_ALL\_HANDLES\_DEACTIVATED | Not all streams have been deactivated before calling this function. |

## Remarks

All XDSP streams must be deactivated successfully before calling this function. *baseBuffer* memory that was passed to [XDspConnect](/reference/audio/xdspaudio/functions/xdspconnect) may be freed after calling [XDspDisconnect](/reference/audio/xdspaudio/functions/xdspdisconnect).

## Requirements

**Header:** XDspAudio.h

**Library:** Chad.lib

**Supported platforms:** XBOX Series X|S

## Conceptual documentation

* [Overview of a single stream Convolution with Envelope using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution-with-envelope)
* [Overview of a single stream Convolution using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution)
* [XDSP overview](/build/console-features/audio/overviews/xdsp-overview)

## See also

[XDSP](/reference/audio/xdspaudio/xdspaudio_members)\
[XDspConnect](/reference/audio/xdspaudio/functions/xdspconnect)\
[XDSP Errors](/reference/audio/xdspaudio/enums/xdsperrors)\
[Overview of a single stream Convolution using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution)\
[Overview of a single stream FFT/IFFT using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-fft-ifft)\
[Overview of a single stream Convolution with Envelope using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution-with-envelope)


## Related topics

- [XDspConnect](/reference/audio/xdspaudio/functions/xdspconnect.md)
- [Overview of a single stream Convolution using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution.md)
- [Single-stream convolution with envelope using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution-with-envelope.md)
- [Overview of a single stream FFT/IFFT using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-fft-ifft.md)
- [XDspConnectWithMaximumStreamLimit](/reference/audio/xdspaudio/functions/xdspconnectwithmaximumstreamlimit.md)
