#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include "stm32h747i_discovery_audio.h"
#include "picovoice.h"
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 |
#define AUDIO_IN_PCM_BUFFER_SIZE ((uint32_t)(PV_AUDIO_REC_AUDIO_FREQUENCY / 1000 * PV_AUDIO_REC_CHANNEL_NUMBER)) |
Definition at line 25 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
#define AUDIO_IN_PDM_BUFFER_SIZE ((uint32_t)(128 * PV_AUDIO_REC_AUDIO_FREQUENCY / 16000 * PV_AUDIO_REC_CHANNEL_NUMBER)) |
Definition at line 26 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
#define PV_AUDIO_REC_AUDIO_FREQUENCY (16000U) |
Definition at line 20 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
#define PV_AUDIO_REC_CHANNEL_NUMBER (2) |
Definition at line 21 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
#define PV_AUDIO_REC_RECORD_BUFFER_SIZE (512) |
Definition at line 22 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
#define PV_AUDIO_REC_VOLUME_LEVEL (10) |
Definition at line 23 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
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] | ) |
void BSP_AUDIO_IN_HalfTransfer_CallBack | ( | uint32_t | Instance | ) |
Definition at line 108 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
void BSP_AUDIO_IN_TransferComplete_CallBack | ( | uint32_t | Instance | ) |
Definition at line 86 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
void pv_audio_rec_deinit | ( | void | ) |
Definition at line 128 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
const int16_t* pv_audio_rec_get_new_buffer | ( | void | ) |
Definition at line 72 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
pv_status_t pv_audio_rec_init | ( | void | ) |
Definition at line 45 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
pv_status_t pv_audio_rec_start | ( | void | ) |
Definition at line 64 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
uint32_t audio_frequency |
Definition at line 39 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
|
static |
Definition at line 35 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
uint32_t channel_number |
Definition at line 38 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
bool is_recording |
Definition at line 42 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
|
static |
Definition at line 32 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
struct { ... } pv_audio_rec |
|
static |
Definition at line 33 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
uint32_t record_buffer_size |
Definition at line 40 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
uint16_t* record_pcm_buffer |
Definition at line 41 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.
|
static |
Definition at line 34 of file stm32h747/stm32h747i-disco/CM7/Src/pv_audio_rec.c.