hi_audio_frame
Description
Defines the audio frame.
Prototype
typedef struct {
hi_audio_bit_width bit_width; /* audio frame bit_width */
hi_audio_snd_mode snd_mode; /* audio frame momo or stereo mode */
hi_u8 ATTRIBUTE *virt_addr[HI_AUDIO_FRAME_CHN_NUM];
hi_u64 ATTRIBUTE phys_addr[HI_AUDIO_FRAME_CHN_NUM];
hi_u64 time_stamp; /* audio frame time stamp */
hi_u32 seq; /* audio frame seq */
hi_u32 len; /* data length per channel in frame */
hi_u32 pool_id[HI_AUDIO_FRAME_CHN_NUM];
} hi_audio_frame;
Members
Member |
Description |
|---|---|
bit_width |
Audio sampling precision (bit width) |
snd_mode |
Audio channel mode |
virt_addr |
Virtual address of the audio frame data |
phys_addr |
Physical address of the audio frame data |
time_stamp |
Time stamp of the audio frame (unit: μs) |
seq |
Sequence number of the audio frame |
len |
Audio frame length of a single channel (unit: byte) |
pool_id |
ID of an audio frame buffer pool |
len (audio frame length) indicates the data length of a single channel.
The mono-channel data is stored at the virtual address virt_addr [0], and the len. The left-channel data and right-channel data of the stereo data are stored separately. To be specific, the left-channel data with the length of len is stored at the virtual address virt_addr [0], whereas the right-channel data with the length of len is stored at the virtual address virt_addr [0].