-
Notifications
You must be signed in to change notification settings - Fork 3
/
SayCongratulations.m
61 lines (50 loc) · 1.13 KB
/
SayCongratulations.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// SayCongratulations.m
// TapToTeach
//
// Created by Preston Rohner on 5/7/10.
// Copyright 2010 Cool Tool Apps. All rights reserved.
//
#import "SayCongratulations.h"
#import "FliteTTS.h"
@implementation SayCongratulations
- (void)run {
[super run];
float speed;
NSString *wordToSay;
switch (arc4random() % 5) {
case 4:
wordToSay = @"Terrific";
speed = 1.0;
break;
case 3:
wordToSay = @"Awesome";
speed = 1.0;
break;
case 2:
wordToSay = @"Great work";
speed = 1.37;
break;
case 1:
wordToSay = @"Great job";
speed = 1;
break;
case 0:
wordToSay = @"Congratulations";
speed = 1;
break;
default:
break;
}
// FliteTTS *fliteEngine = [[FliteTTS alloc] init];
// [fliteEngine setPitch:125.0 variance:11.0 speed:speed];
// [fliteEngine speakText:wordToSay];
FliteTTS *fliteEngine = [[FliteTTS alloc] init];
SystemSettings *s = [appDelegate systemSettings];
[fliteEngine setPitch:[s.ttsPitch floatValue] variance:[s.ttsVariance floatValue] speed:speed];
[fliteEngine setVoice:s.ttsVoice];
[fliteEngine speakText:wordToSay];
//[fliteEngine release];
[self endRun];
}
@end