1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2004 Jörg Hohensohn
12 * This module collects the Talkbox and voice UI functions.
13 * (Talkbox reads directory names from mp3 clips called thumbnails,
14 * the voice UI lets menus and screens "talk" from a voicefile in memory.
16 * All files in this archive are subject to the GNU General Public License.
17 * See the file COPYING in the source tree root for full license agreement.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
32 #include "settings_list.h"
33 #include "mp3_playback.h"
41 #if CONFIG_CODEC == SWCODEC
47 /* Memory layout varies between targets because the
48 Archos (MASCODEC) devices cannot mix voice and audio playback
50 MASCODEC | MASCODEC | SWCODEC
51 (playing) | (stopped) |
52 audiobuf-----------+-----------+------------
53 audio | voice | thumbnail
54 |-----------|------------
60 audiobufend----------+-----------+------------
62 SWCODEC allocates dedicated buffers, MASCODEC reuses audiobuf. */
65 /***************** Constants *****************/
67 #define QUEUE_SIZE 64 /* must be a power of two */
68 #define QUEUE_MASK (QUEUE_SIZE-1)
69 const char* const dir_thumbnail_name
= "_dirname.talk";
70 const char* const file_thumbnail_ext
= ".talk";
72 /***************** Functional Macros *****************/
74 #define QUEUE_LEVEL ((queue_write - queue_read) & QUEUE_MASK)
76 #define LOADED_MASK 0x80000000 /* MSB */
78 #if CONFIG_CODEC == SWCODEC
79 #define MAX_THUMBNAIL_BUFSIZE 0x10000
82 /***************** Data types *****************/
84 struct clip_entry
/* one entry of the index table */
86 int offset
; /* offset from start of voicefile file */
87 int size
; /* size of the clip */
90 struct voicefile
/* file format of our voice file */
92 int version
; /* version of the voicefile */
93 int target_id
; /* the rockbox target the file was made for */
94 int table
; /* offset to index table, (=header size) */
95 int id1_max
; /* number of "normal" clips contained in above index */
96 int id2_max
; /* number of "voice only" clips contained in above index */
97 struct clip_entry index
[]; /* followed by the index tables */
98 /* and finally the mp3 clips, not visible here, bitswapped
99 for SH based players */
102 struct queue_entry
/* one entry of the internal queue */
109 /***************** Globals *****************/
111 static unsigned char* p_thumbnail
= NULL
; /* buffer for thumbnail */
112 static long size_for_thumbnail
; /* leftover buffer size for it */
113 static struct voicefile
* p_voicefile
; /* loaded voicefile */
114 static bool has_voicefile
; /* a voicefile file is present */
115 static struct queue_entry queue
[QUEUE_SIZE
]; /* queue of scheduled clips */
116 static bool force_enqueue_next
; /* enqueue next utterance even if enqueue is false */
117 static int queue_write
; /* write index of queue, by application */
118 static int queue_read
; /* read index of queue, by ISR context */
119 static int sent
; /* how many bytes handed over to playback, owned by ISR */
120 static unsigned char curr_hd
[3]; /* current frame header, for re-sync */
121 static int filehandle
= -1; /* global, so the MMC variant can keep the file open */
122 static unsigned char* p_silence
; /* VOICE_PAUSE clip, used for termination */
123 static long silence_len
; /* length of the VOICE_PAUSE clip */
124 static unsigned char* p_lastclip
; /* address of latest clip, for silence add */
125 static unsigned long voicefile_size
= 0; /* size of the loaded voice file */
126 static unsigned char last_lang
[MAX_FILENAME
+1]; /* name of last used lang file (in talk_init) */
127 static bool talk_initialized
; /* true if talk_init has been called */
128 static int talk_temp_disable_count
; /* if positive, temporarily disable voice UI (not saved) */
131 /***************** Private implementation *****************/
133 static int open_voicefile(void)
136 char* p_lang
= "english"; /* default */
138 if ( global_settings
.lang_file
[0] &&
139 global_settings
.lang_file
[0] != 0xff )
140 { /* try to open the voice file of the selected language */
141 p_lang
= (char *)global_settings
.lang_file
;
144 snprintf(buf
, sizeof(buf
), LANG_DIR
"/%s.voice", p_lang
);
146 return open(buf
, O_RDONLY
);
150 /* fetch a clip from the voice file */
151 static unsigned char* get_clip(long id
, long* p_size
)
154 unsigned char* clipbuf
;
156 if (id
> VOICEONLY_DELIMITER
)
157 { /* voice-only entries use the second part of the table */
158 id
-= VOICEONLY_DELIMITER
+ 1;
159 if (id
>= p_voicefile
->id2_max
)
160 return NULL
; /* must be newer than we have */
161 id
+= p_voicefile
->id1_max
; /* table 2 is behind table 1 */
164 { /* normal use of the first table */
165 if (id
>= p_voicefile
->id1_max
)
166 return NULL
; /* must be newer than we have */
169 clipsize
= p_voicefile
->index
[id
].size
;
170 if (clipsize
== 0) /* clip not included in voicefile */
172 clipbuf
= (unsigned char *) p_voicefile
+ p_voicefile
->index
[id
].offset
;
174 #ifdef HAVE_MMC /* dynamic loading, on demand */
175 if (!(clipsize
& LOADED_MASK
))
176 { /* clip used for the first time, needs loading */
177 lseek(filehandle
, p_voicefile
->index
[id
].offset
, SEEK_SET
);
178 if (read(filehandle
, clipbuf
, clipsize
) != clipsize
)
179 return NULL
; /* read error */
181 p_voicefile
->index
[id
].size
|= LOADED_MASK
; /* mark as loaded */
184 { /* clip is in memory already */
185 clipsize
&= ~LOADED_MASK
; /* without the extra bit gives true size */
194 /* load the voice file into the mp3 buffer */
195 static void load_voicefile(void)
200 #ifdef ROCKBOX_LITTLE_ENDIAN
204 filehandle
= open_voicefile();
205 if (filehandle
< 0) /* failed to open */
208 file_size
= filesize(filehandle
);
209 if (file_size
> audiobufend
- audiobuf
) /* won't fit? */
212 #ifdef HAVE_MMC /* load only the header for now */
213 load_size
= offsetof(struct voicefile
, index
);
214 #else /* load the full file */
215 load_size
= file_size
;
218 got_size
= read(filehandle
, audiobuf
, load_size
);
219 if (got_size
!= load_size
/* failure */)
222 #ifdef ROCKBOX_LITTLE_ENDIAN
223 logf("Byte swapping voice file");
224 structec_convert(audiobuf
, "lllll", 1, true);
227 if (((struct voicefile
*)audiobuf
)->table
/* format check */
228 == offsetof(struct voicefile
, index
))
230 p_voicefile
= (struct voicefile
*)audiobuf
;
232 if (p_voicefile
->version
!= VOICE_VERSION
||
233 p_voicefile
->target_id
!= TARGET_ID
)
235 logf("Incompatible voice file");
238 #if CONFIG_CODEC != SWCODEC
239 /* MASCODEC: now use audiobuf for voice then thumbnail */
240 p_thumbnail
= audiobuf
+ file_size
;
241 p_thumbnail
+= (long)p_thumbnail
% 2; /* 16-bit align */
242 size_for_thumbnail
= audiobufend
- p_thumbnail
;
248 #ifdef ROCKBOX_LITTLE_ENDIAN
249 for (i
= 0; i
< p_voicefile
->id1_max
+ p_voicefile
->id2_max
; i
++)
250 structec_convert(&p_voicefile
->index
[i
], "ll", 1, true);
254 /* load the index table, now that we know its size from the header */
255 load_size
= (p_voicefile
->id1_max
+ p_voicefile
->id2_max
)
256 * sizeof(struct clip_entry
);
257 got_size
= read(filehandle
,
258 (unsigned char *) p_voicefile
+ offsetof(struct voicefile
, index
), load_size
);
259 if (got_size
!= load_size
) /* read error */
262 close(filehandle
); /* only the MMC variant leaves it open */
266 /* make sure to have the silence clip, if available */
267 p_silence
= get_clip(VOICE_PAUSE
, &silence_len
);
273 has_voicefile
= false; /* don't try again */
283 /* called in ISR context if mp3 data got consumed */
284 static void mp3_callback(unsigned char** start
, size_t* size
)
286 queue
[queue_read
].len
-= sent
; /* we completed this */
287 queue
[queue_read
].buf
+= sent
;
289 if (queue
[queue_read
].len
> 0) /* current clip not finished? */
290 { /* feed the next 64K-1 chunk */
291 #if CONFIG_CODEC != SWCODEC
292 sent
= MIN(queue
[queue_read
].len
, 0xFFFF);
294 sent
= queue
[queue_read
].len
;
296 *start
= queue
[queue_read
].buf
;
300 else if (sent
> 0) /* go to next entry */
302 queue_read
= (queue_read
+ 1) & QUEUE_MASK
;
307 if (QUEUE_LEVEL
!= 0) /* queue is not empty? */
308 { /* start next clip */
309 #if CONFIG_CODEC != SWCODEC
310 sent
= MIN(queue
[queue_read
].len
, 0xFFFF);
312 sent
= queue
[queue_read
].len
;
314 *start
= p_lastclip
= queue
[queue_read
].buf
;
316 curr_hd
[0] = p_lastclip
[1];
317 curr_hd
[1] = p_lastclip
[2];
318 curr_hd
[2] = p_lastclip
[3];
320 else if (p_silence
!= NULL
/* silence clip available */
321 && p_lastclip
!= p_silence
/* previous clip wasn't silence */
322 && p_lastclip
!= p_thumbnail
) /* ..or thumbnail */
323 { /* add silence clip when queue runs empty playing a voice clip */
324 queue
[queue_write
].buf
= p_silence
;
325 queue
[queue_write
].len
= silence_len
;
326 queue_write
= (queue_write
+ 1) & QUEUE_MASK
;
332 *size
= 0; /* end of data */
336 /***************** Public routines *****************/
338 /* stop the playback and the pending clips */
339 void talk_force_shutup(void)
341 /* Most of this is MAS only */
342 #if CONFIG_CODEC != SWCODEC
347 unsigned char* search
;
349 if (QUEUE_LEVEL
== 0) /* has ended anyway */
352 #if CONFIG_CPU == SH7034
353 CHCR3
&= ~0x0001; /* disable the DMA (and therefore the interrupt also) */
354 #endif /* CONFIG_CPU == SH7034 */
355 /* search next frame boundary and continue up to there */
356 pos
= search
= mp3_get_pos();
357 end
= queue
[queue_read
].buf
+ queue
[queue_read
].len
;
359 if (pos
>= queue
[queue_read
].buf
360 && pos
<= end
) /* really our clip? */
361 { /* (for strange reasons this isn't nesessarily the case) */
362 /* find the next frame boundary */
363 while (search
< end
) /* search the remaining data */
365 if (*search
++ != 0xFF) /* quick search for frame sync byte */
366 continue; /* (this does the majority of the job) */
368 /* look at the (bitswapped) rest of header candidate */
369 if (search
[0] == curr_hd
[0] /* do the quicker checks first */
370 && search
[2] == curr_hd
[2]
371 && (search
[1] & 0x30) == (curr_hd
[1] & 0x30)) /* sample rate */
373 search
--; /* back to the sync byte */
374 break; /* From looking at it, this is our header. */
379 { /* play old data until the frame end, to keep the MAS in sync */
382 queue_write
= (queue_read
+ 1) & QUEUE_MASK
; /* will be empty after next callback */
383 queue
[queue_read
].len
= sent
; /* current one ends after this */
385 #if CONFIG_CPU == SH7034
386 DTCR3
= sent
; /* let the DMA finish this frame */
387 CHCR3
|= 0x0001; /* re-enable DMA */
388 #endif /* CONFIG_CPU == SH7034 */
392 #endif /* CONFIG_CODEC != SWCODEC */
394 /* Either SWCODEC, or MAS had nothing to do (was frame boundary or not our clip) */
396 queue_write
= queue_read
= 0; /* reset the queue */
400 /* Shutup the voice, except if force_enqueue_next is set. */
401 void talk_shutup(void)
403 if (!force_enqueue_next
)
407 /* schedule a clip, at the end or discard the existing queue */
408 static void queue_clip(unsigned char* buf
, long size
, bool enqueue
)
413 talk_shutup(); /* cut off all the pending stuff */
414 /* Something is being enqueued, force_enqueue_next override is no
416 force_enqueue_next
= false;
419 return; /* safety check */
420 #if CONFIG_CPU == SH7034
421 /* disable the DMA temporarily, to be safe of race condition */
424 queue_level
= QUEUE_LEVEL
; /* check old level */
426 if (queue_level
< QUEUE_SIZE
- 1) /* space left? */
428 queue
[queue_write
].buf
= buf
; /* populate an entry */
429 queue
[queue_write
].len
= size
;
430 queue_write
= (queue_write
+ 1) & QUEUE_MASK
;
433 if (queue_level
== 0)
434 { /* queue was empty, we have to do the initial start */
436 #if CONFIG_CODEC != SWCODEC
437 sent
= MIN(size
, 0xFFFF); /* DMA can do no more */
441 mp3_play_data(buf
, sent
, mp3_callback
);
445 mp3_play_pause(true); /* kickoff audio */
449 #if CONFIG_CPU == SH7034
450 CHCR3
|= 0x0001; /* re-enable DMA */
458 /* common code for talk_init() and talk_buffer_steal() */
459 static void reset_state(void)
461 queue_write
= queue_read
= 0; /* reset the queue */
462 p_voicefile
= NULL
; /* indicate no voicefile (trashed) */
463 #if CONFIG_CODEC == SWCODEC
464 /* Allocate a dedicated thumbnail buffer - once */
465 if (p_thumbnail
== NULL
)
467 size_for_thumbnail
= audiobufend
- audiobuf
;
468 if (size_for_thumbnail
> MAX_THUMBNAIL_BUFSIZE
)
469 size_for_thumbnail
= MAX_THUMBNAIL_BUFSIZE
;
470 p_thumbnail
= buffer_alloc(size_for_thumbnail
);
473 /* Just use the audiobuf, without allocating anything */
474 p_thumbnail
= audiobuf
;
475 size_for_thumbnail
= audiobufend
- audiobuf
;
477 p_silence
= NULL
; /* pause clip not accessible */
481 /***************** Public implementation *****************/
485 talk_temp_disable_count
= 0;
486 if (talk_initialized
&& !strcasecmp(last_lang
, global_settings
.lang_file
))
488 /* not a new file, nothing to do */
493 if (filehandle
>= 0) /* MMC: An old voice file might still be open */
500 talk_initialized
= true;
501 strncpy((char *) last_lang
, (char *)global_settings
.lang_file
,
504 #if CONFIG_CODEC == SWCODEC
505 audio_get_buffer(false, NULL
); /* Must tell audio to reinitialize */
507 reset_state(); /* use this for most of our inits */
509 filehandle
= open_voicefile();
510 has_voicefile
= (filehandle
>= 0); /* test if we can open it */
515 voicefile_size
= filesize(filehandle
);
516 close(filehandle
); /* close again, this was just to detect presence */
522 #if CONFIG_CODEC == SWCODEC
523 /* return if a voice codec is required or not */
524 bool talk_voice_required(void)
526 return (voicefile_size
!= 0) /* Voice file is available */
527 || (global_settings
.talk_dir_clip
) /* Thumbnail clips are required */
528 || (global_settings
.talk_file_clip
);
532 /* return size of voice file */
533 int talk_get_bufsize(void)
535 return voicefile_size
;
538 /* somebody else claims the mp3 buffer, e.g. for regular play/record */
539 void talk_buffer_steal(void)
541 #if CONFIG_CODEC != SWCODEC
545 if (filehandle
>= 0) /* only relevant for MMC */
555 /* play a voice ID from voicefile */
556 int talk_id(int32_t id
, bool enqueue
)
559 unsigned char* clipbuf
;
562 if (talk_temp_disable_count
> 0)
563 return -1; /* talking has been disabled */
564 #if CONFIG_CODEC != SWCODEC
565 if (audio_status()) /* busy, buffer in use */
569 if (p_voicefile
== NULL
&& has_voicefile
)
570 load_voicefile(); /* reload needed */
572 if (p_voicefile
== NULL
) /* still no voices? */
575 if (id
== -1) /* -1 is an indication for silence */
578 /* check if this is a special ID, with a value */
579 unit
= ((uint32_t)id
) >> UNIT_SHIFT
;
581 { /* sign-extend the value */
582 id
= (uint32_t)id
<< (32-UNIT_SHIFT
);
583 id
>>= (32-UNIT_SHIFT
);
584 talk_value(id
, unit
, enqueue
); /* speak it */
585 return 0; /* and stop, end of special case */
588 clipbuf
= get_clip(id
, &clipsize
);
590 return -1; /* not present */
592 queue_clip(clipbuf
, clipsize
, enqueue
);
597 /* Speaks zero or more IDs (from an array). */
598 int talk_idarray(long *ids
, bool enqueue
)
603 while(*ids
!= TALK_FINAL_ID
)
605 if((r
= talk_id(*ids
++, enqueue
)) <0)
612 /* Make sure the current utterance is not interrupted by the next one. */
613 void talk_force_enqueue_next(void)
615 force_enqueue_next
= true;
618 /* play a thumbnail from file */
619 int talk_file(const char* filename
, bool enqueue
)
623 #if CONFIG_CODEC != SWCODEC
624 struct mp3entry info
;
627 if (talk_temp_disable_count
> 0)
628 return -1; /* talking has been disabled */
629 #if CONFIG_CODEC != SWCODEC
630 if (audio_status()) /* busy, buffer in use */
634 if (p_thumbnail
== NULL
|| size_for_thumbnail
<= 0)
637 #if CONFIG_CODEC != SWCODEC
638 if(mp3info(&info
, filename
)) /* use this to find real start */
640 return 0; /* failed to open, or invalid */
644 fd
= open(filename
, O_RDONLY
);
645 if (fd
< 0) /* failed to open */
650 #if CONFIG_CODEC != SWCODEC
651 lseek(fd
, info
.first_frame_offset
, SEEK_SET
); /* behind ID data */
654 size
= read(fd
, p_thumbnail
, size_for_thumbnail
);
657 /* ToDo: find audio, skip ID headers and trailers */
659 if (size
> 0 && size
!= size_for_thumbnail
) /* Don't play missing or truncated clips */
661 #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
662 bitswap(p_thumbnail
, size
);
664 queue_clip(p_thumbnail
, size
, enqueue
);
671 /* say a numeric value, this word ordering works for english,
672 but not necessarily for other languages (e.g. german) */
673 int talk_number(long n
, bool enqueue
)
675 int level
= 2; /* mille count */
676 long mil
= 1000000000; /* highest possible "-illion" */
678 if (talk_temp_disable_count
> 0)
679 return -1; /* talking has been disabled */
680 #if CONFIG_CODEC != SWCODEC
681 if (audio_status()) /* busy, buffer in use */
686 talk_shutup(); /* cut off all the pending stuff */
690 talk_id(VOICE_ZERO
, true);
696 talk_id(VOICE_MINUS
, true);
702 int segment
= n
/ mil
; /* extract in groups of 3 digits */
703 n
-= segment
* mil
; /* remove the used digits from number */
704 mil
/= 1000; /* digit place for next round */
708 int hundreds
= segment
/ 100;
709 int ones
= segment
% 100;
713 talk_id(VOICE_ZERO
+ hundreds
, true);
714 talk_id(VOICE_HUNDRED
, true);
717 /* combination indexing */
720 int tens
= ones
/10 + 18;
721 talk_id(VOICE_ZERO
+ tens
, true);
725 /* direct indexing */
727 talk_id(VOICE_ZERO
+ ones
, true);
729 /* add billion, million, thousand */
731 talk_id(VOICE_THOUSAND
+ level
, true);
739 /* Say time duration/interval. Input is time in seconds,
740 say hours,minutes,seconds. */
741 static int talk_time_unit(long secs
, bool exact
, bool enqueue
)
746 if((hours
= secs
/3600)) {
748 talk_value(hours
, UNIT_HOUR
, true);
750 if((mins
= secs
/60)) {
753 talk_value(mins
, UNIT_MIN
, true);
754 else talk_number(mins
, true); /* don't say "minutes" */
756 if((exact
&& secs
) || (!hours
&& !mins
))
757 talk_value(secs
, UNIT_SEC
, true);
758 else if(!hours
&& secs
)
759 talk_number(secs
, true);
763 /* singular/plural aware saying of a value */
764 int talk_value(long n
, int unit
, bool enqueue
)
767 static const int unit_voiced
[] =
768 { /* lookup table for the voice ID of the units */
769 [0 ... UNIT_LAST
-1] = -1, /* regular ID, int, signed */
771 = VOICE_MILLISECONDS
, /* here come the "real" units */
785 = VOICE_MILLIAMPHOURS
,
795 = VOICE_KBIT_PER_SEC
,
797 = VOICE_PM_UNITS_PER_TICK
,
800 if (talk_temp_disable_count
> 0)
801 return -1; /* talking has been disabled */
802 #if CONFIG_CODEC != SWCODEC
803 if (audio_status()) /* busy, buffer in use */
807 /* special case for time duration */
808 if (unit
== UNIT_TIME
|| unit
== UNIT_TIME_EXACT
)
809 return talk_time_unit(n
, unit
== UNIT_TIME_EXACT
, enqueue
);
811 if (unit
< 0 || unit
>= UNIT_LAST
)
814 unit_id
= unit_voiced
[unit
];
816 if ((n
==1 || n
==-1) /* singular? */
817 && unit_id
>= VOICE_SECONDS
&& unit_id
<= VOICE_HOURS
)
819 unit_id
--; /* use the singular for those units which have */
822 /* special case with a "plus" before */
823 if (n
> 0 && (unit
== UNIT_SIGNED
|| unit
== UNIT_DB
))
825 talk_id(VOICE_PLUS
, enqueue
);
829 talk_number(n
, enqueue
); /* say the number */
830 talk_id(unit_id
, true); /* say the unit, if any */
836 int talk_spell(const char* spell
, bool enqueue
)
838 char c
; /* currently processed char */
840 if (talk_temp_disable_count
> 0)
841 return -1; /* talking has been disabled */
842 #if CONFIG_CODEC != SWCODEC
843 if (audio_status()) /* busy, buffer in use */
848 talk_shutup(); /* cut off all the pending stuff */
850 while ((c
= *spell
++) != '\0')
852 /* if this grows into too many cases, I should use a table */
853 if (c
>= 'A' && c
<= 'Z')
854 talk_id(VOICE_CHAR_A
+ c
- 'A', true);
855 else if (c
>= 'a' && c
<= 'z')
856 talk_id(VOICE_CHAR_A
+ c
- 'a', true);
857 else if (c
>= '0' && c
<= '9')
858 talk_id(VOICE_ZERO
+ c
- '0', true);
860 talk_id(VOICE_MINUS
, true);
862 talk_id(VOICE_PLUS
, true);
864 talk_id(VOICE_DOT
, true);
866 talk_id(VOICE_PAUSE
, true);
872 void talk_disable(bool disable
)
875 talk_temp_disable_count
++;
877 talk_temp_disable_count
--;
880 void talk_setting(const void *global_settings_variable
)
882 const struct settings_list
*setting
;
883 if (!global_settings
.talk_menu
)
885 setting
= find_setting(global_settings_variable
, NULL
);
888 if (setting
->lang_id
)
889 talk_id(setting
->lang_id
,false);
894 void talk_date(struct tm
*tm
, bool enqueue
)
896 talk_id(LANG_MONTH_JANUARY
+ tm
->tm_mon
, enqueue
);
897 talk_number(tm
->tm_mday
, true);
898 talk_number(1900 + tm
->tm_year
, true);
901 void talk_time(struct tm
*tm
, bool enqueue
)
903 if (global_settings
.timeformat
== 1)
906 long am_pm_id
= VOICE_AM
;
907 int hour
= tm
->tm_hour
;
915 talk_number(hour
, enqueue
);
917 /* Voice the minutes */
920 /* Say o'clock if the minute is 0. */
921 talk_id(VOICE_OCLOCK
, true);
925 /* Pronounce the leading 0 */
927 talk_id(VOICE_OH
, true);
928 talk_number(tm
->tm_min
, true);
930 talk_id(am_pm_id
, true);
934 /* Voice the time in 24 hour format */
935 talk_number(tm
->tm_hour
, enqueue
);
938 talk_id(VOICE_HUNDRED
, true);
939 talk_id(VOICE_HOUR
, true);
943 /* Pronounce the leading 0 */
945 talk_id(VOICE_OH
, true);
946 talk_number(tm
->tm_min
, true);