AVSpeechUtterance:
这个类主要是一条一条话语,这些话语对象可以填充文本,语言,语速,音高等等,
AVSpeechSynthesisVoice:
语言设置,如中文,英文等等
具体的API点进类中去看。下面开始实战。
目标:我想做一个在线读漫画的小例子
Demo地址:https://github.com/RainManGO/speechSynthesizerDemo.git
部分代码:
//
// ZYSpeechController.m
// AVSpeechDemo
//
// Created by apple on 2017/12/6.
// Copyright © 2017年 ZY. All rights reserved.
//
#import “ZYSpeechController.h”
@interface ZYSpeechController ()
@end
@implementation ZYSpeechController
+(instancetype)speechManager{
static ZYSpeechController * speechController;
static dispatch_once_t onceToken;
dispatc