New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

NSSpeechSynthesizer not calling delegate methods

Post Reply New Thread Subscribe

Thread Tools

Member Since: Nov 09, 2011
Posts: 1
skot is on a distinguished road

skot is offline
Anybody had any luck using an NSSpeechSynthesizerDelegate? None of my delegate messages are being called. Here's the code:

//  main.m

#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>

@interface SynthesizerDelegate : NSObject <NSSpeechSynthesizerDelegate>

@implementation SynthesizerDelegate
- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender willSpeakWord:(NSRange)characterRange ofString:(NSString *)string {
  printf("speaking word ");
  printf("%s \n", [[string substringWithRange:characterRange] UTF8String]);
- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender didFinishSpeaking:(BOOL)finishedSpeaking {
  printf("finished speaking\n");

int main (int argc, const char * argv[])
  NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  NSString *input = @"I am not an animal. I am a man.";
  NSSpeechSynthesizer *synthesizer = [[NSSpeechSynthesizer alloc] init];
  SynthesizerDelegate *delegate = [[SynthesizerDelegate alloc] init];
  [synthesizer setDelegate:delegate];
  [synthesizer startSpeakingString:input];
  while ([synthesizer isSpeaking]) {
  [synthesizer release];
  [delegate release];
  [pool drain];
  return 0;
QUOTE Thanks

Post Reply New Thread Subscribe

« Installing X code with Mac OS X and iOS sdks | How do I compile source code on a mac Im trying to compile hydra 7.1.src.tar.gz on a »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Starter
Last Post
Skype 5.3 for Mac brings HD video calling, Lion support OneMoreThing... Apple Rumors and Reports 4 08-09-2011 03:20 AM
MobileMe to get 'alternate payment methods' soon? the8thark Apple Rumors and Reports 0 03-29-2011 06:22 AM
Contact picture when calling... NPuter iOS and Apps 3 09-02-2008 04:18 PM

All times are GMT -4. The time now is 02:26 PM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?