summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-03-19 16:09:41 +0000
committerJens Arnold <amiconn@rockbox.org>2006-03-19 16:09:41 +0000
commitf383cc14bd7d1c567fb283af4b3af252a2a3f6c9 (patch)
treef849121b9acc90cbaa7da9731229f7d69c91f4ab /apps
parent2d767c5c112853a355dd6f13fd808bd1666042ee (diff)
downloadrockbox-f383cc14bd7d1c567fb283af4b3af252a2a3f6c9.tar.gz
rockbox-f383cc14bd7d1c567fb283af4b3af252a2a3f6c9.zip
Voice working on the iPods.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9119 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/talk.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/apps/talk.c b/apps/talk.c
index c7e2e035fd..bb074a5254 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -130,20 +130,6 @@ int talk_get_bufsize(void)
130 return voicefile_size; 130 return voicefile_size;
131} 131}
132 132
133#ifdef SIMULATOR
134static unsigned short BSWAP16(unsigned short value)
135{
136 return (value >> 8) | (value << 8);
137}
138
139static unsigned long BSWAP32(unsigned long value)
140{
141 unsigned long hi = BSWAP16(value >> 16);
142 unsigned long lo = BSWAP16(value & 0xffff);
143 return (lo << 16) | hi;
144}
145#endif
146
147/* load the voice file into the mp3 buffer */ 133/* load the voice file into the mp3 buffer */
148static void load_voicefile(void) 134static void load_voicefile(void)
149{ 135{
@@ -173,13 +159,13 @@ static void load_voicefile(void)
173 if (got_size != load_size /* failure */) 159 if (got_size != load_size /* failure */)
174 goto load_err; 160 goto load_err;
175 161
176#ifdef SIMULATOR 162#ifdef ROCKBOX_LITTLE_ENDIAN
177 logf("Byte swapping voice file"); 163 logf("Byte swapping voice file");
178 p_voicefile = (struct voicefile*)audiobuf; 164 p_voicefile = (struct voicefile*)audiobuf;
179 p_voicefile->version = BSWAP32(p_voicefile->version); 165 p_voicefile->version = swap32(p_voicefile->version);
180 p_voicefile->table = BSWAP32(p_voicefile->table); 166 p_voicefile->table = swap32(p_voicefile->table);
181 p_voicefile->id1_max = BSWAP32(p_voicefile->id1_max); 167 p_voicefile->id1_max = swap32(p_voicefile->id1_max);
182 p_voicefile->id2_max = BSWAP32(p_voicefile->id2_max); 168 p_voicefile->id2_max = swap32(p_voicefile->id2_max);
183 p_voicefile = NULL; 169 p_voicefile = NULL;
184#endif 170#endif
185 171
@@ -196,13 +182,13 @@ static void load_voicefile(void)
196 else 182 else
197 goto load_err; 183 goto load_err;
198 184
199#ifdef SIMULATOR 185#ifdef ROCKBOX_LITTLE_ENDIAN
200 for (i = 0; i < p_voicefile->id1_max + p_voicefile->id2_max; i++) 186 for (i = 0; i < p_voicefile->id1_max + p_voicefile->id2_max; i++)
201 { 187 {
202 struct clip_entry *ce; 188 struct clip_entry *ce;
203 ce = &p_voicefile->index[i]; 189 ce = &p_voicefile->index[i];
204 ce->offset = BSWAP32(ce->offset); 190 ce->offset = swap32(ce->offset);
205 ce->size = BSWAP32(ce->size); 191 ce->size = swap32(ce->size);
206 } 192 }
207#endif 193#endif
208 194
@@ -691,8 +677,6 @@ int talk_value(long n, int unit, bool enqueue)
691 VOICE_KHZ, 677 VOICE_KHZ,
692 VOICE_DB, 678 VOICE_DB,
693 VOICE_PERCENT, 679 VOICE_PERCENT,
694 VOICE_MEGABYTE,
695 VOICE_GIGABYTE,
696 VOICE_MILLIAMPHOURS, 680 VOICE_MILLIAMPHOURS,
697 VOICE_PIXEL, 681 VOICE_PIXEL,
698 VOICE_PER_SEC, 682 VOICE_PER_SEC,