pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

Atomic Base

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.

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