diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings.h | 2 | ||||
-rw-r--r-- | apps/talk.c | 30 | ||||
-rw-r--r-- | apps/talk.h | 8 |
3 files changed, 20 insertions, 20 deletions
diff --git a/apps/settings.h b/apps/settings.h index dd9c268d19..4f95027bcd 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -296,7 +296,7 @@ enum optiontype { INT, BOOL }; | |||
296 | 296 | ||
297 | struct opt_items { | 297 | struct opt_items { |
298 | unsigned const char* string; | 298 | unsigned const char* string; |
299 | int voice_id; | 299 | long voice_id; |
300 | }; | 300 | }; |
301 | 301 | ||
302 | /* prototypes */ | 302 | /* prototypes */ |
diff --git a/apps/talk.c b/apps/talk.c index e1f2c6f41b..6fb75c2601 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -69,7 +69,7 @@ struct voicefile /* file format of our voice file */ | |||
69 | struct queue_entry /* one entry of the internal queue */ | 69 | struct queue_entry /* one entry of the internal queue */ |
70 | { | 70 | { |
71 | unsigned char* buf; | 71 | unsigned char* buf; |
72 | int len; | 72 | long len; |
73 | }; | 73 | }; |
74 | 74 | ||
75 | 75 | ||
@@ -86,7 +86,7 @@ static int sent; /* how many bytes handed over to playback, owned by ISR */ | |||
86 | static unsigned char curr_hd[3]; /* current frame header, for re-sync */ | 86 | static unsigned char curr_hd[3]; /* current frame header, for re-sync */ |
87 | static int filehandle; /* global, so the MMC variant can keep the file open */ | 87 | static int filehandle; /* global, so the MMC variant can keep the file open */ |
88 | static unsigned char* p_silence; /* VOICE_PAUSE clip, used for termination */ | 88 | static unsigned char* p_silence; /* VOICE_PAUSE clip, used for termination */ |
89 | static int silence_len; /* length of the VOICE_PAUSE clip */ | 89 | static long silence_len; /* length of the VOICE_PAUSE clip */ |
90 | static unsigned char* p_lastclip; /* address of latest clip, for silence add */ | 90 | static unsigned char* p_lastclip; /* address of latest clip, for silence add */ |
91 | 91 | ||
92 | 92 | ||
@@ -95,9 +95,9 @@ static unsigned char* p_lastclip; /* address of latest clip, for silence add */ | |||
95 | static void load_voicefile(void); | 95 | static void load_voicefile(void); |
96 | static void mp3_callback(unsigned char** start, int* size); | 96 | static void mp3_callback(unsigned char** start, int* size); |
97 | static int shutup(void); | 97 | static int shutup(void); |
98 | static int queue_clip(unsigned char* buf, int size, bool enqueue); | 98 | static int queue_clip(unsigned char* buf, long size, bool enqueue); |
99 | static int open_voicefile(void); | 99 | static int open_voicefile(void); |
100 | static unsigned char* get_clip(int id, int* p_size); | 100 | static unsigned char* get_clip(long id, long* p_size); |
101 | 101 | ||
102 | 102 | ||
103 | /***************** Private implementation *****************/ | 103 | /***************** Private implementation *****************/ |
@@ -149,7 +149,7 @@ static void load_voicefile(void) | |||
149 | 149 | ||
150 | /* thumbnail buffer is the remaining space behind */ | 150 | /* thumbnail buffer is the remaining space behind */ |
151 | p_thumbnail = mp3buf + file_size; | 151 | p_thumbnail = mp3buf + file_size; |
152 | p_thumbnail += (int)p_thumbnail % 2; /* 16-bit align */ | 152 | p_thumbnail += (long)p_thumbnail % 2; /* 16-bit align */ |
153 | size_for_thumbnail = mp3end - p_thumbnail; | 153 | size_for_thumbnail = mp3end - p_thumbnail; |
154 | } | 154 | } |
155 | else | 155 | else |
@@ -292,7 +292,7 @@ static int shutup(void) | |||
292 | 292 | ||
293 | 293 | ||
294 | /* schedule a clip, at the end or discard the existing queue */ | 294 | /* schedule a clip, at the end or discard the existing queue */ |
295 | static int queue_clip(unsigned char* buf, int size, bool enqueue) | 295 | static int queue_clip(unsigned char* buf, long size, bool enqueue) |
296 | { | 296 | { |
297 | int queue_level; | 297 | int queue_level; |
298 | 298 | ||
@@ -335,9 +335,9 @@ static int queue_clip(unsigned char* buf, int size, bool enqueue) | |||
335 | } | 335 | } |
336 | 336 | ||
337 | /* fetch a clip from the voice file */ | 337 | /* fetch a clip from the voice file */ |
338 | static unsigned char* get_clip(int id, int* p_size) | 338 | static unsigned char* get_clip(long id, long* p_size) |
339 | { | 339 | { |
340 | int clipsize; | 340 | long clipsize; |
341 | unsigned char* clipbuf; | 341 | unsigned char* clipbuf; |
342 | 342 | ||
343 | if (id > VOICEONLY_DELIMITER) | 343 | if (id > VOICEONLY_DELIMITER) |
@@ -426,9 +426,9 @@ int talk_buffer_steal(void) | |||
426 | 426 | ||
427 | 427 | ||
428 | /* play a voice ID from voicefile */ | 428 | /* play a voice ID from voicefile */ |
429 | int talk_id(int id, bool enqueue) | 429 | int talk_id(long id, bool enqueue) |
430 | { | 430 | { |
431 | int clipsize; | 431 | long clipsize; |
432 | unsigned char* clipbuf; | 432 | unsigned char* clipbuf; |
433 | int unit; | 433 | int unit; |
434 | 434 | ||
@@ -445,10 +445,10 @@ int talk_id(int id, bool enqueue) | |||
445 | return -1; | 445 | return -1; |
446 | 446 | ||
447 | /* check if this is a special ID, with a value */ | 447 | /* check if this is a special ID, with a value */ |
448 | unit = ((unsigned)id) >> UNIT_SHIFT; | 448 | unit = ((unsigned long)id) >> UNIT_SHIFT; |
449 | if (unit) | 449 | if (unit) |
450 | { /* sign-extend the value */ | 450 | { /* sign-extend the value */ |
451 | id = (unsigned)id << (32-UNIT_SHIFT); | 451 | id = (unsigned long)id << (32-UNIT_SHIFT); |
452 | id >>= (32-UNIT_SHIFT); | 452 | id >>= (32-UNIT_SHIFT); |
453 | talk_value(id, unit, enqueue); /* speak it */ | 453 | talk_value(id, unit, enqueue); /* speak it */ |
454 | return 0; /* and stop, end of special case */ | 454 | return 0; /* and stop, end of special case */ |
@@ -507,10 +507,10 @@ int talk_file(const char* filename, bool enqueue) | |||
507 | 507 | ||
508 | /* say a numeric value, this word ordering works for english, | 508 | /* say a numeric value, this word ordering works for english, |
509 | but not necessarily for other languages (e.g. german) */ | 509 | but not necessarily for other languages (e.g. german) */ |
510 | int talk_number(int n, bool enqueue) | 510 | int talk_number(long n, bool enqueue) |
511 | { | 511 | { |
512 | int level = 0; /* mille count */ | 512 | int level = 0; /* mille count */ |
513 | int mil = 1000000000; /* highest possible "-illion" */ | 513 | long mil = 1000000000; /* highest possible "-illion" */ |
514 | 514 | ||
515 | if (mpeg_status()) /* busy, buffer in use */ | 515 | if (mpeg_status()) /* busy, buffer in use */ |
516 | return -1; | 516 | return -1; |
@@ -570,7 +570,7 @@ int talk_number(int n, bool enqueue) | |||
570 | } | 570 | } |
571 | 571 | ||
572 | /* singular/plural aware saying of a value */ | 572 | /* singular/plural aware saying of a value */ |
573 | int talk_value(int n, int unit, bool enqueue) | 573 | int talk_value(long n, int unit, bool enqueue) |
574 | { | 574 | { |
575 | int unit_id; | 575 | int unit_id; |
576 | static const int unit_voiced[] = | 576 | static const int unit_voiced[] = |
diff --git a/apps/talk.h b/apps/talk.h index d07f955e67..213e1803d4 100644 --- a/apps/talk.h +++ b/apps/talk.h | |||
@@ -49,7 +49,7 @@ enum { | |||
49 | 49 | ||
50 | /* make a "talkable" ID from number + unit | 50 | /* make a "talkable" ID from number + unit |
51 | unit is upper 4 bits, number the remaining (in regular 2's complement) */ | 51 | unit is upper 4 bits, number the remaining (in regular 2's complement) */ |
52 | #define TALK_ID(n,u) ((u)<<UNIT_SHIFT | ((n) & ~(-1<<UNIT_SHIFT))) | 52 | #define TALK_ID(n,u) (((long)(u))<<UNIT_SHIFT | ((n) & ~(-1L<<UNIT_SHIFT))) |
53 | 53 | ||
54 | /* convenience macro to have both virtual pointer and ID as arguments */ | 54 | /* convenience macro to have both virtual pointer and ID as arguments */ |
55 | #define STR(id) ID2P(id), id | 55 | #define STR(id) ID2P(id), id |
@@ -60,10 +60,10 @@ extern const char* const file_thumbnail_ext; /* ".talk" for file voicing */ | |||
60 | 60 | ||
61 | void talk_init(void); | 61 | void talk_init(void); |
62 | int talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */ | 62 | int talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */ |
63 | int talk_id(int id, bool enqueue); /* play a voice ID from voicefont */ | 63 | int talk_id(long id, bool enqueue); /* play a voice ID from voicefont */ |
64 | int talk_file(const char* filename, bool enqueue); /* play a thumbnail from file */ | 64 | int talk_file(const char* filename, bool enqueue); /* play a thumbnail from file */ |
65 | int talk_number(int n, bool enqueue); /* say a number */ | 65 | int talk_number(long n, bool enqueue); /* say a number */ |
66 | int talk_value(int n, int unit, bool enqueue); /* say a numeric value */ | 66 | int talk_value(long n, int unit, bool enqueue); /* say a numeric value */ |
67 | int talk_spell(const char* spell, bool enqueue); /* spell a string */ | 67 | int talk_spell(const char* spell, bool enqueue); /* spell a string */ |
68 | 68 | ||
69 | #endif /* __TALK_H__ */ | 69 | #endif /* __TALK_H__ */ |