Add reference
1
|
import< /span> AVFoundation
|
play voice
1 2 3 4 5 6 7 8 9
|
let player = AVSpeechSynthesizer(); player.delegate = self; let u = AVSpeechUtterance(string: "The weather is nice today"); span> u.voice = AVSpeechSynthesisVoice(language: "zh-CN" ); u.volume = 1.0; u.rate = 0.48; u.pitchMultiplier = 1.0; player.speakUtterance(u);
td> |
Below iPhone6
rate
is set to 0.1 code>Otherwise, you will read the pits of iOS very quickly
agent method
1 < span class="line">2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
func (synthesizer: AVSpeechSynthesizer, didStartSpeechUtterance utterance: AVSpeechUtterance) { < span class="built_in">print("start playing") }
< sp an class="line">func (synthesizer: AVSpeechSynthesizer, willSpeakRangeOfSpeechString characterRange: NSRange, utterance: AVSpeechUtterance) { let process = Double span>(characterRange.location) / Double(utterance.speechString.characters.count); print("During playback, the playback progress is: (process)") }
func (synthesizer: AVSpeechSynthesizer, didFinishSpeechUtterance utterance: AVSpeechUtterance) { print ("Playing completed") }
|
common method
1 2 3 span> 4
|
player.stopSpeakingAtBoundary(AVSpeechBoundary.Immediate);
player.pauseSpeakingAtBoundary(AVSpeechBoundary.Immediate);
< /td> |
WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3926 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC