Hi Chip,
I already understand that but thanks anyway. Last night I set up the first
step of voice adjustment see below for the save button and the initializing
call.
The next step will place a 2 letter key for voice engine and its
corresponding value, such as Tone would be: "WT" or "ST" for windoweyes and
sapi...
Case "btn_combo_save"
If dEvent = buttonClicked Then
' Do this to iniFile directly:
Dim letter: letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
INIFile(myINIFile).Text( myVoiceName, "Tone", "L") = Mid( letter,
dObj.Control( "cmb_tone").SelectedItem, 1)
INIFile(myINIFile).Number( myVoiceName, "Rate", 62) = dObj.Control(
"cmb_rate").SelectedItem
INIFile(myINIFile).Number( myVoiceName, "Pitch", 3) = dObj.Control(
"cmb_pitch").SelectedItem - 1
INIFile(myINIFile).Number( myVoiceName, "Volume", 9) = dObj.Control(
"cmb_volume").SelectedItem - 1
dObj.Close 'Triggers closing process.
End If
VoiceDialogProc = True
Exit Function
Sub setVoiceFields()
' Initialize and set all voice dialog fields.
myVoiceDialog.Control( "txt_cmb_tone").Text = "Tone: "
myVoiceDialog.Control( "txt_cmb_rate").Text = "Rate: "
myVoiceDialog.Control( "txt_cmb_pitch").Text = "Pitch: "
myVoiceDialog.Control( "txt_cmb_volume").Text = "Volume: "
Dim letter: letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Dim s, e, i
s = 1: e = 26
For i = s to e
' Make tone combo box selections.
myVoiceDialog.Control( "cmb_tone").Add Replace( "%1 ", "%1", Mid( letter, i,
1)), i
Next
For i = 1 to 100
' Make rate combo box selections.
myVoiceDialog.Control( "cmb_rate").Add Replace( "%1 ", "%1", i), i
Next
For i = 0 to 9
' Make pitch combo box selections.
myVoiceDialog.Control( "cmb_pitch").Add Replace( "%1 ", "%1", i), i+1
Next
For i = 0 to 9
' Make volume combo box selections.
myVoiceDialog.Control( "cmb_volume").Add Replace( "%1 ", "%1", i), i+1
Next
' Set focus or check each appropriate comboBox id here.
myVoiceDialog.Control( "cmb_tone").SelectedItem = Instr( letter,
INIFile(myINIFile).Text( myVoiceName, "Tone", "L"))
myVoiceDialog.Control( "cmb_rate").SelectedItem = INIFile(myINIFile).Number(
myVoiceName, "Rate", 62)
myVoiceDialog.Control( "cmb_pitch").SelectedItem = INIFile(myINIFile).Number(
myVoiceName, "Pitch", 2) + 1
myVoiceDialog.Control( "cmb_volume").SelectedItem = INIFile(myINIFile).Number(
myVoiceName, "Volume", 9) + 1
End Sub
Sent: Tuesday, May 29, 2012 9:42 PM
Subject: INI file; was RE: CursorKeys Object Problem
Hi Bruce,
I will put an example below; I like to store my ini file object in a
variable, and then use it for writing in a separate step (I think it's clearer):
set myINIFile = INIFile("test.ini") ' get my ini file object
myINIFile.text("options", "speak_format_changes") = true ' writes true to
this setting in the [options] section
' above I used the .text property; if you were writing out a numeric value
there's also a .number property you would use to write it with.
hth,
Chip
----------------------------------------------------------------------------
From: BT [mailto:[email protected]]
Sent: Monday, May 28, 2012 8:06 PM
To: [email protected]
Subject: Re: CursorKeys Object Problem
Hi Chip,
Another question, I was going to instead of doing it there but save the
voice settings in the .ini file.
But, I can read from the file with the ext4eranl program but can not
write to it. There is no assignment property for it, just a read only.
Is ther also a trick to get the .ini file to be written to?
Or does it need to be a shared object?
Bruce
Sent: Monday, May 28, 2012 6:09 PM
Subject: RE: CursorKeys Object Problem
Bruce,
You would have to make your voice settings be set to "program" in order
for you to be able to make changes to them, and have those changes saved with
the .set file. Even so, it's tricky to do via programming so that you get the
changes done correctly.
Chip
------------------------------------------------------------------------
From: BT [mailto:[email protected]]
Sent: Monday, May 28, 2012 1:11 PM
To: [email protected]
Subject: Re: CursorKeys Object Problem
Hi Chip and Rick,
I just discovered one little interesting event. I set my Trek game
to load a set file.
Now, the set file name is there each time I run the Trek.exe game since
it is associated with it and doing the Filename thing it gives me that set
file, called Trek.set.
Now, I change settings for any of the 3 keys, Screen, Mouse, or
Keyboard, it saves the Trek.set file settings are saved, I at least say the
name.
Now, when running the program again, no changes are in the set
file, nothing.
For when I read the settings they come in as what was there before even
running the game or saving the changed settings.
In other words, nothing is being saved inside the set file.
I even do a RefreshSets command and that did not fix the problem.
So, why is this?
Could this be what you are experiencing Rick?
Bruce