# 語音模組 編程教學

ASR語音模組可以配合MakeCode或KittenBlock編程使用。

### 接線教學

### Robotbit EDU

![](https://879637118-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6uJvpXC43onNIIwhMlWo%2Fuploads%2FDbrwuYEGDgI14oPqEeJI%2Fasr_edu_wiring.png?alt=media\&token=cf92a203-9418-4028-b8b7-02c234c9509a)

### Robotbit 2.2

<figure><img src="https://879637118-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6uJvpXC43onNIIwhMlWo%2Fuploads%2Fqd66vfAq1vpWNjUqKbhb%2Fasr_2.2_wiring.png?alt=media&#x26;token=6edbb2c1-3712-4368-b143-a8f5af2a620d" alt=""><figcaption></figcaption></figure>

### Armourbit

{% hint style="info" %}
編程時請注意要選擇正確引腳。
{% endhint %}

<figure><img src="https://879637118-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6uJvpXC43onNIIwhMlWo%2Fuploads%2FDZUUtzuLXBGfcN0ho6rR%2Farmourbit_asr_wiring.png?alt=media&#x26;token=166c5094-d368-43c5-a65a-db041bcb5817" alt=""><figcaption></figcaption></figure>

### 編程教學

### Microbit MakeCode編程教學

![](https://kittenbothk.readthedocs.io/en/latest/_images/mcbanner15.png)

#### 加載Sugar插件：

#### 在擴展頁直接搜尋sugar (sugar已經過微軟認證，可以直接搜尋)

![](https://kittenbothk.readthedocs.io/en/latest/_images/sugar_search.gif)

#### 你亦可以用插件地址搜尋

Sugar插件：<https://github.com/KittenBot/pxt-sugar>

#### [詳細方法](https://sharinghub.kittenbot.hk/programmingplatforms/makecode/kittenbotandmakecode)

#### Sugar語音模組積木

![](https://kittenbothk.readthedocs.io/en/latest/_images/asr_sugar_1.png)

#### 語音辨識參考程式

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

[參考程式下載](https://makecode.microbit.org/_RCWckUH0bcXe)

```
  注意：2個語音播報指令之間需要加等待，等待上一個語音播報完成，否則語音播報會重疊。
```

參考程式用法：

#### 操作教學

#### 1. 開電後模組會讀出固件版本，完成之後就可以開始使用。

#### 2. 使用時需要先使用喚醒指令喚醒語音模組。模組喚醒會回答Uh Huh。

喚醒指令有3種：

1. Hey Sugar
2. Hello KittenBot
3. Hello Kitty

#### 3. 對語音模組說出Lamp On或Lamp Off，辨識命令詞後語音模組會回答OK，Micro:bit上的LED就會亮起相應的燈。

#### 4. 模組閒置10秒之後會進入睡眠模式，進入睡眠模式之後需要再次喚醒才可使用。

#### 5. 按下A鍵或B鍵，語音模組就會說出相應指令。

#### 示範短片

{% embed url="<https://www.youtube.com/watch?v=nvV9uM8g3gs>" %}

### 未來板KittenBlock編程教學

![](https://kittenbothk.readthedocs.io/en/latest/_images/kbbanner9.png)

#### 語音辨識參考程式

![](https://kittenbothk.readthedocs.io/en/latest/_images/asr_code2.png)

參考程式用法：

#### 1. 開電後模組會讀出固件版本，完成之後就可以開始使用。

#### 2. 使用時需要先使用喚醒指令喚醒語音模組。模組喚醒會回答Uh Huh。

喚醒指令有3種：

1. Hey Sugar
2. Hello KittenBot
3. Hello Kitty

#### 3. 對語音模組說出Lamp On或Lamp Off，辨識命令詞後語音模組會回答OK，Micro:bit上的LED就會亮起相應的燈。

#### 4. 模組閒置10秒之後會進入睡眠模式，進入睡眠模式之後需要再次喚醒才可使用。

#### 語音播報參考程式

![](https://kittenbothk.readthedocs.io/en/latest/_images/asr_code4.png)

參考程式用法:

#### 1. 按下A鍵或B鍵，語音模組就會說出相應指令。
