2014-05-23 13 views

cevap

17

ayarlayabilirsiniz tek:

for (AVSpeechSynthesisVoice *voice in [AVSpeechSynthesisVoice speechVoices]) { 
      NSLog(@" %@", voice.language); 
     } 

veya kullanım varsayılan yerel ayarı: Bu desteklenen diller ile listesidir

AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init]; 
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"Localized -text"]; 
utterance.rate = AVSpeechUtteranceMinimumSpeechRate; // Tell it to me slowly 
[synthesizer speakUtterance:utterance]; 

güncelleme:

.210
+0

tamam sesini identifify nasıl, sen tonymkenu teşekkürler. – Ravindhiran

+0

güncellemesine karşılık gelen şehir veya dil adı ... 'isteğiniz' ile ... – TonyMkenu

+0

daha fazla bilgi burada: http://useyourloaf.com/blog/2014/01/08/synthesized-speech-from-text.html – TonyMkenu

2

SWIFT 3 güncelleme:

import AVFoundation 

(dil kodları kontrol): Sonra

for voice in (AVSpeechSynthesisVoice.speechVoices()){ 
     print(voice.language) 
    } 

:

let speakTalk = AVSpeechSynthesizer() 
let speakMsg = AVSpeechUtterance(string: "Hello Word I can speak") 

speakMsg.voice = AVSpeechSynthesisVoice(language: "en-US") 
speakMsg.pitchMultiplier = 1.2 
speakMsg.rate = 0.5 

speakTalk.speak(speakMsg) 
İlgili konular