Skip to content

Instantly share code, notes, and snippets.

@marcelofabri
Last active December 23, 2015 16:49
Show Gist options
  • Save marcelofabri/6665076 to your computer and use it in GitHub Desktop.
Save marcelofabri/6665076 to your computer and use it in GitHub Desktop.
Exemplo de AVSpeechSynthesizer.
// supondo que o device está em pt já
AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"O NSNull é o melhor evento sobre"];
utterance.rate = AVSpeechUtteranceMaximumSpeechRate / 4.0f;
[synthesizer speakUtterance:utterance];
utterance = [AVSpeechUtterance speechUtteranceWithString:@"i O S"];
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
utterance.rate = AVSpeechUtteranceMaximumSpeechRate / 4.0f;
[synthesizer speakUtterance:utterance];
utterance = [AVSpeechUtterance speechUtteranceWithString:@"do Brasil!"];
utterance.rate = AVSpeechUtteranceMaximumSpeechRate / 4.0f;
[synthesizer speakUtterance:utterance];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment