pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Echo STT

Function Description
Atom Echo will upload the text information to the server after burning the STT firmware, in addition to printing out the text information on the serial port when converting the text to voice. Other devices can use Echo STT Block in UIFlow to get the corresponding STT text by configuring the same token as the device.

Get Toekn

Before using the function, you need to use M5Burner to flash the STT firmware onto the Atom Echo and obtain the Token (this field is required to initialize the Echo STT remote feature in UIFlow).

Example

from m5stack import *
from m5ui import *
from uiflow import *
from echo import Echo
import wifiCfg

setScreenColor(0x222222)
stt_data = None

wifiCfg.autoConnect(lcdShow=False)

def echo_callback(*args):
  global stt_data
  stt_data = args[0]
  print(stt_data)
  pass


echo = Echo(str('500291857fbc58d4336dbe4e30d49797'))
echo.set_callback(echo_callback)

API

from echo import Echo
echo = Echo(str('500291857fbc58d4336dbe4e30d49797'))
echo.set_callback(echo_callback)
  • Initialize the Echo STT data fetch function and configure the matching device token.
echo.recv_text
  • Get the returned STT text

def echo_callback(*args):
  global stt_data
  stt_data = args[0]
  print(stt_data)
  pass
  • New STT text message callback function
On This Page