SYN6288芯片手册:http://www.tts168.com.cn/bao/SYN6288--Manual.pdf
GB2312国标码检索表:http://ash.jp/code/cn/gb2312tbl.htm
汉字十六进制转换工具:http://www.dfrobot.com.cn/image/data/SEN0117/char%20converter%20tool.zip


netduino plus 2实验代码如下
public class Program
{
private Syn6288 _speaker;
public static void Main()
{
_speaker = new Syn6288(Serial.COM1);
this._ResponseMethod = method;
_Pairs = new Hashtable();
// 初始化,最大音量/背景静音/语速5(最快)
SaySomething("[d][v16][m0][t5]");

SaySomething("谢谢你的关注.");
}

private void SaySomething(string content)
{
ushort[] unicode = new ushort[200];
int count = Toolbox.NETMF.Tools.UTF82Unicode(content, unicode, content.Length);// Encoding.UTF8.GetBytes(tulingText);
byte[] texts = new byte[count * 2];
for (int i = 0; i < count; i++)
{
texts[i * 2] = (byte)(unicode[i] >> 8);
texts[i * 2 + 1] = (byte)((unicode[i] << 8) >> 8);
}
_speaker.Play(texts, (byte)texts.Length, 0, 3);
}
}

Last edited Jun 10, 2014 at 8:12 AM by gezhaowan, version 5