You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
861 B

/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2020-2020. All rights reserved.
* Description: audio hal primary input header file.
* Author: Hisilicon
* Create: 2020-05-11
* Notes: NA
* History: 2020-05-11 yinyingcai for CodingStyle
*/
#ifndef HPI_H
#define HPI_H
#include <system/audio.h>
#include <hardware/audio.h>
#include <tinyalsa/asoundlib.h>
#include "audio_hw.h"
#define AI_CARD_ID 0
#define AI_DEVICE_ID 0
#define AI_DEVICE_ID1 1
struct hpi_data {
int in_card;
int in_device;
size_t frames_read;
struct pcm *pcm;
struct stream_in *in;
FILE *fd;
};
int hpi_open(struct hpi_data *hpi);
int hpi_create(struct hpi_data **pphpi);
void hpi_destroy(struct hpi_data *hpi);
int hpi_close(struct hpi_data *hpi);
ssize_t hpi_read(struct hpi_data *hpi, const uint8_t* buffer, size_t bytes);
#endif