# AudioManager - [Overview](#section92245219165630) - [Summary](#section1284654492165630) - [Data Fields](#pub-attribs) - [Details](#section1307104535165630) - [Field](#section435920409165630) - [GetAllAdapters](#a93a0ffb0df907fabcfca827d31dadf39) - [LoadAdapter](#ab090e9c760a2888b55acc7baa4222ccb) - [UnloadAdapter](#a556137764c5bf784972ba79303720fc3) ## **Overview** **Related Modules:** [Audio](Audio.md) **Description:** Manages audio adapters through a specific adapter driver program loaded based on the given audio adapter descriptor. See also : [AudioAdapter](AudioAdapter.md) **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Data Fields

Variable Name

Description

GetAllAdapters )(struct AudioManager *manager, struct AudioAdapterDescriptor **descs, int32_t *size)

int32_t(*

Obtains the list of all adapters supported by an audio driver.

LoadAdapter )(struct AudioManager *manager, const struct AudioAdapterDescriptor *desc, struct AudioAdapter **adapter)

int32_t(*

Loads the driver for an audio adapter.

UnloadAdapter )(struct AudioManager *manager, struct AudioAdapter *adapter)

void(*

Unloads the driver of an audio adapter.

## **Details** ## **Field ** ## GetAllAdapters ``` int32_t(* AudioManager::GetAllAdapters) (struct [AudioManager](AudioManager.md) *manager, struct [AudioAdapterDescriptor](AudioAdapterDescriptor.md) **descs, int32_t *size) ``` **Description:** Obtains the list of all adapters supported by an audio driver. **Parameters:**

Name

Description

manager Indicates the pointer to the audio adapter manager to operate.
descs Indicates the double pointer to the audio adapter list.
size Indicates the pointer to the length of the list.
**Returns:** Returns **0** if the list is obtained successfully; returns a negative value otherwise. **See also:** [LoadAdapter](AudioManager.md#ab090e9c760a2888b55acc7baa4222ccb) ## LoadAdapter ``` int32_t(* AudioManager::LoadAdapter) (struct [AudioManager](AudioManager.md) *manager, const struct [AudioAdapterDescriptor](AudioAdapterDescriptor.md) *desc, struct [AudioAdapter](AudioAdapter.md) **adapter) ``` **Description:** Loads the driver for an audio adapter. For example, to load a USB driver, you may need to load a dynamic-link library \(\*.so\) in specific implementation. **Parameters:**

Name

Description

manager Indicates the pointer to the audio adapter manager to operate.
desc Indicates the pointer to the descriptor of the audio adapter.
adapter Indicates the double pointer to the audio adapter.
**Returns:** Returns **0** if the driver is loaded successfully; returns a negative value otherwise. **See also:** [GetAllAdapters](AudioManager.md#a93a0ffb0df907fabcfca827d31dadf39) [UnloadAdapter](AudioManager.md#a556137764c5bf784972ba79303720fc3) ## UnloadAdapter ``` void(* AudioManager::UnloadAdapter) (struct [AudioManager](AudioManager.md) *manager, struct [AudioAdapter](AudioAdapter.md) *adapter) ``` **Description:** Unloads the driver of an audio adapter. **Parameters:**

Name

Description

manager Indicates the pointer to the audio adapter manager to operate.
adapter Indicates the pointer to the audio adapter whose driver will be unloaded.
**See also:** [LoadAdapter](AudioManager.md#ab090e9c760a2888b55acc7baa4222ccb)