Comment detail

音声合成でHello, world! (Nested Flatten)
NSLog(@"%@", [NSSpeechSynthesizer availableVoices]);
で使える声の一覧を確認できます。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#import <Foundation/Foundation.h>
#import <Appkit/Appkit.h>

int main(int argc, char** argv)
{
  NSAutoreleasePool* pool = [NSAutoreleasePool new];
  
  NSSpeechSynthesizer* s = [[[NSSpeechSynthesizer alloc] initWithVoice:@"com.apple.speech.synthesis.voice.Alex"] autorelease];
  [s startSpeakingString:@"Hello, world!"];
  while ([s isSpeaking]) ;
  [s startSpeakingString:@"con nitch were"];
  while ([s isSpeaking]) ;
  [s startSpeakingString:@"daw cat coo org, sole what program mar know tum yen know Colosseum death"];
  while ([s isSpeaking]) ;
  
  [pool release];
  return 0;
}

Index

Feed

Other

Link

Pathtraq

loading...