Skip to content

Commit

Permalink
11
Browse files Browse the repository at this point in the history
  • Loading branch information
wqforever committed Mar 25, 2017
1 parent cf66558 commit 3a94ad9
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions 文字转语音/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,33 @@
//

#import "ViewController.h"
#import "TTSpeechController.h"
#import <AVFoundation/AVFoundation.h>

@interface ViewController ()

@interface ViewController ()<AVSpeechSynthesizerDelegate>
@property (nonatomic,strong) TTSpeechController *speechController;
//
@property (nonatomic,strong) NSMutableArray *speechString;
@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.speechController = [TTSpeechController shareSpeechController];
self.speechController.synthesizer.delegate = self;

self.speechString = [[NSMutableArray alloc]init];

[self.speechController beginConversation];
}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didStartSpeechUtterance:(AVSpeechUtterance *)utterance {
[self.speechString addObject:utterance];
}
@end

0 comments on commit 3a94ad9

Please sign in to comment.