Skip to content

Speech to Text ​

Instance declaration ​

When you add a Speech to Text block to the workspace, the following instance declaration is automatically inserted into the Python code:

python
asr = ASR(0)
# When there are multiple instances
asr_1 = ASR(1)

Parameters ​

NameKindDescriptionRange / TypeDefault
indexDropdown optionInstance number (starting from 0)Integer 0 or greater0

Set the language ​

Sets the speech recognition language. It is set automatically even if you do not set it.

lang

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionRecognition language codeCodes for the 21 languages the program supports (e.g. 'ko-KR', 'en-US')-

Python ​

python
asr = ASR(0)

asr.lang('ko-KR')

Start / stop speech recognition ​

Starts or stops speech recognition.

listen

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionActionstart, stop-

Python ​

python
asr = ASR(0)

# unit = "start"
asr.start()
# unit = "stop"
asr.stop()

Speech recognition result ​

The speech recognition result

result

Parameters ​

(none)

Python ​

python
asr = ASR(0)

asr.result()

Speech recognition active state ​

Returns whether speech recognition is active as true (True) / false (False).

state

Parameters ​

(none)

Python ​

python
asr = ASR(0)

asr.is_active()