同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Related Modules:
Description:
Provides audio adapter capabilities, including initializing ports, creating rendering and capturing tasks, and obtaining the port capability set.
Since:
1.0
Version:
1.0
InitAllPorts )(struct AudioAdapter *adapter) |
|
CreateRender )(struct AudioAdapter *adapter, const struct AudioDeviceDescriptor *desc, const struct AudioSampleAttributes *attrs, struct AudioRender **render) |
Creates an AudioRender object. |
DestroyRender )(struct AudioAdapter *adapter, struct AudioRender *render) |
Destroys an AudioRender object. |
CreateCapture )(struct AudioAdapter *adapter, const struct AudioDeviceDescriptor *desc, const struct AudioSampleAttributes *attrs, struct AudioCapture **capture) |
Creates an AudioCapture object. |
DestroyCapture )(struct AudioAdapter *adapter, struct AudioCapture *capture) |
Destroys an AudioCapture object. |
GetPortCapability )(struct AudioAdapter *adapter, const struct AudioPort *port, struct AudioPortCapability *capability) |
Obtains the capability set of the port driver for the audio adapter. |
SetPassthroughMode )(struct AudioAdapter *adapter, const struct AudioPort *port, enum AudioPortPassthroughMode mode) |
Sets the passthrough data transmission mode of the audio port driver. |
GetPassthroughMode )(struct AudioAdapter *adapter, const struct AudioPort *port, enum AudioPortPassthroughMode *mode) |
Obtains the passthrough data transmission mode of the audio port driver. |
int32_t(* AudioAdapter::CreateCapture) (struct [AudioAdapter](AudioAdapter.md) *adapter, const struct [AudioDeviceDescriptor](AudioDeviceDescriptor.md) *desc, const struct [AudioSampleAttributes](AudioSampleAttributes.md) *attrs, struct [AudioCapture](AudioCapture.md) **capture)
Description:
Creates an AudioCapture object.
Parameters:
adapter | Indicates the pointer to the audio adapter to operate. |
desc | Indicates the pointer to the descriptor of the audio adapter to start. |
attrs | Indicates the pointer to the audio sampling attributes to open. |
capture | Indicates the double pointer to the AudioCapture object. |
Returns:
Returns 0 if the AudioCapture object is created successfully; returns a negative value otherwise.
See also:
int32_t(* AudioAdapter::CreateRender) (struct [AudioAdapter](AudioAdapter.md) *adapter, const struct [AudioDeviceDescriptor](AudioDeviceDescriptor.md) *desc, const struct [AudioSampleAttributes](AudioSampleAttributes.md) *attrs, struct [AudioRender](AudioRender.md) **render)
Description:
Creates an AudioRender object.
Parameters:
adapter | Indicates the pointer to the audio adapter to operate. |
desc | Indicates the pointer to the descriptor of the audio adapter to start. |
attrs | Indicates the pointer to the audio sampling attributes to open. |
render | Indicates the double pointer to the AudioRender object. |
Returns:
Returns 0 if the AudioRender object is created successfully; returns a negative value otherwise.
See also:
int32_t(* AudioAdapter::DestroyCapture) (struct [AudioAdapter](AudioAdapter.md) *adapter, struct [AudioCapture](AudioCapture.md) *capture)
Description:
Destroys an AudioCapture object.
Parameters:
adapter | Indicates the pointer to the audio adapter to operate. |
capture | Indicates the pointer to the AudioCapture object to operate. |
Attention:
Do not destroy the object during audio capturing.
Returns:
Returns 0 if the AudioCapture object is destroyed; returns a negative value otherwise.
See also:
int32_t(* AudioAdapter::DestroyRender) (struct [AudioAdapter](AudioAdapter.md) *adapter, struct [AudioRender](AudioRender.md) *render)
Description:
Destroys an AudioRender object.
Parameters:
adapter | Indicates the pointer to the audio adapter to operate. |
render | Indicates the pointer to the AudioRender object to operate. |
Attention:
Do not destroy the object during audio rendering.
Returns:
Returns 0 if the AudioRender object is destroyed; returns a negative value otherwise.
See also:
int32_t(* AudioAdapter::GetPassthroughMode) (struct [AudioAdapter](AudioAdapter.md) *adapter, const struct [AudioPort](AudioPort.md) *port, enum [AudioPortPassthroughMode](Audio.md#ga186d2d4f9a2ecacb80cd2cce2bd26f0e) *mode)
Description:
Obtains the passthrough data transmission mode of the audio port driver.
Parameters:
adapter | Indicates the pointer to the audio adapter to operate. |
port | Indicates the pointer to the port. |
mode | Indicates the pointer to the passthrough transmission mode to obtain. |
Returns:
Returns 0 if the mode is successfully obtained; returns a negative value otherwise.
See also:
int32_t(* AudioAdapter::GetPortCapability) (struct [AudioAdapter](AudioAdapter.md) *adapter, const struct [AudioPort](AudioPort.md) *port, struct [AudioPortCapability](AudioPortCapability.md) *capability)
Description:
Obtains the capability set of the port driver for the audio adapter.
Parameters:
adapter | Indicates the pointer to the audio adapter to operate. |
port | Indicates the pointer to the port. |
capability | Indicates the pointer to the capability set to obtain. |
Returns:
Returns 0 if the capability set is successfully obtained; returns a negative value otherwise.
int32_t(* AudioAdapter::InitAllPorts) (struct [AudioAdapter](AudioAdapter.md) *adapter)
Description:
Initializes all ports of an audio adapter.
Call this function before calling other driver functions to check whether the initialization is complete. If the initialization is not complete, wait for a while (for example, 100 ms) and perform the check again until the port initialization is complete.
Parameters:
adapter | Indicates the pointer to the audio adapter to operate. |
Returns:
Returns 0 if the initialization is successful; returns a negative value otherwise.
int32_t(* AudioAdapter::SetPassthroughMode) (struct [AudioAdapter](AudioAdapter.md) *adapter, const struct [AudioPort](AudioPort.md) *port, enum [AudioPortPassthroughMode](Audio.md#ga186d2d4f9a2ecacb80cd2cce2bd26f0e) mode)
Description:
Sets the passthrough data transmission mode of the audio port driver.
Parameters:
adapter | Indicates the pointer to the audio adapter to operate. |
port | Indicates the pointer to the port. |
mode | Indicates the passthrough transmission mode to set. |
Returns:
Returns 0 if the setting is successful; returns a negative value otherwise.
See also:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。