28#ifndef MediaRecorder_h
29#define MediaRecorder_h
32#error "Audio library is NOT supported by SubCore."
36#include <audio/audio_high_level_api.h>
37#include <audio/audio_message_types.h>
38#include <audio/utilities/frame_samples.h>
39#include <audio/utilities/wav_containerformat.h>
40#include <memutils/simple_fifo/CMN_SimpleFifo.h>
50#define MEDIARECORDER_LOG_DEBUG
52#define print_err printf
54#ifdef MEDIARECORDER_LOG_DEBUG
55#define print_dbg(...) printf(__VA_ARGS__)
57#define print_dbg(x...)
64#define MEDIARECORDER_ECODE_OK 0
65#define MEDIARECORDER_ECODE_COMMAND_ERROR 1
66#define MEDIARECORDER_ECODE_BUFFER_INIT_ERROR 2
67#define MEDIARECORDER_ECODE_BUFFER_POLL_ERROR 3
68#define MEDIARECORDER_ECODE_DSP_ACCESS_ERROR 4
69#define MEDIARECORDER_ECODE_FILEACCESS_ERROR 5
70#define MEDIARECORDER_ECODE_BUFFER_SIZE_ERROR 6
71#define MEDIARECORDER_ECODE_BUFFER_AREA_ERROR 7
72#define MEDIARECORDER_ECODE_INSUFFICIENT_BUFFER_AREA 8
73#define MEDIARECORDER_ECODE_BASEBAND_ERROR 9
74#define MEDIARECORDER_ECODE_BUFFER_ALLOC_ERROR 10
80#define MEDIARECORDER_BUF_FRAME_NUM 10
81#define MEDIARECORDER_BUF_FRAME_SIZE (768 * 2 * 8)
82#define MEDIARECORDER_BUF_SIZE (MEDIARECORDER_BUF_FRAME_NUM * MEDIARECORDER_BUF_FRAME_SIZE)
88#define MEDIARECORDER_CAPCLK_NORMAL (0)
89#define MEDIARECORDER_CAPCLK_HIRESO (1)
131 err_t begin(AudioAttentionCb attcb,
bool use_frontend);
154 AsSetRecorderStsInputDevice input_device,
155 MediaRecorderCallback mrcb
167 AsSetRecorderStsInputDevice input_device,
168 MediaRecorderCallback mrcb,
169 uint32_t recorder_bufsize
182 AsSetRecorderStsInputDevice input_device,
183 MediaRecorderCallback mrcb,
184 uint32_t recorder_bufsize,
185 AsMicFrontendPreProcType proc_type,
186 bool is_digital =
false
205 uint8_t channel_number
222 uint8_t channel_number,
223 uint32_t sampling_rate,
240 uint8_t channel_number,
241 uint32_t sampling_rate,
244 const char *codec_path
308 uint32_t buffer_size,
341 : m_recorder_simple_fifo_buf(NULL)
342 , m_mr_callback(NULL)
353 CMN_SimpleFifoHandle m_recorder_simple_fifo_handle;
354 uint32_t *m_recorder_simple_fifo_buf;
355 char m_es_recorder_buf[MEDIARECORDER_BUF_FRAME_SIZE];
357 AsRecorderOutputDeviceHdlr m_output_device_handler;
359 WAVHEADER m_wav_format;
360 MediaRecorderCallback m_mr_callback;
364 bool check_encode_dsp(uint8_t codec_type,
const char *path, uint32_t sampling_rate);
370 void init_wav(AsInitRecorderParam *param);
371 void init_mp3(AsInitRecorderParam *param);
372 void init_opus(AsInitRecorderParam *param);
373 void init_pcm(AsInitRecorderParam *param);
Mic Frontend Class for Arduino on Spresense.
The File class allows for reading from and writing to individual files on the File System.
Definition: File.h:55
FrontEnd Class Definitions.
Definition: FrontEnd.h:82
unsigned int err_t
Definition: Audio.h:108