2014-05-23 3 views

Antwort

17

können Sie legen eine der unten Sprache:

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

oder Standard locale:

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

Update

dies ist die Liste mit den unterstützten Sprachen:

+0

ok danke tonymkenu, wie ich Stimme identifify kann. Sprache entsprechende Stadt oder Sprache Name – Ravindhiran

+0

update ... mit Ihrer 'Anfrage' :) – TonyMkenu

+0

mehr Infos hier: http://useyourloaf.com/blog/2014/01/08/synthesized-speech-from-text.html – TonyMkenu

2

SWIFT 3 Update:

import AVFoundation 

(die Sprachen-Codes überprüfen):

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

Dann:

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) 
Verwandte Themen