summaryrefslogtreecommitdiff
path: root/apps/talk.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/talk.c')
-rw-r--r--apps/talk.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/apps/talk.c b/apps/talk.c
index 7ba858b47d..a0c730cbcc 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -35,7 +35,7 @@ extern void bitswap(unsigned char *data, int length); /* no header for this */
35 35
36/***************** Constants *****************/ 36/***************** Constants *****************/
37 37
38#define QUEUE_SIZE 20 38#define QUEUE_SIZE 50
39const char* voicefont_file = "/.rockbox/langs/english.voice"; 39const char* voicefont_file = "/.rockbox/langs/english.voice";
40const char* dir_thumbnail_name = ".dirname.mp3"; 40const char* dir_thumbnail_name = ".dirname.mp3";
41 41
@@ -487,3 +487,33 @@ int talk_value(int n, int unit, bool enqueue)
487 return 0; 487 return 0;
488} 488}
489 489
490/* spell a string */
491int talk_spell(char* spell, bool enqueue)
492{
493 char c; /* currently processed char */
494
495 if (mpeg_status()) /* busy, buffer in use */
496 return -1;
497
498 if (!enqueue)
499 shutup(); /* cut off all the pending stuff */
500
501 while ((c = *spell++) != '\0')
502 {
503 /* if this grows into too many cases, I should use a table */
504 if (c >= 'A' && c <= 'Z')
505 talk_id(VOICE_CHAR_A + c - 'A', true);
506 else if (c >= 'a' && c <= 'z')
507 talk_id(VOICE_CHAR_A + c - 'a', true);
508 else if (c >= '0' && c <= '9')
509 talk_id(VOICE_ZERO + c - '0', true);
510 else if (c == '-')
511 talk_id(VOICE_MINUS, true);
512 else if (c == '+')
513 talk_id(VOICE_PLUS, true);
514 else if (c == '.')
515 talk_id(VOICE_POINT, true);
516 }
517
518 return 0;
519}