# 語音模組自定義命令詞教學

國語版的語音模組支援自定義的喚醒詞和命令詞，詳情請瀏覽以下篇章。

### 自定義命令詞功能介紹

* 1條自定義喚醒詞
* 10條自定義命令詞
* 支援國語+粵語
* 毋須編程就可進行訓練
* 訓練結果自動儲存，不需每次開機都重新訓練

### 自定義命令詞功能示範

{% embed url="<https://youtu.be/mP98QdHNG-o>" %}

### 自定義喚醒詞教學

除了預載的喚醒詞之外，用戶可以自行加入自定義的喚醒詞。

1. 首先喚醒語音模組
2. 對語音模組說:『開始學習喚醒詞』
3. 語音模組會發出提示:『開始學習喚醒詞，請在安靜環境下說話』
4. 說出新的喚醒詞，成功學習的話語音模組會發出提示: 『學習成功，請再說一次』
5. 再說一次喚醒詞，完成訓練的話語音模組發出提示: 『學習完成』
6. 假如想清除自定義喚醒詞，請說: 『清除學習喚醒詞』

{% hint style="info" %}
學習新喚醒詞後，預載的喚醒詞仍然能夠使用。
{% endhint %}

### 自定義命令詞教學

1. 先喚醒語音模組
2. 對語音模組說:『學習第X條命令詞』
   1. X代表序號，1\~10，語音模組最多支援10條自定義命令
3. 語音模組會發出提示: 『開始學習第X條命令詞，請說』
4. 說出新的命令詞，成功學習的話語音模組會發出提示: 『學習成功，請再說一次』
5. 再說一次命令詞，完成訓練的話語音模組發出提示: 『學習完成』
6. 假如想清除自定義命令詞，請說: 『清除學習命令詞』

### 重置所有學習數據

1. 對語音模組說出: 『重置學習』，語音模組就會提示學習數據已重置

{% hint style="info" %}
注意：重置學習數據後，所有自定義喚醒詞和命令詞的學習數據都會被清空
{% endhint %}

### 自定義命令詞MakeCode編程教學

{% embed url="<https://makecode.microbit.org/_Hh66h9XuH5DX>" %}

[參考程式](https://makecode.microbit.org/_Hh66h9XuH5DX)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sharinghub.kittenbot.hk/airelated/asr/custom.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
