Update of /cvsroot/playerstage/code/player/client_libs/libplayerc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19519/libplayerc

Modified Files:
        dev_speech_recognition.c 
Log Message:
applied patch [ 1619626 ] fix speech recognition



Index: dev_speech_recognition.c
===================================================================
RCS file: 
/cvsroot/playerstage/code/player/client_libs/libplayerc/dev_speech_recognition.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** dev_speech_recognition.c    21 Sep 2006 05:07:06 -0000      1.2
--- dev_speech_recognition.c    9 Jun 2007 02:59:12 -0000       1.3
***************
*** 1,6 ****
  #include <stdlib.h>
  #include <string.h>
- //#include <sys/types.h>
- //#include <netinet/in.h>
  
  #include "playerc.h"
--- 1,4 ----
***************
*** 22,26 ****
  }
  
- 
  // Destroy a speech_recognition proxy
  void playerc_speechrecognition_destroy(playerc_speechrecognition_t *device)
--- 20,23 ----
***************
*** 45,65 ****
  void playerc_speech_recognition_putmsg(playerc_speechrecognition_t *device, 
player_msghdr_t *hdr, player_speech_recognition_data_t *buffer, size_t len)
  {
!   memset(device->words,0,30*20);
!   player_speech_recognition_data_t *data = 
(player_speech_recognition_data_t*)buffer;
  
    if((hdr->type == PLAYER_MSGTYPE_DATA) && (hdr->subtype == 
PLAYER_SPEECH_RECOGNITION_DATA_STRING ))
    {
!     char * str1;
      int i;
      device->wordCount = 0;
! //    printf("data->text %s\n",data->text);
  
!     for (str1 = strtok((*data).text, " ") ; str1 != NULL ; str1 = 
strtok(NULL, " ") )
      {
        for (i=0;i<strlen(str1);i++)
        {
- //        printf("str1[%d]=%c",i,str1[i]);
- //        
printf("device->words[%i][%i]=%c\n",device->wordCount,i,device->words[device->wordCount][i]);
          device->words[device->wordCount][i]=str1[i];
        }
        device->wordCount++;
--- 42,89 ----
  void playerc_speech_recognition_putmsg(playerc_speechrecognition_t *device, 
player_msghdr_t *hdr, player_speech_recognition_data_t *buffer, size_t len)
  {
! //   memset(device->words,0,30*20);
! //   player_speech_recognition_data_t *data = 
(player_speech_recognition_data_t*)buffer;
! // 
! //   if((hdr->type == PLAYER_MSGTYPE_DATA) && (hdr->subtype == 
PLAYER_SPEECH_RECOGNITION_DATA_STRING ))
! //   {
! //     char * str1;
! //     int i;
! //     device->wordCount = 0;
! // //    printf("data->text %s\n",data->text);
! // 
! //     for (str1 = strtok((*data).text, " ") ; str1 != NULL ; str1 = 
strtok(NULL, " ") )
! //     {
! //       for (i=0;i<strlen(str1);i++)
! //       {
! // //        printf("str1[%d]=%c",i,str1[i]);
! // //        
printf("device->words[%i][%i]=%c\n",device->wordCount,i,device->words[device->wordCount][i]);
! //         device->words[device->wordCount][i]=str1[i];
! //       }
! //       device->wordCount++;
! //     }
! //   }
! //   return;
! // 
  
    if((hdr->type == PLAYER_MSGTYPE_DATA) && (hdr->subtype == 
PLAYER_SPEECH_RECOGNITION_DATA_STRING ))
    {
!     player_speech_recognition_data_t *data = 
(player_speech_recognition_data_t*)buffer;
!     char * str1=NULL;
      int i;
+     memset(device->rawText,0,PLAYER_SPEECH_RECOGNITION_TEXT_LEN*sizeof(char));
+     memset(device->words,0,30*20*sizeof(char));
      device->wordCount = 0;
!    printf("data->text %s\n",data->text);
!     for (i=0;i<data->text_count;i++)
!       device->rawText[i]=data->text[i];
  
!     for (str1 = strtok(device->rawText, " ") ; str1 != NULL ; str1 = 
strtok(NULL, " ") )
      {
        for (i=0;i<strlen(str1);i++)
        {
          device->words[device->wordCount][i]=str1[i];
+        printf("str1[%d]=%c",i,str1[i]);
+        
printf("device->words[%i][%i]=%c\n",device->wordCount,i,device->words[device->wordCount][i]);
+ 
        }
        device->wordCount++;


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to