librespeaker
Public Member Functions | Static Public Member Functions | List of all members
respeaker::VepDoaKwsNode Class Referenceabstract

#include <vep_doa_kws_node.h>

Inheritance diagram for respeaker::VepDoaKwsNode:
respeaker::BaseNode respeaker::DirectionManagerNode respeaker::HotwordDetectionNode

Public Member Functions

virtual void SetTriggerPostConfirmThresholdTime (int ms)=0
 
virtual void SetAngleForMic0 (int angle)=0
 
virtual void SetDoAecWhenListen (bool do_aec_when_listen)=0
 
virtual void DisableAutoStateTransfer ()=0
 
virtual void SetAgcTargetLevelDbfs (int dbfs)=0
 
virtual bool OnStartThread ()=0
 
virtual std::string ProcessBlock (std::string block, bool &exit)=0
 
virtual bool OnJoinThread ()=0
 
virtual int GetDirection ()=0
 
virtual void SetDirection (int dir)=0
 
virtual int HotwordDetected ()=0
 
- Public Member Functions inherited from respeaker::BaseNode
BaseNodeGetId ()
 
void Uplink (BaseNode *uplink_node)
 
void RegisterDownlinkNode (BaseNode *downlink_node)
 
NodeParameterGetNodeOutputParameter ()
 
bool RecursivelyStartThread (ChainSharedData *shared_data)
 
bool RecursivelyJoinThread ()
 
virtual std::string FetchBlock (bool &exit)
 
virtual void StoreBlock (std::string block, bool &exit)
 
virtual void Pause ()
 
virtual void Resume ()
 
std::mutex * GetDownlinkDataQueueMutex (BaseNode *downlink_node_id=nullptr)
 
std::condition_variable * GetDownlinkDataQueueConditionVar (BaseNode *downlink_node_id=nullptr)
 
std::queue< std::string > & GetDownlinkDataQueue (BaseNode *downlink_node_id=nullptr)
 
int GetQueueDeepth ()
 
bool BindToCore (int core_index)
 
bool SetThreadPriority (int priority)
 

Static Public Member Functions

static VepDoaKwsNodeCreate (std::string snowboy_resource_path, std::string snowboy_model_path, std::string snowboy_sensitivity)
 
static VepDoaKwsNodeCreate (std::string snowboy_resource_path, std::string snowboy_model_path, std::string snowboy_sensitivity, int underclocking_count)
 
static VepDoaKwsNodeCreate (std::string snowboy_resource_path, std::string snowboy_model_path, std::string snowboy_sensitivity, int underclocking_count, bool enable_agc, bool output_interleaved=false)
 

Additional Inherited Members

- Protected Member Functions inherited from respeaker::BaseNode
void EnableQueueFlush (bool enable)
 
- Protected Attributes inherited from respeaker::BaseNode
BaseNode_uplink_node
 
std::list< BaseNode * > _list_downlink_nodes
 
NodeParameter _input_parameter
 
NodeParameter _output_parameter
 
ChainSharedData_chain_shared_data
 
bool _is_head
 
bool _is_tail
 
bool _is_interleaved_after_process
 
int _num_frames_for_store_block
 
int _channels_for_store_block
 
int16_t * _buffer_for_store_block
 
std::unique_ptr< int16_t *[]> _channels_ptr
 

Detailed Description

Please note that, this node can only uplink to VepAecBeamformingNode.

Member Function Documentation

◆ Create() [1/3]

static VepDoaKwsNode* respeaker::VepDoaKwsNode::Create ( std::string  snowboy_resource_path,
std::string  snowboy_model_path,
std::string  snowboy_sensitivity 
)
static
Parameters
snowboy_resource_path
snowboy_model_path
snowboy_sensitivity- [0.1, 0.9], but in string format.
Returns
VepDoaKwsNode*

◆ Create() [2/3]

static VepDoaKwsNode* respeaker::VepDoaKwsNode::Create ( std::string  snowboy_resource_path,
std::string  snowboy_model_path,
std::string  snowboy_sensitivity,
int  underclocking_count 
)
static
Parameters
underclocking_count- the count of input block this node will wait before processing and passing down.

◆ Create() [3/3]

static VepDoaKwsNode* respeaker::VepDoaKwsNode::Create ( std::string  snowboy_resource_path,
std::string  snowboy_model_path,
std::string  snowboy_sensitivity,
int  underclocking_count,
bool  enable_agc,
bool  output_interleaved = false 
)
static
Parameters
enable_agc- enable automatic gain control
output_interleaved- Set it true to output interleaved data, false to output deinterleaved data. At most time, we don't have to set it true in this node. Because the output data has only one channel(beam).
Returns
VepDoaKwsNode*

◆ DisableAutoStateTransfer()

virtual void respeaker::VepDoaKwsNode::DisableAutoStateTransfer ( )
pure virtual

◆ GetDirection()

virtual int respeaker::VepDoaKwsNode::GetDirection ( )
pure virtual

Subclass should implement this method.

Implements respeaker::DirectionManagerNode.

◆ HotwordDetected()

virtual int respeaker::VepDoaKwsNode::HotwordDetected ( )
pure virtual

Subclass should implement this method.

Implements respeaker::HotwordDetectionNode.

◆ OnJoinThread()

virtual bool respeaker::VepDoaKwsNode::OnJoinThread ( )
pure virtual

Do per node cleanup in this method.

Implements respeaker::BaseNode.

◆ OnStartThread()

virtual bool respeaker::VepDoaKwsNode::OnStartThread ( )
pure virtual

The derived node must configure the output parameter in this method

Implements respeaker::BaseNode.

◆ ProcessBlock()

virtual std::string respeaker::VepDoaKwsNode::ProcessBlock ( std::string  block,
bool &  exit 
)
pure virtual

Every node must implement this method.

Parameters
block[in]
exit[out] - The exit flag of the ChainSharedData is set, the thread should join now.
Returns
std::string

Implements respeaker::BaseNode.

◆ SetAgcTargetLevelDbfs()

virtual void respeaker::VepDoaKwsNode::SetAgcTargetLevelDbfs ( int  dbfs)
pure virtual
Parameters
dbfs- [0, 31], Sets the target peak |level| (or envelope) of the AGC in dBFs (decibels from digital full-scale). The convention is to use positive values. For instance, passing in a value of 3 corresponds to -3 dBFs, or a target level 3 dB below full-scale. The default is 3.

◆ SetAngleForMic0()

virtual void respeaker::VepDoaKwsNode::SetAngleForMic0 ( int  angle)
pure virtual

Set the angle for microphone 0, if it's not 0 for the board. For ReSpeaker v2, this should be 30.

Parameters
angle- degree

◆ SetDoAecWhenListen()

virtual void respeaker::VepDoaKwsNode::SetDoAecWhenListen ( bool  do_aec_when_listen)
pure virtual

Whether or not do AEC when the state machine is in LISTEN* state.

Parameters
do_aec_when_listen- The default is true.

◆ SetTriggerPostConfirmThresholdTime()

virtual void respeaker::VepDoaKwsNode::SetTriggerPostConfirmThresholdTime ( int  ms)
pure virtual

Time length over which we can confirm that trigger has been post for all beams, then we begin to scoring the triggerd beams, finally calculated the target beam

Parameters
ms- milliseconds

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