# Creating and Destroying Devices

### Creating and destroying devices

It is very simple to create and destroy a device. Simply create an NDI receiver that one wishes to receive audio from and pass it into `NDIlib_avsync_create`, this will return an instance of type `NDIlib_avsync_instance_t` which may be used until you no longer need it. Once you no longer need it you should call `NDIlib_avsync_destroy`. Please note that you should destroy a device before the corresponding `NDIlib_recv_instance_t` is called since an internal reference to this object is kept within the `NDIlib_avsync_instance_t`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ndi.video/all/developing-with-ndi/advanced-sdk/av-sync/creating-and-destroying-devices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
