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 (10)
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))
109 if (Instance == 1U) {
__STATIC_FORCEINLINE void SCB_CleanDCache_by_Addr(uint32_t *addr, int32_t dsize)
D-Cache Clean by address.
ALIGN_32BYTES(static uint16_t record_pdm_buffer[AUDIO_IN_PDM_BUFFER_SIZE]) __attribute__((section(".RAM_D3")))
uint8_t BSP_AUDIO_IN_PDMToPCM(uint16_t *PDMBuf, uint16_t *PCMBuf)
Converts audio format from PDM to PCM.
static int16_t ping_pong_buffer[2][PV_AUDIO_REC_RECORD_BUFFER_SIZE]
uint8_t BSP_AUDIO_IN_Stop(void)
Stops audio recording.
@ PV_STATUS_INVALID_STATE
#define PV_AUDIO_REC_VOLUME_LEVEL
#define AUDIO_IN_PDM_BUFFER_SIZE
void BSP_AUDIO_IN_DeInit(void)
Deinit the audio IN peripherals.
#define AUDIO_RESOLUTION_16B
static int32_t last_read_index
uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
#define PV_AUDIO_REC_AUDIO_FREQUENCY
static int32_t write_index
#define PV_AUDIO_REC_RECORD_BUFFER_SIZE
int32_t BSP_AUDIO_IN_RecordPDM(uint32_t Instance, uint8_t *pBuf, uint32_t NbrOfBytes)
Start audio recording.
const int16_t * pv_audio_rec_get_new_buffer(void)
uint16_t * record_pcm_buffer
void BSP_AUDIO_IN_HalfTransfer_CallBack(uint32_t Instance)
pv_status_t pv_audio_rec_start(void)
uint32_t record_buffer_size
#define PV_AUDIO_REC_CHANNEL_NUMBER
void pv_audio_rec_deinit(void)
#define AUDIO_IN_PCM_BUFFER_SIZE
void BSP_AUDIO_IN_TransferComplete_CallBack(uint32_t Instance)
static uint16_t record_pdm_buffer[AUDIO_IN_PDM_BUFFER_SIZE]
__STATIC_FORCEINLINE void SCB_InvalidateDCache_by_Addr(void *addr, int32_t dsize)
D-Cache Invalidate by address.
static int32_t read_index
static int32_t buffer_index
#define AUDIO_IN_DEVICE_DIGITAL_MIC
__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
Reverse byte order (16 bit)
pv_status_t pv_audio_rec_init(void)
This file contains the common defines and functions prototypes for the stm32h747i_discovery_audio....