Macros | Functions | Variables
stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include "stm32h747i_discovery_audio.h"
#include "picovoice.h"
Include dependency graph for stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c:

Go to the source code of this file.

Macros

#define AUDIO_IN_PCM_BUFFER_SIZE   ((uint32_t)(PV_AUDIO_REC_AUDIO_FREQUENCY / 1000 * PV_AUDIO_REC_CHANNEL_NUMBER))
 
#define AUDIO_IN_PDM_BUFFER_SIZE   ((uint32_t)(128 * PV_AUDIO_REC_AUDIO_FREQUENCY / 16000 * PV_AUDIO_REC_CHANNEL_NUMBER))
 
#define PV_AUDIO_REC_AUDIO_FREQUENCY   (16000U)
 
#define PV_AUDIO_REC_CHANNEL_NUMBER   (2)
 
#define PV_AUDIO_REC_RECORD_BUFFER_SIZE   (512)
 
#define PV_AUDIO_REC_VOLUME_LEVEL   (10)
 

Functions

 ALIGN_32BYTES (static int16_t ping_pong_buffer[2][PV_AUDIO_REC_RECORD_BUFFER_SIZE])
 
 ALIGN_32BYTES (static uint16_t record_pcm_buffer[AUDIO_IN_PCM_BUFFER_SIZE])
 
 ALIGN_32BYTES (static uint16_t record_pdm_buffer[AUDIO_IN_PDM_BUFFER_SIZE]) __attribute__((section(".RAM_D3")))
 
void BSP_AUDIO_IN_HalfTransfer_CallBack (uint32_t Instance)
 
void BSP_AUDIO_IN_TransferComplete_CallBack (uint32_t Instance)
 
void pv_audio_rec_deinit (void)
 
const int16_t * pv_audio_rec_get_new_buffer (void)
 
pv_status_t pv_audio_rec_init (void)
 
pv_status_t pv_audio_rec_start (void)
 

Variables

static int32_t buffer_index = 0
 
static int32_t last_read_index = -1
 
struct {
   uint32_t   audio_frequency
 
   uint32_t   channel_number
 
   bool   is_recording
 
   uint32_t   record_buffer_size
 
   uint16_t *   record_pcm_buffer
 
pv_audio_rec
 
static int32_t read_index = 1
 
static int32_t write_index = 0
 

Macro Definition Documentation

◆ AUDIO_IN_PCM_BUFFER_SIZE

#define AUDIO_IN_PCM_BUFFER_SIZE   ((uint32_t)(PV_AUDIO_REC_AUDIO_FREQUENCY / 1000 * PV_AUDIO_REC_CHANNEL_NUMBER))

◆ AUDIO_IN_PDM_BUFFER_SIZE

#define AUDIO_IN_PDM_BUFFER_SIZE   ((uint32_t)(128 * PV_AUDIO_REC_AUDIO_FREQUENCY / 16000 * PV_AUDIO_REC_CHANNEL_NUMBER))

◆ PV_AUDIO_REC_AUDIO_FREQUENCY

#define PV_AUDIO_REC_AUDIO_FREQUENCY   (16000U)

◆ PV_AUDIO_REC_CHANNEL_NUMBER

#define PV_AUDIO_REC_CHANNEL_NUMBER   (2)

◆ PV_AUDIO_REC_RECORD_BUFFER_SIZE

#define PV_AUDIO_REC_RECORD_BUFFER_SIZE   (512)

◆ PV_AUDIO_REC_VOLUME_LEVEL

#define PV_AUDIO_REC_VOLUME_LEVEL   (10)

Function Documentation

◆ ALIGN_32BYTES() [1/3]

ALIGN_32BYTES ( static int16_t  ping_pong_buffer[2][PV_AUDIO_REC_RECORD_BUFFER_SIZE])

◆ ALIGN_32BYTES() [2/3]

ALIGN_32BYTES ( static uint16_t  record_pcm_buffer[AUDIO_IN_PCM_BUFFER_SIZE])

◆ ALIGN_32BYTES() [3/3]

ALIGN_32BYTES ( static uint16_t  record_pdm_buffer[AUDIO_IN_PDM_BUFFER_SIZE])

◆ BSP_AUDIO_IN_HalfTransfer_CallBack()

void BSP_AUDIO_IN_HalfTransfer_CallBack ( uint32_t  Instance)

◆ BSP_AUDIO_IN_TransferComplete_CallBack()

void BSP_AUDIO_IN_TransferComplete_CallBack ( uint32_t  Instance)

◆ pv_audio_rec_deinit()

void pv_audio_rec_deinit ( void  )

◆ pv_audio_rec_get_new_buffer()

const int16_t* pv_audio_rec_get_new_buffer ( void  )

◆ pv_audio_rec_init()

pv_status_t pv_audio_rec_init ( void  )

◆ pv_audio_rec_start()

pv_status_t pv_audio_rec_start ( void  )

Variable Documentation

◆ audio_frequency

uint32_t audio_frequency

◆ buffer_index

int32_t buffer_index = 0
static

◆ channel_number

uint32_t channel_number

◆ is_recording

bool is_recording

◆ last_read_index

int32_t last_read_index = -1
static

◆ pv_audio_rec

struct { ... } pv_audio_rec

◆ read_index

int32_t read_index = 1
static

◆ record_buffer_size

uint32_t record_buffer_size

◆ record_pcm_buffer

uint16_t* record_pcm_buffer

◆ write_index

int32_t write_index = 0
static


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:00