Developer World
Spresense Arduino Library v3.2.0-77d75a4
FrontEnd Class Reference

FrontEnd Class Definitions. More...

#include <FrontEnd.h>

Public Member Functions

err_t begin (void)
 Initialize the FrontEnd. More...
 
err_t begin (AudioAttentionCb attcb)
 Initialize the FrontEnd. More...
 
err_t end (void)
 Finalize the FrontEnd. More...
 
err_t activate (void)
 Activate the FrontEnd. More...
 
err_t activate (MicFrontendCallback fedcb)
 Activate the FrontEnd. More...
 
err_t activate (MicFrontendCallback fedcb, bool is_digital)
 
err_t init (uint8_t channel_number, uint8_t bit_length, uint32_t samples_per_frame, uint8_t data_path, AsDataDest dest)
 Initialize the FrontEnd. More...
 
err_t start (void)
 Start FrontEnd. More...
 
err_t stop (void)
 Stop Recording. More...
 
err_t initpreproc (AsInitPreProcParam *param)
 Send init command to pre-process DSP. More...
 
err_t setpreproc (AsSetPreProcParam *param)
 Send init command to pre-process DSP. More...
 
err_t setMicGain (int16_t mic_gain)
 Set Mic gain. More...
 
err_t setCapturingClkMode (uint8_t clk_mode)
 Set capturing clock mode. More...
 
err_t deactivate (void)
 Deactivate the FrontEnd. More...
 

Static Public Member Functions

static FrontEndgetInstance ()
 Get instance of FrontEnd for singleton.
 

Detailed Description

FrontEnd Class Definitions.

Member Function Documentation

◆ begin() [1/2]

err_t FrontEnd::begin ( void  )

Initialize the FrontEnd.

This function is called only once when using the FrontEnd. In this function, creat objects for audio data capturing and filtering.

◆ begin() [2/2]

err_t FrontEnd::begin ( AudioAttentionCb  attcb)

Initialize the FrontEnd.

This function can set callback funtion which receive attention notify.

◆ end()

err_t FrontEnd::end ( void  )

Finalize the FrontEnd.

This function is called only once when finish the MediaRecorder.

◆ activate() [1/2]

err_t FrontEnd::activate ( void  )

Activate the FrontEnd.

This function activates frontend system and audio HW. You can specify pre-process type.

◆ activate() [2/2]

err_t FrontEnd::activate ( MicFrontendCallback  fedcb)

Activate the FrontEnd.

This function activates frontend system and audio HW. You can specify preproces type. If you activate FrontEnd by this API, The result of all APIs will be returnd by callback function which is specified by this function. (It means that the return of API is not completion of internal process)

◆ init()

err_t FrontEnd::init ( uint8_t  channel_number,
uint8_t  bit_length,
uint32_t  samples_per_frame,
uint8_t  data_path,
AsDataDest  dest 
)

Initialize the FrontEnd.

This is full version on initialize API. In this API, you can should set all of initialize parameters. Before you start FrontEnd, you must initialize by this API.

Parameters
channel_numberSet chennel number. AS_CHANNEL_MONO or AS_CHANNEL_STEREO, 2CH, 4CH, 8CH
bit_lengthSet bit length. AS_BITLENGTH_16 or AS_BITLENGTH_24
samples_per_frameNumber of Samples per one frame
data_pathSet capture data path. AsDataPathCallback or AsDataPathMessage
destDestination of outgoing data from FrontEnd

◆ start()

err_t FrontEnd::start ( void  )

Start FrontEnd.

This function starts FrontEnd. Once you call this function, the FrontEnc will be in active state and start capturing data. Captured data will be pre-processed and deliveryed to data destination which is set by init() API. This will continue until you call "stop API".

◆ stop()

err_t FrontEnd::stop ( void  )

Stop Recording.

This function stops FrontEnd. You can call this API when FrontEnd is activate.

◆ initpreproc()

err_t FrontEnd::initpreproc ( AsInitPreProcParam *  param)

Send init command to pre-process DSP.

This function sends Init command to pre-process DSP.

Parameters
paramInit command packet parameter for pre-process DSP

◆ setpreproc()

err_t FrontEnd::setpreproc ( AsSetPreProcParam *  param)

Send init command to pre-process DSP.

This function sends Set command to pre-process DSP.

Parameters
paramSet command packet parameter for pre-process DSP

◆ setMicGain()

err_t FrontEnd::setMicGain ( int16_t  mic_gain)

Set Mic gain.

The gain set when microphone is used can be specified by the "mic_gain" argument. You can set every 0.5 dB between 0 dB and 21 dB. In this parameter, a value from 0 to 210 is set for every 5.

Parameters
mic_gainInput gain : value range Analog Mic 0:0dB, 5:+0.5dB, ... , 210:+21.0dB (Max is 21dB.) Digital Mic -7850:-78.50dB, ... , -5:-0.05dB, 0:0dB (Max is 0dB.) set #AS_MICGAIN_HOLD is keep setting.

◆ setCapturingClkMode()

err_t FrontEnd::setCapturingClkMode ( uint8_t  clk_mode)

Set capturing clock mode.

This API set internal audio capture clock mode to Normal(48kHz) or HiReso(192kHz). Default on boot is Normal, if you set HiReso, call this API with HiReso set.

Parameters
clk_modeSet clock mode. FRONTEND_CAPCLK_NORMAL, FRONTEND_CAPCLK_HIRESO

◆ deactivate()

err_t FrontEnd::deactivate ( void  )

Deactivate the FrontEnd.

This function deactivates FrontEnd system, and audio HW.


The documentation for this class was generated from the following file: