Customizing Rom Sound Theme's for Chefs - Tutorial



About this tutorial:
-=-=-=- -=-=-=- -=-=-=- =-=-=- -=-=-=-
This tutorial will show you how to customize the Sound Theme for your rom.  Whether you want a SouthPark, StarWars, Diamond theme, this is for you.
This will work for PPCKitchen.org's Kitchen, DogGuys Kitchen, DCD's Kitchen and most others. This tutorial is for Windows Mobile 6.xx. 

Additional Notes:
- A copy of this file is attached inside zzz_My_Sounds_OEM.
- In post #4 I have included additional information that may be helpfull immediately following this tutorial.

This tutorial ASSUMES you have working knowledge of cooking your own rom, and general Windows knowledge. I AM NOT RESPONSIBLE FOR ANYTHING THAT HAPPENS TO YOU OR YOUR DEVICE by reading this tutorial! This tutorial should work with most windows-mobile based kitchens, Apache, Titan, Vogue and others. Feel free to post your questions/comments.


Credits:
-=-=-=- -=-=-=- -=-=-=- =-=-=- -=-=-=-
1. I would like to thank PPCGeeks.com and all the members. 
2. All those that have contributed to developing and making all the kitchens possible! You all know who they (you) are!
3. Weedahoe, I borrowed his scripting information from his "The most COMPLETE compilation of hacks and tweaks"  http://forum.ppcgeeks.com/showthread.php?t=11799


Terminology used in this tutorial:
-=-=-=- -=-=-=- -=-=-=- =-=-=- -=-=-=-
OEM - Similar to a .CAB file, this is the method used to add files/programs to a cooked Rom. This is copied to USER_OEM if using the ppckitchen, or into your OEM folder if you are using another kitchen.
INITFLASHFILES.TXT - This is the text file you will edit to copy your files on your device from \windows to \whereever.
GUID - GUID (or UUID) is an acronym for 'Globally Unique Identifier'. It is a 128-bit integer number used to identify resources. 
Scripts - Combination of commands WM6.x uses to determine how to handle select system sounds/alerts.


The Tools/Files you will need:
-=-=-=- -=-=-=- =-=-=- -=-=-=- -=-=-=-
- PPCKitchen.org BuildOS.msi fully installed and ready to go...
- ...or...Your favorite Kitchen.
- Notepad.exe (Text editor that comes with windows, or any other text editor)
- Old fashioned pen and paper or printer.


The steps involved:
-=-=-=- -=-=-=- =-=-=- -=-=-=- -=-=-=-
This tutorial will allow you to customize the sounds on your device via your choice of rom kitchen.  I will show you how to add files to the attached zzz_My_Sounds_OEM, edit the initflashfiles.txt file that will copy your files to where you want 'em, and then edit the registry settings in the *.rgu file to make them 'stick'.

1. Install the necessary files.
2. Plan your Sound Scheme.
3. Locate and Rename target sound files.
4. Edit your initfiles.txt from zzz_My_Sounds_OEM
5. Edit the *.rgu from zzz_My_Sounds_OEM
6. Build & Flash!
7. Test your sound placement, repeat if necessary!

And here is the zzz_My_Sounds_OEM that you will need...


***Begin Post#2
*************************************************************************

1. Install the necessary files.
-=-=-=- -=-=-=- =-=-=- -=-=-=- -=-=-=-
a. You should already have a kitchen installed.  If not, bookmark this tutorial and return when you are ready.
b. Download the zzz_My_Sounds_OEM, unzip it and copy it to PPCKitchens USER_OEM folder, or to your Kitchens ..\OEM folder.
d. Old fashioned pen and paper or print the *.rgu file for planning your Sound Scheme.

Let's take a quick look inside the zzz_My_Sounds_OEM:
initflashfiles.txt - Moves your sounds where you want them.
*.rgu - Contains your registry edits for sounds.
*.mp3 - MP3 Sounds.
*.mm  - MP3 Sounds.  I'll explain the *.mm later...
*.wav - CHEF ADDED
*.mid - CHEF ADDED

Anything not listed above is necessary for the OEM to function in your kitchen.  And we will not mess with those.


2. Plan your Sound Scheme
-=-=-=- -=-=-=- =-=-=- -=-=-=- -=-=-=-
Now let's talk about the preparing and designing your sound scheme.  
The absolute easiest way to do this is to:
a. Open the *.RGU file and print it.  I have commented the entries well.  
b. Locate your sound files you want for the different entries and notate it on the printout.

You may use your method, I did this originally by opening up CERegEditor and simply exported the \HKEY_Current_User\ControlPanel\Notification key and cut&pasted it into the *.rgu file. (After I had all my sounds set the way I wanted them.) You can also free up some space on your device by deleting the "System Ringers" as long as you have all your sounds/notifications covered!


3. Locate and Rename target sound files.
-=-=-=- -=-=-=- =-=-=- -=-=-=- -=-=-=-
Now you have all your sound files located, copy them into the zzz_My_Sounds_OEM folder so that they will be cooked into your rom.  
***Note: Any sounds already included in your rom DO NOT need to be copied here.  Leave them alone to avoid duplicate files so your kitchen won't puke!

Rename?  Yes, I rename my ringers and certain other files I want in the "\My Documents" folder.  This is for compatability and other reasons.  I rename my ringer "bennyhill.mp3" to "bennyhill.mm". 
Why?    All the files get cooked into "\Windows", so I rename certain files so it will only show up one time in my ringer. You could bypass the renaming and the below initflashfiles.txt thing if you want, your choice!  Just be sure to get the correct directory settings in the *.rgu file registry settings.


4. Edit your initflashfiles.txt from zzz_My_Sounds_OEM
-=-=-=- -=-=-=- =-=-=- -=-=-=- -=-=-=-
First let's take a look at the base INITFLASHFILES.TXT file we will be starting with:

Code:
[CODE}
;My initflashfiles.txt
;zzz_My_Sounds_OEM

Directory("\My Documents"):-File("BennyHill.mp3","\windows\000-BennyHill.mm")

Directory("\My Documents"):-File("txtmsgbos.mp3","\windows\txtmsgbos.mm")
[/CODE}

As you see above, there is only one type of command we are interested in, the copy command:
Directory("destination_directory"):-File("destination_filename","source_path+filename" )

In the above example, the two entries copy your sound files from their cooked location in \windows to your \My Documents folder. In the example above I have moved two sound files that I usually place in that directory.  Use the cut&paste method to "copy" your additional sound files into the \My Documents folder or leave them in \Windows.  You may also use the comment line to either make notes to yourself, or to comment out a file copy operation.

Tip: To keep it simple I use the \Windows directory for notifications, and I only use the \My Documents folder for my Ringer and text notification sounds.  In post 4, I will elaborate on locations and sound types for the notifications.


***Begin Post#3
*************************************************************************


5. Edit the *.rgu from zzz_My_Sounds_OEM
-=-=-=- -=-=-=- =-=-=- -=-=-=- -=-=-=-
This file contains the registry settings that will apply your sound settings.  Let's take a look inside.
[CODE]
REGEDIT4

;<<<<<----- Ringer ----->>>>>
;=============================================================
[HKEY_CURRENT_USER\ControlPanel\Sounds\RingTone0]
"Sound"="\\My Documents\\bennyhill.mp3"
"Script"="apw3r"

;<<<<<----- Notifications ----->>>>>
;=============================================================
[HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D658-239C-47a7-9304-0D347F580408}]
Default="ActiveSync: Begin sync"
"Wave"="\\Windows\\ASConnect.mp3"
"Options"=dword:00000001
"Duration"=dword:00000000
"AvailableOptions"=dword:00000003

[HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D659-239C-47a7-9304-0D347F580408}]
Default="ActiveSync: End sync"
"Wave"="\\Windows\\ASDisconnect.mp3"
"Options"=dword:00000001
"Duration"=dword:00000000
"AvailableOptions"=dword:00000003

[HKEY_CURRENT_USER\ControlPanel\Notifications\{F55615D6-D29E-4db8-8C75-98125D1A7253}]
Default="Beam: Autoreceive"
"Wave"="\\Windows\\Loudest.wav"
"Options"=dword:00000001
"Duration"=dword:00000000

[HKEY_CURRENT_USER\ControlPanel\Notifications\{8ddf46e8-56ed-4750-9e58-afc6ce486d03}]
Default="Connection disconnected"
"Wave"="Alarm1.wma"
"Duration"=dword:00000000
"AvailableOptions"=dword:00000003
"Options"=dword:00000000

[HKEY_CURRENT_USER\ControlPanel\Notifications\{8ddf46e7-56ed-4750-9e58-afc6ce486d03}]
Default="Connection established"
"Wave"="Alarm1.wma"
"Duration"=dword:00000000
"AvailableOptions"=dword:0000000B
"Options"=dword:00000008

[HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D660-239C-47a7-9304-0D347F580408}]
Default="Phone: Missed call"
"Wave"="\\Windows\\Alarm1.wma"
"Options"=dword:00000001
"Duration"=dword:0000000F

[HKEY_CURRENT_USER\ControlPanel\Notifications\{15F11F90-8A5F-454c-89FC-BA9B7AAB0CAD}]
Default="Reminders"
"Options"=dword:00000001
"Wave"="\\Windows\\Alarm1.wma"
"Duration"=dword:0000000A

[HKEY_CURRENT_USER\ControlPanel\Notifications\{DDBD3B44-80B0-4b24-9DC4-839FEA6E559E}]
Default="Wireless network detected"
"Options"=dword:00000001
"Wave"="\\Windows\\Default.wav"
"Duration"=dword:00000000

[HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D661-239C-47a7-9304-0D347F580408}]
Default="Phone: Voice mail"
"Wave"="\\Windows\\Alarm1.wma"
"Options"=dword:00000001
"Duration"=dword:0000000F

[HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D65A-239C-47a7-9304-0D347F580408}]
Default="Messaging: New e-mail message"
"Wave"="\\Windows\\newemail.mp3"
"Options"=dword:00000001
"Duration"=dword:00000000

[HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D65B-239C-47a7-9304-0D347F580408}]
Default="Messaging: New text message"
"Wave"="\\My Documents\\txtmsgbos.mp3"
"Options"=dword:00000001
"Duration"=dword:00000000

[HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D663-239C-47a7-9304-0D347F580408}]
"Default"="Low Battery 10%"
"Wave"="lowbattery.mp3"
"Duration"=dword:00000000
"Options"=dword:00000009

; Unknown sounds placed at end
;===================================================================================
; Unknown Sound
[HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D65D-239C-47a7-9304-0D347F580408}]
"Wave"="online.wma"
"Duration"=dword:00000003
"Options"=dword:0000000D

; Unknown Sound
[HKEY_CURRENT_USER\ControlPanel\Notifications\{B67B425B-365E-42c0-95F7-B75503D775B8}]
"Duration"=dword:00000000
"Options"=dword:00000008

; Unknown Sound
[HKEY_CURRENT_USER\ControlPanel\Notifications\{0D3132C4-1298-469c-B2B8-F28CE2D649D0}]
"Wave"="Alarm1.wma"
"Duration"=dword:00000000
"Options"=dword:00000009

; Unknown Sound
[HKEY_CURRENT_USER\ControlPanel\Notifications\{C3465585-39EF-4c9b-B2A3-5558BF27BFB0}]
"Options"=dword:00000001

; Unknown Sound
[HKEY_CURRENT_USER\ControlPanel\Notifications\{E0F2B9DD-EDC6-45d4-B440-2C5B5A04A3E3}]
"Options"=dword:00000008

;Misc Sounds Controlled by "Scripts"
;=================================================================
;disable sounds when initiating/ending a call         ;add a "p" to re-enable
[HKCU\ControlPanel\Sounds\Dialing]
Script=""
[HKCU\ControlPanel\Sounds\Ending]
Script=""

;disable vol up/down beeps during call
[HKCU\ControlPanel\Sounds\LoudestInCallVolume]
Script=""
[HKCU\ControlPanel\Sounds\QuietestInCallVolume]
Script=""
[HKCU\ControlPanel\Sounds\StandardInCallVolume]
Script=""

[/CODE]

My Notes on Notifications:
There are 3 main values in each of the notifications:
Default = the name of your sound as it appears in System -> Personal -> Sounds.
Wave = Then path and name of the sound. (notice double slashes!)
Options = Options for your sounds. They include Ring, Vibrate, Flash LED, and Display Message.

Here are the usual settings for "Options":
Options are set by toggling bits within the dword value;
0001 = ring...................1 decimal
0010 = vibrate................2 decimal
0100 = flash led..............4 decimal
1000 = display message........8 decimal

So in binary 0000-1111 would have your phone ring, vibrate, flash the led, and display a message. I have also included the decimal values as well for those not familiar with binary.  
**NOTE: The registry settings in the rgu file are in HEXADECIMAL!  Check Post #4 for possible combinations if you don't have a converter!

My Notes on Ringers:
The main value here is:
Sound = Path and name of ringer
Script = How to handle the ringer. Default is "apw3r" which does the following three actions:
    a = activate device
    p = play ringtone
    w3 = wait 3 seconds
    r = repeat  (See more about scripts in post #4)

My Notes on Misc Sounds:
These are sounds that are hard to find.  These are controlled by scripts in windows. These only have one key that we are interested in:
Script = How to handle this sound.  Usually set to ONLY "P".

These misc sounds include the following:
When you change the sound up or down while on a call;
HKCU\ControlPanel\Sounds\LoudestInCallVolume 
HKCU\ControlPanel\Sounds\QuietestInCallVolume 
HKCU\ControlPanel\Sounds\StandardInCallVolume 

When you press the <Send> button to start a call;
HKCU\ControlPanel\Sounds\Dialing

When you press the <End> button to end a call;
HKCU\ControlPanel\Sounds\Ending


6. Build & Flash!
-=-=-=- -=-=-=- =-=-=- -=-=-=- -=-=-=-
Once you have everything in place, build your rom and flash it.


7. Test your sound placement, repeat if necessary!
-=-=-=- -=-=-=- =-=-=- -=-=-=- -=-=-=-
Verify your sounds.  If you missed one, 




***Begin Post#4
*************************************************************************


Additional support items for this tutorial:


Find your RingTones in this thread: http://forum.ppcgeeks.com/forumdisplay.php?f=19

=====================================================

Possible Hex values for Options:
Decimal : Hex Conversion
 0 : 00
 1 : 01
 2 : 02
 3 : 03
 4 : 04
 5 : 05
 6 : 06
 7 : 07
 8 : 08
10 : 0A
11 : 0B
12 : 0C
13 : 0D
14 : 0E
15 : 0F

=====================================================

Here is the scoop on Scripts thanks to weedahoe!  Thanks!

[QUOTE=weedahoe]
call performing 'activate device, play ringtone, wait 3 seconds, repeat':
HKCU\ControlPanel\Sounds\RingTone0\Script = "apw3r" (REG_SZ string, no quotes)

For performing 'active device, set volume to 33%, play ringtone, set volume to 67%, play ringtone, set volume to 100%, play ringtone (no repeat)':
HKCU\ControlPanel\Sounds\RingTone0\Script = "ac33pc67pc100p" (REG_SZ string, no quotes)

The following are the full codes available to you. Please note that all the codes are executed simultaneously except after a ringtone play / wait code. E.g. 'v1p' will vibrate and play at the same time, while vibrating for 1 second. But 'pv1' will play the ringtone through all the way first, then start vibrating for 1 second.

a = activate device
cN = set volume to N in percentage max volume
fN = flash notification LED for N seconds
p = play ringtone. Note that this will play the ringtone all the way through before continuing with the next code.
r = repeat. Note that this should be the last code in your Script string, if used at all.
vN = vibrate for N seconds
wN = wait for N seconds. Note that the device will wait this long before continuing with the next code.

In-call volume change without sound 
You can change the following values: 

HKCU\ControlPanel\Sounds\LoudestInCallVolume 
HKCU\ControlPanel\Sounds\QuietestInCallVolume 
HKCU\ControlPanel\Sounds\StandardInCallVolume 

within each of these keys the default 'Script' value is 'p' for 'play' 

Change the 'Script' value to blank (erase the 'p') 

No more annoying beeps and the volume changes quicker! YAY 
[/QUOTE]

=====================================================

sound locations / types  Coming soon...