• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
speechSynthesizer willSpeakWord trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

speechSynthesizer willSpeakWord trouble


  • Subject: speechSynthesizer willSpeakWord trouble
  • From: Paul Bruneau <email@hidden>
  • Date: Fri, 6 Jul 2007 18:22:29 -0400

Hi everyone-

I am just messing around with some speech stuff (expanding on examples from Hillegass' book) and I just can't make the willSpeakWord delegate work right. Here is my method:

-(void)speechSynthesizer:(NSSpeechSynthesizer *)sender
		   willSpeakWord:(NSRange)characterRange
				ofString:(NSString *)myString;
{
	NSLog(@"Range: %@", NSStringFromRange(characterRange));
	NSLog(@"Speaking: %@", [myString substringWithRange:characterRange]);
}

my output goes like this:

2007-07-06 18:07:03.463 SpeakLine[366] Range: {0, 5}
2007-07-06 18:07:03.463 SpeakLine[366] Speaking: (null)
2007-07-06 18:07:03.785 SpeakLine[366] Range: {6, 5}
2007-07-06 18:07:03.785 SpeakLine[366] Speaking: (null)
2007-07-06 18:07:04.236 SpeakLine[366] Range: {12, 6}

The range is coming through OK, but no matter what I have tried, the substring I am trying to get above) always comes out (null). I have tried just putting myString (without the substring part) into the log, but it is also (null).

Here is my init method for my controller:

-(id)init
{
	[super init];
	NSLog(@"init");

	speechSynth = [[NSSpeechSynthesizer alloc] initWithVoice:nil];
	[speechSynth setDelegate:self];
	return self;
}

Any ideas for newbie me? Thank you.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: speechSynthesizer willSpeakWord trouble
      • From: Ricky Sharp <email@hidden>
    • Re: speechSynthesizer willSpeakWord trouble
      • From: glenn andreas <email@hidden>
    • Re: speechSynthesizer willSpeakWord trouble
      • From: Andy Lee <email@hidden>
References: 
 >Re: Cocoa and dead-code stripping (From: Scott Ribe <email@hidden>)
 >Re: Cocoa and dead-code stripping (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: Problem with bindings and cleaning up a view
  • Next by Date: Re: speechSynthesizer willSpeakWord trouble
  • Previous by thread: Re: Cocoa and dead-code stripping
  • Next by thread: Re: speechSynthesizer willSpeakWord trouble
  • Index(es):
    • Date
    • Thread