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 (2)
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.
pv_status_t pv_audio_rec_start(void)
This file contains the common defines and functions prototypes for the stm32469i_discovery_audio....
uint8_t BSP_AUDIO_IN_PDMToPCM(uint16_t *PDMBuf, uint16_t *PCMBuf)
Converts audio format from PDM to PCM.
static int32_t write_index
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.
void BSP_AUDIO_IN_DeInit(void)
Deinit the audio IN peripherals.
uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
#define AUDIO_IN_PCM_BUFFER_SIZE
uint32_t record_buffer_size
static int32_t buffer_index
#define PV_AUDIO_REC_VOLUME_LEVEL
const int16_t * pv_audio_rec_get_new_buffer(void)
uint8_t BSP_AUDIO_IN_Record(uint16_t *pbuf, uint32_t size)
Starts audio recording.
static int16_t ping_pong_buffer[2][PV_AUDIO_REC_RECORD_BUFFER_SIZE]
pv_status_t pv_audio_rec_init(void)
static int32_t last_read_index
#define PV_AUDIO_REC_RECORD_BUFFER_SIZE
static uint16_t record_pcm_buffer[AUDIO_IN_PCM_BUFFER_SIZE]
#define DEFAULT_AUDIO_IN_BIT_RESOLUTION
#define PV_AUDIO_REC_CHANNEL_NUMBER
static uint16_t record_pdm_buffer[AUDIO_IN_PDM_BUFFER_SIZE]
static int32_t read_index
void pv_audio_rec_deinit(void)
void BSP_AUDIO_IN_HalfTransfer_CallBack(void)
Manages the DMA Half Transfer complete event.
#define AUDIO_IN_PDM_BUFFER_SIZE
#define PV_AUDIO_REC_AUDIO_FREQUENCY