smartmic 2.0.0.0
Main Page

Smart Mic click

‍Smart Mic Click is a compact add-on board that provides wake-on-voice capabilities with secured privacy without compromising performance. This board features the IA611, an “Always-On” voice-wake acoustic processor from Knowles Electronics. The IA611 offers flexibility by supporting the most relevant audio and data interfaces and enables ultra-low-power voice and event detection, including voice UI supporting keywords, voice commands, and acoustic event detection. Its integrated programmable DSP is made available to 3rd party algorithms with 168kB of RAM, enabling unlimited creativity.

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Mar 2022.
  • Type : I2C/SPI type

Software Support

We provide a library for the Smart Mic Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

‍This library contains API for Smart Mic Click driver.

Standard key functions :

Example key functions :

  • smartmic_wait_keyword This function waits for a keyword event and then reads it and returns the keyword ID number.
    err_t smartmic_wait_keyword(smartmic_t *ctx)
    Smart Mic wait keyword function.
  • smartmic_download_keyword This function downloads keyword models to the module.
    err_t smartmic_download_keyword ( smartmic_t *ctx, uint16_t *data_in, uint16_t len );
    err_t smartmic_download_keyword(smartmic_t *ctx, uint16_t *data_in, uint16_t len)
    Smart Mic download keyword function.
  • smartmic_voice_make This function performs voice make feature. It stops the route, then sets digital gain to 20db, sample rate to 16K, frame size to 16 ms, and finally it selects route 6 and configures algorithm parameters.
    err_t smartmic_voice_make(smartmic_t *ctx)
    Smart Mic voice make function.

Example Description

‍This example demonstrates the use of Smart Mic click board by programming it with 4 different keywords, and then waiting for a keyword event,

parsing it and displaying on the USB UART.

The demo application is composed of two sections :

Application Init

‍Initializes the driver and performs the click default configuration which programs the device with system config, firmware, and 4 keywords

("Hello VoiceQ","Switch The Light","Next Song","Baidu Yixia") binaries.

void application_init ( void )
{
log_cfg_t log_cfg;
smartmic_cfg_t smartmic_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
smartmic_cfg_setup( &smartmic_cfg );
SMARTMIC_MAP_MIKROBUS( smartmic_cfg, MIKROBUS_1 );
if ( SMARTMIC_OK != smartmic_init( &smartmic, &smartmic_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_printf( &logger, " Configuring device... \r\n" );
if ( SMARTMIC_OK != smartmic_default_cfg ( &smartmic ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define SMARTMIC_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition smartmic.h:240
void application_init(void)
Definition main.c:32
@ SMARTMIC_OK
Definition smartmic.h:319

Application Task

‍Waits for a keyword event, parses it and displays on the USB UART an appropriate message for the detected keyword.

void application_task ( void )
{
switch ( smartmic_wait_keyword ( &smartmic ) )
{
{
log_printf ( &logger, " Hello VoiceQ keyword detected!\r\n" );
break;
}
{
log_printf ( &logger, " Switch The Light keyword detected!\r\n" );
break;
}
{
log_printf ( &logger, " Next Song keyword detected!\r\n" );
break;
}
{
log_printf ( &logger, " Baidu YiXia keyword detected!\r\n" );
break;
}
}
}
#define SMARTMIC_OEM3_KWD_DETECTED
Definition smartmic.h:175
#define SMARTMIC_OEM1_KWD_DETECTED
Definition smartmic.h:173
#define SMARTMIC_OEM4_KWD_DETECTED
Definition smartmic.h:176
#define SMARTMIC_OEM2_KWD_DETECTED
Definition smartmic.h:174
void application_task(void)
Definition main.c:70

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.SmartMic

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.