From b3113674819cd8daf44750d129c5d8298e830df0 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Sun, 5 Aug 2007 19:19:39 +0000 Subject: *** 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 --- tools/voicefont.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'tools/voicefont.c') 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) if (argc < 2) { printf("Makes a Rockbox voicefont from a collection of mp3 clips.\n"); - printf("Usage: voicefont \n"); + printf("Usage: voicefont \n"); printf("\n"); printf("Example: \n"); - printf("voicefont english.lang voice\\ voicefont.bin\n"); + printf("voicefont voicefontids.txt 2 voice\\ voicefont.bin\n"); return -1; } @@ -123,10 +123,10 @@ int main (int argc, char** argv) } fclose(pFile); - pFile = fopen(argv[3], "wb"); + pFile = fopen(argv[4], "wb"); if (pFile == NULL) { - printf("Error opening output file %s\n", argv[3]); + printf("Error opening output file %s\n", argv[4]); return -2; } fseek(pFile, 16 + count*8, SEEK_SET); /* space for header */ @@ -137,8 +137,8 @@ int main (int argc, char** argv) count_voiceonly++; pos[i] = ftell(pFile); - sprintf(mp3filename1, "%s%s.mp3", argv[2], names[i]); - sprintf(mp3filename2, "%s%s.wav.mp3", argv[2], names[i]); + sprintf(mp3filename1, "%s%s.mp3", argv[3], names[i]); + sprintf(mp3filename2, "%s%s.wav.mp3", argv[3], names[i]); mp3filename = mp3filename1; pMp3File = fopen(mp3filename, "rb"); if (pMp3File == NULL) @@ -168,18 +168,23 @@ int main (int argc, char** argv) /* Create the file format: */ /* 1st 32 bit value in the file is the version number */ - value = SWAP4(200); /* 2.00 */ + value = SWAP4(300); /* 3.00 */ fwrite(&value, sizeof(value), 1, pFile); - /* 2nd 32 bit value in the file is the header size (= 1st table position) */ - value = SWAP4(16); /* 16 bytes: for version, header size, number1, number2 */ + /* 2nd 32 bit value in the file is the id number for the target + we made the voce file for */ + value = SWAP4(atoi(argv[2])); fwrite(&value, sizeof(value), 1, pFile); - /* 3rd 32 bit value in the file is the number of clips in 1st table */ + /* 3rd 32 bit value in the file is the header size (= 1st table position) */ + value = SWAP4(20); /* 20 bytes: for version, target id, header size, number1, number2 */ + fwrite(&value, sizeof(value), 1, pFile); + + /* 4th 32 bit value in the file is the number of clips in 1st table */ value = SWAP4(count-count_voiceonly); fwrite(&value, sizeof(value), 1, pFile); - /* 4th bit value in the file is the number of clips in 2nd table */ + /* 5th bit value in the file is the number of clips in 2nd table */ value = SWAP4(count_voiceonly); fwrite(&value, sizeof(value), 1, pFile); -- cgit v1.2.3