0

I discovered a voice over API http://arstechnica.com/apple/guides/2010/02/iphone-voiceservices-looking-under-the-hood.ars/2

One of the APIs is

  • (void) startSpeakingString: (NSString *) aString toURL: (NSURL *) aURL withLanguageCode: (NSString *) code;

Why is there URL in the API? Is this to redirect the speaking to some URL? What if I don't want any redirection?

Joe
  • 659
  • 1
  • 8
  • 17

1 Answers1

0

URLs can point at local files as well as HTTP endpoints, so time goes on, you'll see more and more APIs just accept URLs where they might have in the past only used filesystem paths.

smparkes
  • 13,807
  • 4
  • 36
  • 61
  • i put a dummy url there www.google.com, it seems to work...still not sure what to put there if i don't want a URL – Joe Dec 07 '11 at 05:38
  • I misunderstood your question. The toURL version is supposed to be used to create an AIFF file on disk at that URL. If you want to synthesize to an output device, drop the toURL. See http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSSpeechSynthesizer_Class/Reference/Reference.html#//apple_ref/doc/uid/20001891. – smparkes Dec 07 '11 at 08:06
  • unfortunately, thats a mac API that you specified. in iOS, the API for specifying a language code also requires a URL. there is an API with no URL, but it also doesn't have a language code specifier – Joe Dec 07 '11 at 19:31
  • Ugh. Wonder if I should just remove my whole answer. (It was very late ... evidently too late.) With a clearer head, I remember a few other things, including http://stackoverflow.com/questions/6264958/how-can-i-add-nsspeechsynthesizer-class-reference. If you use any form of this, I believe you will get rejected from the app store, if that matters to you. And synth seems limited on iOS presently even with Apple: others have noted that even with Siri, you can't change the voice, though Apple uses different voices in different locales. – smparkes Dec 07 '11 at 19:50