summaryrefslogtreecommitdiff
path: root/tools/voicefont.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2007-08-05 19:19:39 +0000
committerNils Wallménius <nils@rockbox.org>2007-08-05 19:19:39 +0000
commitb3113674819cd8daf44750d129c5d8298e830df0 (patch)
treeebc7ec9e096e309ef79834802eed28ff9c22fd41 /tools/voicefont.c
parente70f7f4ca857e9e88a6e076360b6c9c235d7739b (diff)
downloadrockbox-b3113674819cd8daf44750d129c5d8298e830df0.tar.gz
rockbox-b3113674819cd8daf44750d129c5d8298e830df0.zip
*** Lang v2 cleanup (FS#6574) ***
1) Introduces apps/features.txt that controls which strings are included for each target based on defines. 2) .lng and .voice files are now target specific and the format versions of both these file types have been bumped, which means that new voice files are needed. 3) Use the 'features' mechanism to exclude strings for targets that didn't use them. 4) Delete unused and deprecated and duplicated strings, sort strings in english.lang Some string IDs were changed so translations will be slightly worse than before. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14198 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/voicefont.c')
-rw-r--r--tools/voicefont.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/tools/voicefont.c b/tools/voicefont.c
index 0a6d0a2121..a5e72af567 100644
--- a/tools/voicefont.c
+++ b/tools/voicefont.c
@@ -90,10 +90,10 @@ int main (int argc, char** argv)
90 if (argc < 2) 90 if (argc < 2)
91 { 91 {
92 printf("Makes a Rockbox voicefont from a collection of mp3 clips.\n"); 92 printf("Makes a Rockbox voicefont from a collection of mp3 clips.\n");
93 printf("Usage: voicefont <language file> <mp3 path> <output file>\n"); 93 printf("Usage: voicefont <string id list file> <target id> <mp3 path> <output file>\n");
94 printf("\n"); 94 printf("\n");
95 printf("Example: \n"); 95 printf("Example: \n");
96 printf("voicefont english.lang voice\\ voicefont.bin\n"); 96 printf("voicefont voicefontids.txt 2 voice\\ voicefont.bin\n");
97 return -1; 97 return -1;
98 } 98 }
99 99
@@ -123,10 +123,10 @@ int main (int argc, char** argv)
123 } 123 }
124 fclose(pFile); 124 fclose(pFile);
125 125
126 pFile = fopen(argv[3], "wb"); 126 pFile = fopen(argv[4], "wb");
127 if (pFile == NULL) 127 if (pFile == NULL)
128 { 128 {
129 printf("Error opening output file %s\n", argv[3]); 129 printf("Error opening output file %s\n", argv[4]);
130 return -2; 130 return -2;
131 } 131 }
132 fseek(pFile, 16 + count*8, SEEK_SET); /* space for header */ 132 fseek(pFile, 16 + count*8, SEEK_SET); /* space for header */
@@ -137,8 +137,8 @@ int main (int argc, char** argv)
137 count_voiceonly++; 137 count_voiceonly++;
138 138
139 pos[i] = ftell(pFile); 139 pos[i] = ftell(pFile);
140 sprintf(mp3filename1, "%s%s.mp3", argv[2], names[i]); 140 sprintf(mp3filename1, "%s%s.mp3", argv[3], names[i]);
141 sprintf(mp3filename2, "%s%s.wav.mp3", argv[2], names[i]); 141 sprintf(mp3filename2, "%s%s.wav.mp3", argv[3], names[i]);
142 mp3filename = mp3filename1; 142 mp3filename = mp3filename1;
143 pMp3File = fopen(mp3filename, "rb"); 143 pMp3File = fopen(mp3filename, "rb");
144 if (pMp3File == NULL) 144 if (pMp3File == NULL)
@@ -168,18 +168,23 @@ int main (int argc, char** argv)
168 /* Create the file format: */ 168 /* Create the file format: */
169 169
170 /* 1st 32 bit value in the file is the version number */ 170 /* 1st 32 bit value in the file is the version number */
171 value = SWAP4(200); /* 2.00 */ 171 value = SWAP4(300); /* 3.00 */
172 fwrite(&value, sizeof(value), 1, pFile); 172 fwrite(&value, sizeof(value), 1, pFile);
173 173
174 /* 2nd 32 bit value in the file is the header size (= 1st table position) */ 174 /* 2nd 32 bit value in the file is the id number for the target
175 value = SWAP4(16); /* 16 bytes: for version, header size, number1, number2 */ 175 we made the voce file for */
176 value = SWAP4(atoi(argv[2]));
176 fwrite(&value, sizeof(value), 1, pFile); 177 fwrite(&value, sizeof(value), 1, pFile);
177 178
178 /* 3rd 32 bit value in the file is the number of clips in 1st table */ 179 /* 3rd 32 bit value in the file is the header size (= 1st table position) */
180 value = SWAP4(20); /* 20 bytes: for version, target id, header size, number1, number2 */
181 fwrite(&value, sizeof(value), 1, pFile);
182
183 /* 4th 32 bit value in the file is the number of clips in 1st table */
179 value = SWAP4(count-count_voiceonly); 184 value = SWAP4(count-count_voiceonly);
180 fwrite(&value, sizeof(value), 1, pFile); 185 fwrite(&value, sizeof(value), 1, pFile);
181 186
182 /* 4th bit value in the file is the number of clips in 2nd table */ 187 /* 5th bit value in the file is the number of clips in 2nd table */
183 value = SWAP4(count_voiceonly); 188 value = SWAP4(count_voiceonly);
184 fwrite(&value, sizeof(value), 1, pFile); 189 fwrite(&value, sizeof(value), 1, pFile);
185 190