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

# XDspDisconnect

> XDspDisconnect

Disconnect from the hardware server and release all resources allocated during [XDspConnect](https://docs.xbox.com/reference/audio/xdspaudio/functions/xdspconnect.md).

## Syntax

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

### Parameters

*handle*   \_In\_\
Type: [XDspClientHandle](https://docs.xbox.com/reference/audio/xdspaudio/handles/xdspclienthandle.md)

Handle created by calling [XDspConnect](https://docs.xbox.com/reference/audio/xdspaudio/functions/xdspconnect.md).

### 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](https://docs.xbox.com/reference/audio/xdspaudio/functions/xdspconnect.md) may be freed after calling [XDspDisconnect](https://docs.xbox.com/reference/audio/xdspaudio/functions/xdspdisconnect.md).

## 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](https://docs.xbox.com/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution-with-envelope.md)
* [Overview of a single stream Convolution using the XDSP API](https://docs.xbox.com/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution.md)
* [XDSP overview](https://docs.xbox.com/build/console-features/audio/overviews/xdsp-overview.md)

## See also

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


## Related topics

- [XDspClientHandle](https://docs.xbox.com/reference/audio/xdspaudio/handles/xdspclienthandle.md)
- [XDspConnect](https://docs.xbox.com/reference/audio/xdspaudio/functions/xdspconnect.md)
- [Overview of a single stream Convolution using the XDSP API](https://docs.xbox.com/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution.md)
- [Single-stream convolution with envelope using the XDSP API](https://docs.xbox.com/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution-with-envelope.md)
- [Overview of a single stream FFT/IFFT using the XDSP API](https://docs.xbox.com/build/console-features/audio/overviews/xdsp-overview-single-stream-fft-ifft.md)
