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