Go to the documentation of this file.
18 #include "picovoice.h"
20 #define PV_AUDIO_REC_AUDIO_FREQUENCY (16000U)
21 #define PV_AUDIO_REC_CHANNEL_NUMBER (1)
22 #define PV_AUDIO_REC_RECORD_BUFFER_SIZE (512)
23 #define PV_AUDIO_REC_VOLUME_LEVEL (100)
25 #define AUDIO_IN_PCM_BUFFER_SIZE ((uint32_t)(PV_AUDIO_REC_AUDIO_FREQUENCY / 1000 * PV_AUDIO_REC_CHANNEL_NUMBER))
26 #define AUDIO_IN_PDM_BUFFER_SIZE ((uint32_t)(128 * PV_AUDIO_REC_AUDIO_FREQUENCY / 16000 * PV_AUDIO_REC_CHANNEL_NUMBER))
uint8_t BSP_AUDIO_IN_SetVolume(uint8_t Volume)
Controls the audio in volume level.
static int32_t buffer_index
uint8_t BSP_AUDIO_IN_PDMToPCM(uint16_t *PDMBuf, uint16_t *PCMBuf)
Converts audio format from PDM to PCM.
uint8_t BSP_AUDIO_IN_Stop(void)
Stops audio recording.
@ PV_STATUS_INVALID_STATE
void BSP_AUDIO_IN_TransferComplete_CallBack(void)
User callback when record buffer is filled.
#define PV_AUDIO_REC_CHANNEL_NUMBER
uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
static uint16_t record_pdm_buffer[AUDIO_IN_PDM_BUFFER_SIZE]
uint32_t record_buffer_size
This file contains the common defines and functions prototypes for stm32f411e_discovery_audio....
static int16_t ping_pong_buffer[2][PV_AUDIO_REC_RECORD_BUFFER_SIZE]
static int32_t read_index
const int16_t * pv_audio_rec_get_new_buffer(void)
static uint16_t record_pcm_buffer[2 *AUDIO_IN_PCM_BUFFER_SIZE]
static int32_t write_index
pv_status_t pv_audio_rec_init(void)
#define PV_AUDIO_REC_RECORD_BUFFER_SIZE
uint8_t BSP_AUDIO_IN_Record(uint16_t *pbuf, uint32_t size)
Starts audio recording.
#define PV_AUDIO_REC_VOLUME_LEVEL
#define AUDIO_IN_PCM_BUFFER_SIZE
#define PV_AUDIO_REC_AUDIO_FREQUENCY
void pv_audio_rec_deinit(void)
#define DEFAULT_AUDIO_IN_BIT_RESOLUTION
void BSP_AUDIO_IN_HalfTransfer_CallBack(void)
Manages the DMA Half Transfer complete event.
static int32_t last_read_index
pv_status_t pv_audio_rec_start(void)
#define AUDIO_IN_PDM_BUFFER_SIZE