DY-SV17F 语音模块

大家好。我叫小哈,程序员。

[En]

Hello, everyone. I’m Xiao Ha, a programmer.

几天前,一名球员在使用语音模块时遇到了一些困难。为了方便调试,哈小哥还买了两个一起玩。

[En]

A few days ago, a ball player was using a voice module and encountered some difficulties. In order to facilitate debugging, little brother Ha also bought two to play together.

DY-SV17F 语音模块
今天,哈哥将简要分享这一模块。
[En]

Today, Brother Ha will briefly share this module.

; 模块概述

  • DY-SV17F 语音模块,包括IO 分段触发,UART 串口控制, ONE_line 单总线控制,标准 MP3 等 7 种工作模式;
  • 板载 5W D 类功放,可直接驱动 4Ω, 3~5W 喇叭;
  • 支持 MP3,WAV 解码格式;
  • 板载4MByte flash 存储,可通过 USB 数据线连接模块上的MicroUSB接口,电脑可以将模块识别为一个U盘,打开此存储更新音频文件即可。

硬件连接

DY-SV17F 语音模块

; 原理图

为了测试方便,各位也可以画一个PCB板,这样就可以避免使用一堆杜邦线进行连接,也可以避免调试过程中遇到一些不必要的问题,底板的原理图可以参考下图所示。

DY-SV17F 语音模块
因为我们要选择串口模式,所以实际使用过程中,CON1、CON2接地,CON3接高电平。
DY-SV17F 语音模块

CON3/BUSY 引脚,上电 30mS 内作为模式配置引脚 3,30mS 后作为 BUSY 信号输出,播放曲目时,CON3输出高电平(3.3V),播放结束输出低电平(0V)。

注意:上述CON3引脚状态,我实际测试结果与手册中描述相反,此处自己使用时进行一下确认。

工作模式配置

DY-SV17F 语音模块

; 资源文件

要实现当前时间的语音播放,首先需要找到或制作一些基本的音频文件。如果您想制作音频文件素材,可以使用以下URL:

[En]

To achieve the current time of voice playback, we first need to find or make some basic audio files. If you want to make audio file material, you can use the following URL:

https://www.coder.work/text2audio

准备好组合播放的音频素材文件,将其放置在 ZH 文件夹下,曲目名要求固定两个字符,为了控制方便,我们选择以两位数字的形式命名文件名,本次实例的音频文件素材如下:

DY-SV17F 语音模块

素材的音频内容如下:

[En]

The audio content of the material is as follows:

文件名 语音

00.mp3零01.mp3一02.mp3二03.mp3三04.mp3四05.mp3五06.mp3六07.mp3七08.mp3八09.mp3九10.mp3十11.mp3现在时间是12.mp3点13.mp3分14.mp3秒

; 协议

串口通信,波特率为9600,数据位:8,停止位1位,校验位N。
示例 含义 备注

AA 01 00 AB查询播放状态AA 01 01 播放状态 校验比如:AA 01 01 00 ACAA 02 00 AC从头开始播放当前曲目AA 03 00 AD暂停无返回AA 04 00 AE停止无返回AA 05 00 AF上一曲无返回AA 06 00 B0下一曲无返回AA 07 02 曲目高 曲目低 SM指定曲目无返回,曲目序号由存储顺序决定。AA 0C 00 B6查询总曲目返回:AA 0C 02 总曲目高 总曲目低 校验AA 0D 00 B7查询当前曲目AA 0D 02 00 08 C1AA 10 00 BA结束播放AA 13 01 VOL SM音量设置无返回,例如: AA 13 01 14 D2 设置音量为 20 级AA 14 00 BE音量加无返回AA 15 00 BF音量减无返回AA 1B 长度 曲目 1 名称高字节,曲目名称 1 低字节… 曲目 n 名称高字节, 曲目 n 名称低字节 SM组合播放
无返回

,例如: AA 1B 04 30 31 30 32 8C,文件名为”01″、”02″歌曲组合播放。 文件名播放方式,不受拷贝顺序限制。AA 1C 00 C6结束组合播报无返回AA 25 00 CF开启播放时间发送返回:AA 25 03 时 分 秒 SMAA 25 03 01 02 03 D8AA 26 00 D0关闭播报时间发送

查询模块当前播放状态的串口指令。调试过程如截图所示:

[En]

Query the serial port instructions of the current playback status of the module. The debugging process is shown in the screenshot:

DY-SV17F 语音模块

该模块的串口协议很多,因为要实时播放,这是一个变化量。利用模块的组合回放功能,可以方便地实现实时播放。

[En]

There are many serial port protocols of the module, because to play the real-time time, this is a changing quantity. Using the combined playback function of the module, it is convenient to realize the real-time broadcast.

 AA 1B 长度 曲目1名称高字节 曲目名称1低字节 ..... 曲目n名称高字节 曲目n名称低字节 SM

例如:串口发送 AA 1B 04 30 31 30 32 8C,模块会将文件名为”01.mp3″、”02.mp3″的歌曲进行组合播放。

结果展示

对于组合播放,无非是将要组合的文件名拼接在一起,根据组合播放的通信协议,这些内容可以发送到一个字符数组中。代码相对简单。如有需要,直接到公众号后台回复:语音直播实时取码查看。

[En]

For combined playback, it is nothing more than stitching the file names to be combined, and according to the communication protocol of the combined playback, these contents can be sent into a character array. The code is relatively simple. If you need it, go directly to the official account background to reply: * voice broadcast real-time time * get the code to view.

让我们来看看实时语音播放的效果。

[En]

Let’s take a look at the effect of real-time voice playback.

效果赶不上专业的TTS模块,此方案胜在性价比高。

今天的文章到此结束。我希望它能对你有所帮助。下次见。

[En]

That’s the end of today’s article. I hope it will be helpful to you. I’ll see you next time.

更多精彩内容,敬请关注哈哥微信视频编号:程序员小哈。

[En]

For more wonderful content, please follow Brother Ha’s Wechat video number: programmer Xiao Ha.

Original: https://blog.csdn.net/rsd102/article/details/124704614
Author: 程序员小哈
Title: DY-SV17F 语音模块

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/527081/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球