Legacy page
This page describes legacy neuralSPOT. For current tools and documentation, see neuralSPOT-X reference, neuralSPOT-X module catalog.
File ns_audio_tests.c
FileList > neuralspot > neuralspot > ns-audio > tests > ns_audio_tests.c
Go to the source code of this file
#include "unity/unity.h"#include "ns_audio.h"#include <stdint.h>
Public Attributes
| Type | Name |
|---|---|
| ns_audio_config_t | audioConfig |
| am_hal_offset_cal_coeffs_array_t | sOffsetCalib |
Public Static Attributes
| Type | Name |
|---|---|
| int16_t | audioDataBuffer |
| uint32_t | dmaBuffer |
| volatile static bool | g_audioReady = false |
| volatile static bool | g_audioRecording = false |
| am_hal_audadc_sample_t | sLGSampleBuffer |
Public Functions
| Type | Name |
|---|---|
| void | ns_audio_api_test () |
| void | ns_audio_audioSource_test () |
| void | ns_audio_init_test () |
| void | ns_audio_negative_sample_rate_test () |
| void | ns_audio_null_config_test () |
| void | ns_audio_null_handle_test () |
| void | ns_audio_num_channels_greater_than_2_test () |
| void | ns_audio_num_samples_test () |
| void | ns_audio_pdm_config_test () |
| void | ns_audio_tests_post_test_hook () |
| void | ns_audio_tests_pre_test_hook () |
| void | ns_switch_audio_test () |
Public Static Functions
| Type | Name |
|---|---|
| void | audio_frame_callback (ns_audio_config_t * config, uint16_t bytesCollected) |
| void | initialize_audio_config () |
Macros
| Type | Name |
|---|---|
| define | NUM_CHANNELS 1 |
| define | NUM_FRAMES 100 |
| define | SAMPLES_IN_FRAME 480 |
| define | SAMPLE_RATE 16000 |
Public Attributes Documentation
variable audioConfig
ns_audio_config_t audioConfig;
variable sOffsetCalib
am_hal_offset_cal_coeffs_array_t sOffsetCalib;
Public Static Attributes Documentation
variable audioDataBuffer
int16_t audioDataBuffer[SAMPLES_IN_FRAME];
variable dmaBuffer
uint32_t dmaBuffer[SAMPLES_IN_FRAME *NUM_CHANNELS *2];
variable g_audioReady
volatile static bool g_audioReady;
variable g_audioRecording
volatile static bool g_audioRecording;
variable sLGSampleBuffer
am_hal_audadc_sample_t sLGSampleBuffer[SAMPLES_IN_FRAME *NUM_CHANNELS];
Public Functions Documentation
function ns_audio_api_test
void ns_audio_api_test ()
function ns_audio_audioSource_test
void ns_audio_audioSource_test ()
function ns_audio_init_test
void ns_audio_init_test ()
function ns_audio_negative_sample_rate_test
void ns_audio_negative_sample_rate_test ()
function ns_audio_null_config_test
void ns_audio_null_config_test ()
function ns_audio_null_handle_test
void ns_audio_null_handle_test ()
function ns_audio_num_channels_greater_than_2_test
void ns_audio_num_channels_greater_than_2_test ()
function ns_audio_num_samples_test
void ns_audio_num_samples_test ()
function ns_audio_pdm_config_test
void ns_audio_pdm_config_test ()
function ns_audio_tests_post_test_hook
void ns_audio_tests_post_test_hook ()
function ns_audio_tests_pre_test_hook
void ns_audio_tests_pre_test_hook ()
function ns_switch_audio_test
void ns_switch_audio_test ()
Public Static Functions Documentation
function audio_frame_callback
static void audio_frame_callback (
ns_audio_config_t * config,
uint16_t bytesCollected
)
function initialize_audio_config
static void initialize_audio_config ()
Macro Definition Documentation
define NUM_CHANNELS
#define NUM_CHANNELS `1`
define NUM_FRAMES
#define NUM_FRAMES `100`
define SAMPLES_IN_FRAME
#define SAMPLES_IN_FRAME `480`
define SAMPLE_RATE
#define SAMPLE_RATE `16000`
The documentation for this class was generated from the following file neuralspot/neuralspot/ns-audio/tests/ns_audio_tests.c