How to use Index Marks in “speech-dispatcher”?

扶醉桌前 提交于 2019-12-08 08:41:28

问题


So, question like in theme: "How to use Index Marks in speech-dispatcher?" I hear many about it but can't find any tutorial with how to use it in SPD_MODE_THREADED. The main problem is when you send "SPEAK" command, you can't change data mode to SPD_DATA_SSML. And I think I doing something wrong. So, who knows how to use this Index Marks, tutorials is very acceptable too. Thank you!


回答1:


Solved, this is the way to set index marks in speech-dispatcher:

pthread_mutex_lock( m_connection->ssip_mutex );

spd_execute_command_wo_mutex( m_connection, "SET SELF SSML_MODE on" );

spd_execute_command_wo_mutex( m_connection, "SPEAK" );

char * reply = spd_send_data_wo_mutex( m_connection, "<speak>Hello, <mark name=\"mark1\"/> how does it work?</speak>", SPD_NO_REPLY );
delete[] reply;

spd_execute_command_wo_mutex( m_connection, "\r\n." );

spd_execute_command_wo_mutex( m_connection, "SET SELF SSML_MODE off" );

pthread_mutex_unlock( m_connection->ssip_mutex );

Where <mark name=\"mark1\"/> is index mark. And mark1 is index mark name.

This docs is very useful for low level speech-dispatcher communication: http://cvs.freebsoft.org/doc/speechd/ssip.html#Top



来源:https://stackoverflow.com/questions/14880234/how-to-use-index-marks-in-speech-dispatcher

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!