# 未來板KOI編程教學8：語音相關

KOI可以做到語音分類的功能。

### 語音相關積木塊

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

### 範例程式1：錄製音頻(需要SD卡)

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

{% file src="<https://879637118-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6uJvpXC43onNIIwhMlWo%2Fuploads%2FrrhYvQBL97Fezv7dLliz%2Frecandplay.sb3?alt=media&token=e20f198e-12a0-42f6-b317-c09c900c0077>" %}

### 範例程式2：語音模型訓練(需要SD卡)

```
語音辨識前必須要運行環境噪音校正。
錄入成功會顯示綠色，錄入不成功會顯示紅色。
最多可以儲存10條語音指令。
```

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

{% file src="<https://879637118-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6uJvpXC43onNIIwhMlWo%2Fuploads%2FOYYii2PtFmg0ryec3YrJ%2Fvoicetrain.sb3?alt=media&token=7c68d799-add1-4cc3-ba3a-da92f5135992>" %}

### 範例程式3：語音辨識(需要SD卡)

```
語音辨識前必須要運行環境噪音校正。
錄入成功會顯示綠色，錄入不成功會顯示紅色。
```

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

{% file src="<https://879637118-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6uJvpXC43onNIIwhMlWo%2Fuploads%2FbgD01RwL0aHhRW1UZrNL%2Fvoiceload.sb3?alt=media&token=d272d3e9-7901-427b-b2e1-7b6ab3ecdd46>" %}
