br />
PORT_Init(); // 初始化數(shù)據(jù)交叉開關(guān)和通用IO口
cs=0; res=1; delay(10); res=0; delay(10);
spi_begin();
status[0]=spi_send_byte(0x14);
status[1]=spi_send_byte(0x00);
spi_end();
delay(500); //ready to accept commands but not powered up
spi_begin();
status[2]=spi_send_byte(0x02);
status[3]=spi_send_byte(0x00);
spi_end();
delay(500); //send the power up command
spi_begin();
status[4]=spi_send_byte(0x06); //send read interrupt command
status[5]=spi_send_byte(0x00);
status[6]=spi_send_byte(0x00);
status[7]=spi_send_byte(0x00);
spi_end();
delay(500); //return the status of the wts701,now be ready for conversion
spi_begin();
spi_send_byte(0x51);
spi_send_byte(0x00);
spi_end();
delay(500); //svol set vol register command
spi_begin
spi_send_byte(0x52);
spi_send_byte(0x07);
spi_end();
delay(500);//svol set vol register command
spi_begin();
status[8]=spi_send_byte(0x81);
status[9]=spi_send_byte(0x00);
status[10]=spi_send_byte(0x10); //^P
status[11]=spi_send_byte('D'); //“大”的拼音
status[12]=spi_send_byte('A'
status[13]=spi_send_byte('4');
status[14]=spi_send_byte('J'); //“家”的拼音
status[15]=spi_send_byte('I');
status[16]=spi_send_byte('A');
status[17]=spi_send_byte('1');
status[18]=spi_send_byte('H'); //“好”的拼音
status[19]=spi_send_byte('A');
status[20]=spi_send_byte('0');
status[21]=spi_send_byte('3');
status[22]=spi_send_byte(' '); //結(jié)束符
spi_end();
while(1);
}
5 結(jié)束語
實際使用時,可利用華邦WTS701語音芯片的預(yù)錄人聲方式來讓文字轉(zhuǎn)換后的語音更具有人情味,F(xiàn)今市場上的TTS產(chǎn)品多半采用計算機(jī)合成的語音模式,WTS701的問世則可把一般文字轉(zhuǎn)化為真人發(fā)音的語音輸出,從而創(chuàng)造一個更具人性化的語音環(huán)境。





