Hi,

I've been told that I can use sample dictionary in the documentation
for the UseSpeechDictionary function in the Speech Synthesis Manager
Reference, but I don't seem to be able to get it to work. Any ideas on
what I might be doing wrong would be a great help.

Below is the code that I am using to read the dictionary from a XML file

       speechSynth = [[NSSpeechSynthesizer alloc]
initWithVoice:@"com.apple.speech.synthesis.voice.Alex"];
       [speechSynth autorelease];

       NSDictionary *myDictionary = [NSDictionary
dictionaryWithContentsOfFile:@"/Users/david/Desktop/Test%20speech/SpeechDictionary/myDictionary"];
       [speechSynth addSpeechDictionary:myDictionary];

       [speechSynth startSpeakingString:@"Welcome to Ballina."];

The contains of the file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
   <dict>
               <key>ModificationDate</key>
               <string>2006-12-21 11:59:25 -0800</string>
               <key>Pronunciations</key>
               <array>
                       <dict>
                               <key>Phonemes</key>
                               <string>AE_hEY_yUW</string>
                               <key>Spelling</key>
                               <string>Ballina</string>
                       </dict>
                       <dict>
                               <key>Phonemes</key>
                               <string>AE_hEY_yUW</string>
                               <key>Spelling</key>
                               <string>Hello</string>
                       </dict>
               </array>
               <key>Abbreviations</key>
               <array>
                       <dict>
                               <key>Phonemes</key>
                               <string>_OW_sAEkz</string>
                               <key>Spelling</key>
                               <string>OSAX</string>
                       </dict>
               </array>
   </dict>
</plist>

Regards,
Dave.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to