Page 1 of 1

Speech Enabled Puppy

Posted: Thu 24 May 2012, 22:41
by gcmartin
In desktop technology, there are 2 desktop speech methods used. Desktop navigation and Office information insertion (i.e. Wordprocessing, and other pakages)

Can we do this in Puppy? How?

Thanks in advance.

Posted: Sun 03 Jun 2012, 09:25
by darkcity
Are you wanting something to allow partially sighted people to use puppy?

There was speakpup

speakpup thread
http://www.murga-linux.com/puppy/viewtopic.php?t=24571

speakpup blog
http://speakpup.blogspot.co.uk/

maybe Emacspeak is what your looking for?
http://emacspeak.sourceforge.net/

Posted: Sun 03 Jun 2012, 14:27
by disciple
I think he's asking about speach recognition, whereas I think speakpup was about the opposite (text to speech).

I believe there are a few options for text to speech, especially whatever you call things like jwmspeech.
But for speech recognition there aren't so many options. There is CMU Sphinx, but there don't seem to be a lot of end user applications are based on it (check out pocketsphinx though). Then there is Simon, which is KDE based. And there's another engine called Julius, but I can't see any end-user applications based on it (although I haven't looked very hard).

Posted: Sun 03 Jun 2012, 16:19
by amigo
AFAIK, Simon uses Julius. I have done some work on TTS and STT. Festival is the top-of-line for text-to-speech, but there are several lighter alternatives which are nearly as good or just as good. Yes, speech-to-text is much more complicated. Julius seems to do a better job than sphynx, though. I use Julius for STT and either flite or svox-pico for TTS.

Posted: Mon 04 Jun 2012, 20:26
by gcmartin
amigo wrote:AFAIK, Simon uses Julius. I have done some work on TTS and STT. Festival is the top-of-line for text-to-speech, but there are several lighter alternatives which are nearly as good or just as good. Yes, speech-to-text is much more complicated. Julius seems to do a better job than sphynx, though. I use Julius for STT and either flite or svox-pico for TTS.
Thanks everyone. Yes I am referring to Speech to Text (STT) and also to "Speech to control desktop actions". (Yes, I recognize that these though similar, interact with the system/subsystems differently).

@Amigo, would you do 2 things for us
  • share how you are doing STT in Puppy/Linux?
  • Is your method available as a PET for Puppy?
And, does anyone know of any other Open Source efforts in the area for speech in Linux.

Thanks in advance

Speech Enabled Puppy

Posted: Tue 20 Aug 2013, 11:20
by ETP
gcmartin wrote:
amigo wrote:AFAIK, Simon uses Julius. I have done some work on TTS and STT. Festival is the top-of-line for text-to-speech, but there are several lighter alternatives which are nearly as good or just as good. Yes, speech-to-text is much more complicated. Julius seems to do a better job than sphynx, though. I use Julius for STT and either flite or svox-pico for TTS.
Thanks everyone. Yes I am referring to Speech to Text (STT) and also to "Speech to control desktop actions". (Yes, I recognize that these though similar, interact with the system/subsystems differently).

@Amigo, would you do 2 things for us
  • share how you are doing STT in Puppy/Linux?
  • Is your method available as a PET for Puppy?
And, does anyone know of any other Open Source efforts in the area for speech in Linux.

Thanks in advance
You may be interested in the following. It is primitive but at least its a start.
http://www.murga-linux.com/puppy/viewto ... 680#719680

Posted: Tue 20 Aug 2013, 15:38
by amigo
Sorry I hadn't moticed new posts in this thread. Text-to-speech is really easy by using flite, but the male voices aren't very nice. svox-pico has nicer voices. I don't create pets myself, but you can use my src2pkg tool to create them.

A major subsystem service is being made avilaible to PUPPY

Posted: Tue 20 Aug 2013, 23:22
by gcmartin
It looks like the post provided by @ETP is a major PUPPY contribution for directing Puppy to achieve work for us, vocally. THIS IS ENORMOUSLY IMPORTANT as any of us can make use of its technology to productively achieve useful work.

If you have a moment, review the post he provides us, in his earlier post.

Posted: Wed 21 Aug 2013, 06:56
by disciple
amigo wrote:Sorry I hadn't moticed new posts in this thread. Speech-to-text is really easy by using flite, but the male voices aren't very nice. svox-pico has nicer voices. I don't create pets myself, but you can use my src2pkg tool to create them.
Flite is text-to-speech. How do you do speech to text? You said you use Julius - is it an end-user application, not just a library? I think maybe I just didn't build it when I was looking into this stuff previously because it sounded like the English acoustic models weren't complete enough.

Posted: Wed 21 Aug 2013, 07:14
by disciple
And, does anyone know of any other Open Source efforts in the area for speech in Linux.
I forget the name, but there was a really old project which was used in some of the tablet distros which turned into things like Meego. But when I looked it seemed like all the copies of the website and source had disappeared :(

Also, FWIW:
- Simon now supports 3 backends, CMU SPHINX, HTK (proprietary) and Julius.
- the Simon developer has recently been working on "a demo of open source speech recognition", including improving the acoustic and language model. See http://grasch.net/blog

Posted: Wed 21 Aug 2013, 10:36
by amigo
Sorry disciple -I must have just gotten out of bed or was needing to get in bed...

For Speech-to-text I use julius as it does a better job than sphynx.
I'll have to find my source tree for you because I created a small patch to the sources to quieten the julius output for easier parsing...

OK, found them. There is a julius program that can be built under the /julius directory. But, /julius-simple contains a more concise demo application which I modifed with the following patch:

Code: Select all

--- ./julius-simple.c.00	2009-04-11 11:51:20.000000000 +0000
+++ ./julius-simple.c	2010-11-08 09:00:15.000000000 +0000
@@ -29,6 +29,7 @@
 
 /* include top Julius library header */
 #include <julius/juliuslib.h>
+#define ACCEPTANCE_LEVEL .700
 
 /** 
  * Callback to be called when start waiting speech input. 
@@ -39,6 +40,7 @@
 {
   if (recog->jconf->input.speech_input == SP_MIC || recog->jconf->input.speech_input == SP_NETAUDIO) {
     fprintf(stderr, "<<< please speak >>>");
+	system("flite 'okay '");
   }
 }
 
@@ -91,6 +93,9 @@
   WORD_ID *seq;
   int seqnum;
   int n;
+  double total;
+  /* double alevel = 0.700; */
+  double alevel = ACCEPTANCE_LEVEL;
   Sentence *s;
   RecogProcess *r;
   HMM_Logical *p;
@@ -134,98 +139,41 @@
 
     /* output results for all the obtained sentences */
     winfo = r->lm->winfo;
-
+	
     for(n = 0; n < r->result.sentnum; n++) { /* for all sentences */
 
       s = &(r->result.sent[n]);
       seq = s->word;
       seqnum = s->word_num;
-
-      /* output word sequence like Julius */
-      printf("sentence%d:", n+1);
-      for(i=0;i<seqnum;i++) printf(" %s", winfo->woutput[seq[i]]);
-      printf("\n");
-      /* LM entry sequence */
-      printf("wseq%d:", n+1);
-      for(i=0;i<seqnum;i++) printf(" %s", winfo->wname[seq[i]]);
-      printf("\n");
-      /* phoneme sequence */
-      printf("phseq%d:", n+1);
-      put_hypo_phoneme(seq, seqnum, winfo);
-      printf("\n");
-      /* confidence scores */
-      printf("cmscore%d:", n+1);
-      for (i=0;i<seqnum; i++) printf(" %5.3f", s->confidence[i]);
-      printf("\n");
-      /* AM and LM scores */
-      printf("score%d: %f", n+1, s->score);
-      if (r->lmtype == LM_PROB) { /* if this process uses N-gram */
-	printf(" (AM: %f  LM: %f)", s->score_am, s->score_lm);
-      }
-      printf("\n");
-      if (r->lmtype == LM_DFA) { /* if this process uses DFA grammar */
-	/* output which grammar the hypothesis belongs to
-	   when using multiple grammars */
-	if (multigram_get_all_num(r->lm) > 1) {
-	  printf("grammar%d: %d\n", n+1, s->gram_id);
-	}
-      }
       
-      /* output alignment result if exist */
-      for (align = s->align; align; align = align->next) {
-	printf("=== begin forced alignment ===\n");
-	switch(align->unittype) {
-	case PER_WORD:
-	  printf("-- word alignment --\n"); break;
-	case PER_PHONEME:
-	  printf("-- phoneme alignment --\n"); break;
-	case PER_STATE:
-	  printf("-- state alignment --\n"); break;
-	}
-	printf(" id: from  to    n_score    unit\n");
-	printf(" ----------------------------------------\n");
-	for(i=0;i<align->num;i++) {
-	  printf("[%4d %4d]  %f  ", align->begin_frame[i], align->end_frame[i], align->avgscore[i]);
-	  switch(align->unittype) {
-	  case PER_WORD:
-	    printf("%s\t[%s]\n", winfo->wname[align->w[i]], winfo->woutput[align->w[i]]);
-	    break;
-	  case PER_PHONEME:
-	    p = align->ph[i];
-	    if (p->is_pseudo) {
-	      printf("{%s}\n", p->name);
-	    } else if (strmatch(p->name, p->body.defined->name)) {
-	      printf("%s\n", p->name);
-	    } else {
-	      printf("%s[%s]\n", p->name, p->body.defined->name);
-	    }
-	    break;
-	  case PER_STATE:
-	    p = align->ph[i];
-	    if (p->is_pseudo) {
-	      printf("{%s}", p->name);
-	    } else if (strmatch(p->name, p->body.defined->name)) {
-	      printf("%s", p->name);
-	    } else {
-	      printf("%s[%s]", p->name, p->body.defined->name);
-	    }
-	    if (r->am->hmminfo->multipath) {
-	      if (align->is_iwsp[i]) {
-		printf(" #%d (sp)\n", align->loc[i]);
-	      } else {
-		printf(" #%d\n", align->loc[i]);
-	      }
-	    } else {
-	      printf(" #%d\n", align->loc[i]);
-	    }
-	    break;
+      /* add the confidence scores */
+	  printf("cmscore%d:", n+1);
+      for (i=0;i<seqnum; i++) {
+		  printf(" %5.3f", s->confidence[i]);
+		  total = (total + s->confidence[i]);
 	  }
-	}
-	
-	printf("re-computed AM score: %f\n", align->allscore);
-
-	printf("=== end forced alignment ===\n");
-      }
+	  printf("\n");
+	  
+	  printf("Sentence%d(%5.3f)(%i)(%5.3f)(%5.3f):", n+1, (total-2), (seqnum-2), (total-2) / (seqnum-2), alevel);
+	  printf("\n");
+	  /* ignore first and last (always perfect) scores and subtract them from seqnum */
+	  if ((total-2) / (seqnum-2) > alevel) {
+		  /* for(i=0;i<seqnum;i++) printf(" %s", winfo->woutput[seq[i]]); */
+		  /* ignore the first and last outputs (<s> and </s>) */
+		  for(i=1;i<seqnum-1;i++) {
+			  if (s->confidence[i] > alevel) {
+				printf(" %s", winfo->woutput[seq[i]]);
+			  } else {
+			    /* if the score for this word is lower than alevel, output a missed-word indicator*/
+				printf(" !!??");
+			  }
+		  }
+	  } else {
+		/* if average of all scores is less than alevel, output a warning text */
+		printf("UNRECOGNIZED UTTERANCE");
+		system("flite 'UNRECOGNIZED UTTERANCE'");
+	  }
+	  printf("\n");
     }
   }
 
@@ -263,7 +211,7 @@
 
   /* by default, all messages will be output to standard out */
   /* to disable output, uncomment below */
-  //jlog_set_output(NULL);
+  jlog_set_output(NULL);
 
   /* output log to a file */
   //FILE *fp; fp = fopen("log.txt", "w"); jlog_set_output(fp);
Those changes were still tentative, but make the output lots more concise.