.. _ezb_sound: 音效 ======================= 在本示例中,我们将使用 PiCrawler(更准确地说是 Robot HAT)提供的音效功能。 它由三部分组成,分别是 **Muisc** 、 **Sound** 、 **Text to Speech** 。 **Program** .. note:: * 你可以根据下图编写程序,详细操作请参考教程::ref:`ezblock:create_project_latest` 。 * 或者在 EzBlock Studio 的 **Examples** 页面找到同名示例代码,直接点击 **Run** 或 **Edit** 运行或修改。 .. image:: img/soundeff.png 切换到远程控制界面后,你将看到如下组件。 .. image:: img/soundeff_B.png 程序运行后,你可以通过按下不同按钮,让 PiCrawler 发出相应的声音。 **工作原理** 与背景音乐相关的功能如下: .. image:: img/sp210928_101816.png 与音效相关的功能如下: .. image:: img/sp210928_101727.png 与文本转语音(Text to Speech)相关的功能如下: .. image:: img/sp210928_101609.png