Kyocera 6035 (The PDA Smartphone) - File Format This file should help explain how to make ringtones for the Kyocera 6035 (and maybe other PDA phones). This file is mostly an edited version of a file called pdb.txt that I found on the net. Basically this phone takes a PDB file (Palm Database) with a .wav file attached to it. So the total file format in the end will have these 4 sections: --------------------------- | PDB HEADER | --------------------------- | RECORD HEADERS | --------------------------- | SOUND FILE HEADER | --------------------------- | UNCOMPRESSED SOUND DATA | --------------------------- -------------------------------------------------------------- IMPORTANT: char = 1 byte Word = 2 bytes DWord = 4 bytes All data in this format is stored in BIG ENDIAN (also called Motorola) format. -------------------------------------------------------------- PDB HEADER So first, here is the PDB header and the things you need to fill in here to make sure your PDB file is recognized as a ringtone: #define dmDBNameLength 32/* 31 chars + 1 null terminator */ struct pdb_header /* 78 bytes total */ { char name[ dmDBNameLength ]; /* Put the name of the ringtone here */ DWord attributes; /* Put 0x18 */ Word version; /* Put 0x01 */ DWord create_time; /* Put the current time using time(NULL); */ DWord modify_time; /* Put the current time using time(NULL); */ DWord backup_time; /* Put 0x00 */ DWord modificationNumber; /* Put 0x00 */ DWord appInfoID; /* Put 0x00 */ DWord sortInfoID; /* Put 0x00 */ char type[4]; /* Put "ring" */ char creator[4]; /* Put "QCBA" */ DWord id_seed; /* Put 0x00 */ DWord nextRecordList; /* Put 0x00 */ Word numRecords; /* Read below for an explaination */ }; For numRecords, here's how you calculate it. PDB file records can't be more than 64k in size, so you need to divide the PDB data section into records. To calculate how many records you need, simply take the length of the data you want to write and divide it by how big you want each record to be. Note that for Kyocera ringtones there is an extra 12 bytes added to the beginning of the first record, so take the length of WAV file data (do NOT include any of the WAV file headers) and add 12. For example: If you have a .WAV file that is 2500 bytes in size. You take 2500 and subtract the size of the WAV headers (which should be 44 bytes I believe). Take this number and add 12. This is the total size of the data section for your PDB file. Take that and divide it by how big you want your records to be (maximum of 64k in size each). -------------------------------------------------------------- RECORD HEADERS For every record you have, you need 1 record header that points to where that record starts in the file. struct pdb_rec_header /* 8 bytes total */ { DWord offset; /* Set this to the start of the record */ char attributes; /* Put 0x00 */ char uniqueID[3]; /* Put 0x00,0x00,0x00 */ } -------------------------------------------------------------- WAVE DATA Before you can actually write the WAV data you have to write out 5 things: DWord unknown1; /* Put 0x00 */ Word records; /* Put number of records - 1 .. if you have 4 recs put 3 */ Word unknown2; /* Put 0x00 */ Word sample_freq; /* Put the sampling freq of the WAV */ WAVS can be 11025Hz or I think 16000Hz. They must be 8 bit mono. Now simply write out all the WAV data. That's all :)