文件名称:
AudioCapture.md
所在目录:
Openharmony v1.0 / docs / api / api-SmartVision-Devices
文件大小:
10.29 KB
下载地址:
文本预览:
# AudioCapture
## **Overview**
**Related Modules:**
[Audio](Audio.md)
**Description:**
Provides capabilities for audio capturing, including controlling the capturing, setting audio attributes, scenes, and volume, and capturing audio frames.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Data Fields
## **Details**
## **Field Documentation**
## CaptureFrame
```
int32_t(* AudioCapture::CaptureFrame) (struct [AudioCapture](AudioCapture.md) *capture, void *frame, uint64_t requestBytes, uint64_t *replyBytes)
```
**Description:**
Reads a frame of input data \(uplink data\) from the audio driver for capturing.
**Parameters:**
**Returns:**
Returns **0** if the input data is read successfully; returns a negative value otherwise.
## GetCapturePosition
```
int32_t(* AudioCapture::GetCapturePosition) (struct [AudioCapture](AudioCapture.md) *capture, uint64_t *frames, struct [AudioTimeStamp](AudioTimeStamp.md) *[time](zh-cn_topic_0000001054879478.md#gae7841e681c8c9d59818568d39553642c))
```
**Description:**
Obtains the last number of input audio frames.
**Parameters:**
**Returns:**
Returns **0** if the last number is obtained; returns a negative value otherwise.
**See also:**
[CaptureFrame](AudioCapture.md#a89f1baf4b6177f91b9135e86cc8681da)
## **Overview**
**Related Modules:**
[Audio](Audio.md)
**Description:**
Provides capabilities for audio capturing, including controlling the capturing, setting audio attributes, scenes, and volume, and capturing audio frames.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Data Fields
struct AudioControl Defines the audio control. For details, see AudioControl. | |
struct AudioAttribute Defines the audio attribute. For details, see AudioAttribute. | |
struct AudioScene Defines the audio scene. For details, see AudioScene. | |
struct AudioVolume Defines audio volume. For details, see AudioVolume. | |
CaptureFrame )(struct AudioCapture *capture, void *frame, uint64_t requestBytes, uint64_t *replyBytes) | Reads a frame of input data (uplink data) from the audio driver for capturing. |
GetCapturePosition )(struct AudioCapture *capture, uint64_t *frames, struct AudioTimeStamp *time) | Obtains the last number of input audio frames. |
## **Details**
## **Field Documentation**
## CaptureFrame
```
int32_t(* AudioCapture::CaptureFrame) (struct [AudioCapture](AudioCapture.md) *capture, void *frame, uint64_t requestBytes, uint64_t *replyBytes)
```
**Description:**
Reads a frame of input data \(uplink data\) from the audio driver for capturing.
**Parameters:**
capture | Indicates the pointer to the AudioCapture object to operate. |
frame | Indicates the pointer to the input data to read. |
requestBytes | Indicates the size of the input data, in bytes. |
replyBytes | Indicates the pointer to the actual length (in bytes) of the audio data to read. |
**Returns:**
Returns **0** if the input data is read successfully; returns a negative value otherwise.
## GetCapturePosition
```
int32_t(* AudioCapture::GetCapturePosition) (struct [AudioCapture](AudioCapture.md) *capture, uint64_t *frames, struct [AudioTimeStamp](AudioTimeStamp.md) *[time](zh-cn_topic_0000001054879478.md#gae7841e681c8c9d59818568d39553642c))
```
**Description:**
Obtains the last number of input audio frames.
**Parameters:**
capture | Indicates the pointer to the AudioCapture object to operate. |
frames | Indicates the pointer to the last number of input audio frames. |
time | Indicates the pointer to the timestamp associated with the frame. |
**Returns:**
Returns **0** if the last number is obtained; returns a negative value otherwise.
**See also:**
[CaptureFrame](AudioCapture.md#a89f1baf4b6177f91b9135e86cc8681da)
点赞
回复
X