Parlogio 1.6 DETAILED DESCRIPTION OF Parlogio??.txt, Parlogio??.wav, Parlogio??.par, Parlogio??.pdb FILES You need to read this document only if you wish to create your own language/voice file To create your language file you need a bit of patience and a simple audio editing capability, you have to do it in your PC with an audio editor like Audacity or similar. Step by step: 1) Register an audio file Parlogio??.wav (e.g. Parlogio01.wav, where 01 is the file index) with the basic words needed to speech data and time. For example for Italian I registered few ten words: zero,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fifteen,sixteen, seventeen,eighteen,nineteen,twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety,sunday,monday,tuesday, wednesday,thurday,friday,saturday,genuary,february,march,april,may,june,july,august,september,october, november,dicember,is,midnight,one,noon,it's,of,twothousand,first,and I didn't register "second,third,fourth,etc." because in Italian we do not need them They are only the basic sounds; composed words like twentythree will be created joining twenty and three, so, no need to register them, in some language it could be necessary to register two versions of a word for example the Spanish twenty (veinte, veinti). 2) Write Parlogio??.txt. Here you put the rules for time and data, and a list of all simple and composed words Fill the prepared, empty one you find in the .zip 3) Copy them in the expansion card root directory 4) From Parlogio Configuration menu set the file index ?? (e.g. 01) and test the files from Create menu 5) Press Create Parlogio??.par button Follows the detailes on how to do that, it's easier to do than to describe, try it. Email me if you find problems or you want to share with other people your experience, your language rules, etc. ------------------------------------------------------------ Parlogio??.wav Here you register all the basic sounds to speak, well glued together, without not useful silent samples between words. You must take note where any sound starts and how long lasts, that's needed to build the "Sound samples indexes array". You don't need to register the sounds in a particular order, you will order them later in the "Sound samples indexes array". e.g.: the record could sounds like zeroonetwotreefour..twentythirtyforty..mondaytuesday..genuary..decemberitstwo thousandmidnightpastto You should register only the minimum set of sounds, no need to register fiftysecond, for it you will use "fifty" and "second", in this way Parlogio.wav will be very compact without loss in sound quality. Try to keep the file below 300 Kbytes; at any rate it isn't a limit, you can have bigger files Step by step: 1) write a note file on a text editor with all the words you think may be useful to pronunce the time, remove composed ones. 2) record the words with your audio editor 3) remove the useless silence samples between words to reduce the file size to the minimum 4) normalize the volume of all the word to the top 5) write on the note file the samples where any word begin and how long it last (if you write the samples begin in a spreadsheet you can compute the lenght easy as difference from the next one) The file format is a canonical WAVE 8 bits/Sample, 8000 Samples/second, PCM uncompressed audio file. Note: when you sync from your PC a .wav file usually it is copied in the Audio directory, you have to move it in the root of your expansion card or you can specify the root directory as target from Parlogio Configuration. ------------------------------------------------------------ Parlogio??.txt: Parlogio use this text file written by you and an audio file registered by you (Parlogio??.wav) to create Parlogio??.par, the file that it uses to speak. Parlogio??.txt and Parlogio.wav are needed only if you wish to build your own Parlogio??.par, after that they can be removed from the palm. Remember to backup all files. See the Italian example files too, you can download it from my web site. I've included a preformatted Parlogio??.txt with empty default values; start from it, don't add/delete lines, just replace zeros with your values. Parlogio does a lot of formal checks on Parlogio??.txt and advice you on what's wrong but not all possible errors can be found so keep attention when you write it. Use a text editor and save it as plain ascii text. Parlogio??.txt is composed of: * 1 text description of the file * 20 time definitions rules that specify how time is spoken * 10 date definitions rules that specify how date is spoken * 1 data/time start indexes list that specify where starts in the "sound samples Index array" the speeking samples for months, days, etc. (it will be more clear later) * 180 sound samples indexes that store the starting and duration of sounds; you can stick two sounds together to build a composed word, e.g. "thirtytwo" Note: all lines may end with a remark in the form # your remark [x..y] means one number from x to y included (...) is a remark of mine Step by step: 1) Write on a text editor the rules used by your language to speak time and data 2) Traslate them in the Parlogio Rule syntax 3) Use the note you wrote for Parlogio??.wav to build the "sound samples array" 4) write the "start indexes list" 5) copy Parlogio??.wav and Parlogio??.txt on the palm expansion card 6) test your files from Parlogio Create menu and adjust what doesn't satisfy you 7) press Create Parlogio??.par Note: when you sync from your PC a .txt file usually you got an error due a Palm limit; you can specify the root directory as target from Parlogio Configuration before sync or copy it in other ways. ------------------------------------------------------------ Rules: to describe what Parlogio must say you define a sequence of characters, any of them represent something to say; for example if you want it says the current month the Rule is a simple M, to say the month followed by the day the Rule is MD, and so on you can build the sequence of characters that depict the Rule to say something. a Rule is composed of 1 to 40 elements choosen from: Y (uppercase) for year, M (uppercase) for month, D (uppercase) for day, W (uppercase) for week day, h (lowercase) for hour, n (lowercase) for next hour, (used for example to say 7:45 as "a quarter to 8") m (lowercase) for minute, s (lowercase) for second, I (uppercase) plus [1..180] to say a registered sound specified by its index (counts 2 elements), P (uppercase) plus [1..8000] to pause the specified amount of sound samples (counts 3 elements) p (lowercase) plus [1..250] to pause the specified amount of milliseconds (counts 2 elements) e.g.: I43WP1000DMI12Y means: "sound43 weekday pause_1000_samples day month sound12 year" e.g.: "it's monday (pause 0.125 sec) 23 march twothousand four" (total count 11 elements) As general rule for rules: avoid to use long pauses, put specific rules before general ones because the first that match is the used one Here is what you must put inside Parlogio??.txt (contemporarery follow the Italian Parlogio00.txt example): ------------------------------------------------------------ Parlogio??.txt format: ---------- One Description: A textual description of your file D,your description (60 characters max) e.g.: D,Latin version 1.0 by Giulio Cesare ---------- 20 Time definitions: you specify the interval of time the rule is valid and what to say using that rule T, index [1..20], start hour [0..23 or 255], start minute [0..59 or 255], start second [0..59 or 255], end hour [0..23 or 255], end minute [0..59 or 255], end second [0..59 or 255], rule (40 values max) 255 means no matter, every value admitted hours, minutes and seconds are three indipendent ranges, so if you write: T,1,1,0,255,11,0,255,YOUR_RULE (where YOUR_RULE is a rule string as described before) i.e. start hour 1 start minute 0 start second 255 end hour 11 end minute 0 end second 255 it means any hour from 1 to 11, exactly 0 minute and any second apply the rule; the rule is applied at 01:00, 02:00, 03:00, 04:00, 05:00, 06:00, 07:00, 08:00, 09:00, 10:00, 11:00 no matter seconds; can be used to say "it's X o'clock a.m." without taking in account seconds if you write: T,1,1,1,255,11,29,255,YOUR_RULE start hour 1 start minute 1 start second 255 end hour 11 end minute 29 end second 255 it means any hour from 1 to 11, minute from 1 to 29 and any second apply the Rule; the rule is applied at 01:01 ... 1:29, 2:01 et cetera till 11:29 no matter seconds if you write: T,1,1,15,255,11,15,255,YOUR_RULE start hour 1 start minute 15 start second 255 end hour 11 end minute 15 end second 255 it means any hour from 1 to 11, exactly 15 minutes, no matter seconds apply the rule; could be user to say "it's a quarter past X a.m." T,?,0,0,0,0,0,0,0 is considered an empty rule and mark the end of rules too (where ? is a number from 1 to 20; don't use '?', put a number) e.g.: T,1,0,0,255,0,0,255,I30I31 first rule, at midnight you say "frase30 frase31" e.g. "it's midnight" e.g.: T,2,1,0,255,11,0,255,I30hI33 second rule, from 1 o'clock to 11 o'clock you say "frase30 hour frase33" e.g. "it's 9 o'clock" ---------- 10 Date definitions: you specify the interval of date the rule is valid and what to say using that rule A, index [1..10], start day [1..31 or 255], start month [1..12 or 255], start week day [1..7 or 255], end day [1..31 or 255], end month [1..12 or 255], end week day [1..7 or 255], rule (40 values max) 255 means no matter, every in range value admitted day, month and weekday are three indipendent ranges, so if you write: A,1,255,255,2,255,255,6,rule start day 255 start month 255 start weekday 2 end day 255 end month 255 end weekday 6 it means any day, any month, weekday from Monday to Friday apply the Rule (note: weekday=1 means Sunday, 2 means Monday, etc., 7 means Saturday) A,?,0,0,0,0,0,0,0 is considered an empty rule and mark the end of rules too (where ? is a number from 1 to 10) e.g.: A,1,255,255,255,255,255,255,WI1MI2DI40Y first rule, no matter what day it is, say "weekday soundsampleindex1 month soundsampleindex2 day soundsampleindex40 year" e.g. "monday of febrary the second twothousand four" ---------- 1 Data/Time Base indexes: B, index of year in the century [1..180], month [1..180], day [1..180], weekday [1..180], hour [1..180], minute [1..180], second [1..180] The base index is the start index, in the "Sound samples indexes array" described below, where that kind of sounds group starts e.g. months are described in twelve consecutive Sound sample indexes starting at, for example, index 100 in the "Sound samples indexes array" The ordinal numbers that describes the seconds are used for the countup/down function too, so should be better to describe the numbers from 0 to 99 indeed of 0 to 59 only e.g.: B,10,110,10,160,10,10,10 where ten is the start index for ordinals used for year day hour minute and second, 110 is the start index for months and 160 is that one for weekdays (in Italian we use cardinal numbers to say days not ordinals except the first) ---------- 180 Sound samples indexes: S, Index [1..180], offset1 [0..16000000], lenght1 [0..64000], pause [0..8000], offset2 [0..16000000], lenght2 [0..64000] With the values in this array you can describe: a sound a sound followed by a pause a sound followed by a second sound a sound followed by a pause followed by a second sound The offset is the sound record start sample offset, in the Parlogio??.wav file (just the sound offset you see in the audio editor expressed in samples, don't worry about the header of the file) The lenght is the sound duration in samples. The pause is expressed in samples (so at 8000 S/s if you write 400 it means 400/8000=0.05 seconds) To determine the best pause to use in a composite word like, for example, fortytwo you can register 42 in your sound editor and misure the real pause between 4 and 2, usually the pause is zero. For future compatibility I suggest to use even numbers for offset, lenght and pause You are free to decide how to organize the array; for example describe 60 or 100 cardinal numbers first (must start from zero), describe months names, describe week days, describe 31 ordinal numbers if required by your language, describe general frases. It isn't necessary to follow the order of words you registered in the Parlogio??.wav file. There are much more entries in this array than sounds in Parlogio??.wav due the composed words. If you forgot something you can simply register it at the end later. You will describe where everything starts in the "Data/Time Base indexes". e.g.: S,7,92342,8548,0,0,0 one sound, no following pause, e.g. "midnight" e.g.: S,4,52348,7362,800,0,0 one sound + pause, e.g. "it's" + small pause e.g.: S,3,12346,4322,234,51234,3670 the sample sound indexed 3 starts at 12346 and last 4322 samples, is followed by a pause of 234 samples and the sample starting at 51234 long 3670 samples, e.g. "twentyfirst" (twenty + first) or "ventuno" (venti + uno) ------------------------------------------------------------ Parlogio??.par, Parlogio??.pdb Parlogio??.par is a binary file in a format usable in any file system like the one in the palm expansion card or in your PC hard disk Parlogio??.pdb is its equivalent for the internal RAM in the proprietary PalmOS stream format It's a binary file generated by Parlogio directly from your palm that combines Parlogio??.txt and Parlogio??.wav It's the language file needed by Parlogio to speak Parlogio??.par is created in the /PALM/Launcher directory, the same where Parlogio search it to speak. From version 1.1 you can copy/transform the language file from the Card to the RAM and vice versa using the (RAM->Card) (Card->RAM) buttons of Parlogio Configuration If you transfer Parlogio??.par from your PC to the card using the sync function, you will get an error due a palm limit; use the Parlogio Configuration to associate the .par extension to the /PALM/Launcher directory. Naturally you can copy it in other ways as any file. Enjoy your new speaking clock, Rod ------------------------------------------------------------ Appendix A: Just for curiosity, here is the wave file format 8bit, 8000S/s, uncompressed PCM; you don't need to understand what it means, it's just an exadecimal binary format. Offset Length Contents 0 4 bytes 'RIFF' 4 4 bytes 8 4 bytes 'WAVE' 12 4 bytes 'fmt ' 16 4 bytes 0x00000010 20 2 bytes 0x0001 22 2 bytes 0x0001 24 4 bytes 0x00001F40 28 4 bytes 0x00001F40 32 2 bytes 0x0001 34 2 bytes 0x0008 36 4 bytes 'data' 40 4 bytes 44 any audio data block, where 0 is the negative peak, 0x80 is the silent zero, 0xFF is the positive peak ------------------------------ http://ausilio.altervista.org/ ------------------------------ Document version 1.6.1