> ## 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.

# WASAPI

> Use the Windows Audio Session API (WASAPI) in XBOX GDK games to manage audio streams to endpoint devices and handle device invalidations.

## Overview of WASAPI

Client applications can use the Windows Audio Session API (WASAPI) to manage the flow of audio data between the application and an audio endpoint device.

To learn more, see [About WASAPI](https://learn.microsoft.com/windows/desktop/coreaudio/wasapi).

## Sample code

For sample code that demonstrates how to play an in-memory .wav file by using WASAPI, see the source code for the [SimpleWASAPIPlaySound](https://aka.ms/atgsplSimpleWASAPIPlaySoundXDK) sample.

## Device Invalidations

In the GDK, games are expected to handle audio client device invalidations. Invalidations can occur at any time including
when the device is being activated or initialized. More info can be found in the [XDK to GDK comparison](/build/console-features/audio/overviews/comparison-of-xdk-and-gdk-audio-api).


## Related topics

- [Overview of audio](/build/console-features/audio/overviews/audio.md)
- [CreateCaptureAudioStateMonitor](/reference/audio/audiostatemonitor/functions/createcaptureaudiostatemonitor.md)
- [CreateCaptureAudioStateMonitorForCategory](/reference/audio/audiostatemonitor/functions/createcaptureaudiostatemonitorforcategory.md)
- [CreateCaptureAudioStateMonitorForCategoryAndDeviceRole](/reference/audio/audiostatemonitor/functions/createcaptureaudiostatemonitorforcategoryanddevicerole.md)
- [CreateRenderAudioStateMonitor](/reference/audio/audiostatemonitor/functions/createrenderaudiostatemonitor.md)
