diff options
-rw-r--r-- | apps/talk.c | 19 | ||||
-rw-r--r-- | tools/voicefont.c | 14 |
2 files changed, 12 insertions, 21 deletions
diff --git a/apps/talk.c b/apps/talk.c index e1bf6cbc5c..f1158794e8 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -220,25 +220,6 @@ static void load_voicefile(void) | |||
220 | structec_convert(&p_voicefile->index[i], "ll", 1, true); | 220 | structec_convert(&p_voicefile->index[i], "ll", 1, true); |
221 | #endif | 221 | #endif |
222 | 222 | ||
223 | /* Do a bitswap as necessary. */ | ||
224 | #if CONFIG_CODEC == SWCODEC | ||
225 | logf("Bitswapping voice file."); | ||
226 | cpu_boost(true); | ||
227 | buf = (unsigned char *)(&p_voicefile->index) + | ||
228 | (p_voicefile->id1_max + p_voicefile->id2_max) * sizeof(struct clip_entry); | ||
229 | length = file_size - (buf - (unsigned char *) p_voicefile); | ||
230 | |||
231 | for (i = 0; i < length; i++) | ||
232 | { | ||
233 | temp = buf[i]; | ||
234 | temp = ((temp >> 4) & 0x0f) | ((temp & 0x0f) << 4); | ||
235 | temp = ((temp >> 2) & 0x33) | ((temp & 0x33) << 2); | ||
236 | buf[i] = ((temp >> 1) & 0x55) | ((temp & 0x55) << 1); | ||
237 | } | ||
238 | cpu_boost(false); | ||
239 | |||
240 | #endif | ||
241 | |||
242 | #ifdef HAVE_MMC | 223 | #ifdef HAVE_MMC |
243 | /* load the index table, now that we know its size from the header */ | 224 | /* load the index table, now that we know its size from the header */ |
244 | load_size = (p_voicefile->id1_max + p_voicefile->id2_max) | 225 | load_size = (p_voicefile->id1_max + p_voicefile->id2_max) |
diff --git a/tools/voicefont.c b/tools/voicefont.c index a5e72af567..94f8252e6e 100644 --- a/tools/voicefont.c +++ b/tools/voicefont.c | |||
@@ -85,6 +85,8 @@ int main (int argc, char** argv) | |||
85 | char mp3filename2[1024]; | 85 | char mp3filename2[1024]; |
86 | char* mp3filename; | 86 | char* mp3filename; |
87 | FILE* pMp3File; | 87 | FILE* pMp3File; |
88 | int target_id; | ||
89 | int do_bitswap_audio = 0; | ||
88 | 90 | ||
89 | 91 | ||
90 | if (argc < 2) | 92 | if (argc < 2) |
@@ -103,7 +105,14 @@ int main (int argc, char** argv) | |||
103 | printf("Error opening language file %s\n", argv[1]); | 105 | printf("Error opening language file %s\n", argv[1]); |
104 | return -2; | 106 | return -2; |
105 | } | 107 | } |
106 | 108 | ||
109 | /* We bitswap the voice file only SH based archos players, target IDs | ||
110 | equal to or lower than 8. See the target_id line for each target in | ||
111 | configure */ | ||
112 | target_id = atoi(argv[2]); | ||
113 | if (target_id <= 8) | ||
114 | do_bitswap_audio = 1; | ||
115 | |||
107 | memset(voiceonly, 0, sizeof(voiceonly)); | 116 | memset(voiceonly, 0, sizeof(voiceonly)); |
108 | while (!feof(pFile)) | 117 | while (!feof(pFile)) |
109 | { | 118 | { |
@@ -156,7 +165,8 @@ int main (int argc, char** argv) | |||
156 | 165 | ||
157 | size[i] = fread(buffer, 1, sizeof(buffer), pMp3File); | 166 | size[i] = fread(buffer, 1, sizeof(buffer), pMp3File); |
158 | fclose(pMp3File); | 167 | fclose(pMp3File); |
159 | BitswapAudio(buffer, buffer, size[i]); | 168 | if (do_bitswap_audio) |
169 | BitswapAudio(buffer, buffer, size[i]); | ||
160 | fwrite(buffer, 1, size[i], pFile); | 170 | fwrite(buffer, 1, size[i], pFile); |
161 | 171 | ||
162 | printf("%d %s %d\n", i, names[i], size[i]); /* debug */ | 172 | printf("%d %s %d\n", i, names[i], size[i]); /* debug */ |