1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
7 <meta name=
"Generator" content=
"Cocoa HTML Writer">
8 <meta name=
"CocoaVersion" content=
"949.43">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica
}
11 p
.p2
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; min-height: 12.0px}
12 p
.p3
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; min-height: 14.0px}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #606060}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #001bb9; min-height: 12.0px}
17 p
.p8
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #ad140d}
18 p
.p9
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #001bb9}
19 span
.s1
{color: #000000}
20 span
.s2
{color: #001bb9}
21 span
.s3
{color: #606060}
22 span
.s4
{color: #2c7014}
23 span
.s5
{color: #ad140d}
24 span
.Apple-tab-span
{white-space:pre
}
28 <p class=
"p1"><b>Speech
</b></p>
29 <p class=
"p2"><br></p>
30 <p class=
"p3"><b>Speech lets you use the apple speech synthesizer.
</b></p>
31 <p class=
"p4"><br></p>
32 <p class=
"p3">Currently only supported on OS X.
</p>
33 <p class=
"p2"><br></p>
34 <p class=
"p5">"hi i'm talking with the default voice now, i guess"<span class=
"s1">.speak;
</span></p>
35 <p class=
"p2"><br></p>
36 <p class=
"p3">Speech consists of an Array of SpeechChannels. By default Speech is initialized with only one channel, but can be set up to use up to
16 by providing an argument to init. Channels may be used through a SpeechChannel or by setting the channel in Speech's methods (see below).
<span class=
"Apple-converted-space"> </span></p>
37 <p class=
"p4"><br></p>
38 <p class=
"p3">Speech is a function of the operating system and not the server. By consequence,
<b>it is not possible to use UGens to filter or record the output directly.
</b> You may be able to patch system output to system input (either by hardware of by software) to rout it to the server.
</p>
39 <p class=
"p2"><br></p>
40 <p class=
"p3">examples:
</p>
41 <p class=
"p2"><br></p>
42 <p class=
"p6"><span class=
"s2"><span class=
"Apple-tab-span"> </span>Speech
</span>.init(
2);
</p>
43 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.channels[
0].speak(
<span class=
"s3">"hallo"</span>);
</p>
44 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.channels[
0].isActive;
</p>
45 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.channels[
0].voice_(
3);
</p>
46 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.channels[
0].speak(
<span class=
"s3">"hallo"</span>);
</p>
47 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.channels[
0].pitch_(
60);
</p>
48 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.channels[
0].speak(
<span class=
"s3">"hallo"</span>);
</p>
49 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.channels[
0].volume_(-
20.dbamp);
</p>
50 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.channels[
0].pitchMod_(
50);
</p>
51 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.channels[
0].speak(
<span class=
"s3">"hallo"</span>);
</p>
52 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.channels[
0].stop(
<span class=
"s4">\immediate
</span>);
</p>
53 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.channels[
0].stop(
<span class=
"s4">\endOfWord
</span>);
</p>
54 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.channels[
0].stop(
<span class=
"s4">\endOfSentence
</span>);
</p>
55 <p class=
"p2"><br></p>
56 <p class=
"p3">Force the voice to speaking something different by setting the second argument of speak to true.
</p>
57 <p class=
"p2"><br></p>
58 <p class=
"p5"><span class=
"s2"><span class=
"Apple-tab-span"> </span>Speech
</span><span class=
"s1">.channels[
0].speak(
</span>"Force the voice to speaking something different."<span class=
"s1">);
</span></p>
59 <p class=
"p5"><span class=
"s1"><span class=
"Apple-tab-span"> </span></span><span class=
"s2">Speech
</span><span class=
"s1">.channels[
0].speak(
</span>"Force the voice to speaking something different."<span class=
"s1">.reverse,
</span><span class=
"s2">true
</span><span class=
"s1">);
</span></p>
60 <p class=
"p2"><br></p>
61 <p class=
"p2"><br></p>
62 <p class=
"p2"><br></p>
63 <p class=
"p3">First argument is always the voice channel number, second the value
</p>
64 <p class=
"p7"><br></p>
65 <p class=
"p6"><span class=
"s2"><span class=
"Apple-tab-span"> </span>Speech
</span>.setSpeechVoice(
0,
14);
</p>
66 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.setSpeechPitch(
0,
40);
<span class=
"s5">//pitch in MIDI Num
</span></p>
67 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.setSpeechRate(
0,
10);
</p>
68 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.setSpeechVolume(
0,
0.1);
</p>
69 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.setSpeechPitchMod(
0,
200);
</p>
70 <p class=
"p6"><span class=
"Apple-tab-span"> </span>Speech.stop(
0,
1);
</p>
71 <p class=
"p2"><span class=
"Apple-tab-span"> </span></p>
72 <p class=
"p3">Two actions can be applied:
</p>
73 <p class=
"p2"><br></p>
74 <p class=
"p6"><span class=
"s2">Speech
</span>.wordAction = {
<span class=
"s2">arg
</span> voiceNum;
</p>
75 <p class=
"p8"><span class=
"s1"><span class=
"Apple-tab-span"> </span></span>//i.postln;
</p>
76 <p class=
"p8"><span class=
"Apple-tab-span"> </span>// the currently speaking text may not be changed
</p>
77 <p class=
"p6"><span class=
"Apple-tab-span"> </span>//
<span class=
"s2">Speech
</span>.setSpeechPitch(voiceNum,[
41,
60].choose);
</p>
78 <p class=
"p6"><span class=
"Apple-tab-span"> </span>//
<span class=
"s2">Speech
</span>.setSpeechRate(voiceNum,[
60,
80,
10].choose);
</p>
80 <p class=
"p6"><span class=
"s2">Speech
</span>.doneAction_({
<span class=
"s2">arg
</span> voiceNum;
</p>
81 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.setSpeechPitch(voiceNum,[
41,
48,
40,
43,
30,
60].choose);
</p>
83 <p class=
"p2"><br></p>
84 <p class=
"p3">Pause the speech while speaking:
1=pause,
0= start
</p>
85 <p class=
"p4"><br></p>
86 <p class=
"p6"><span class=
"s2">Speech
</span>.pause(
0,
1);
</p>
87 <p class=
"p4"><br></p>
88 <p class=
"p3">Initialization happens automatically, by default with one voice channel.
</p>
89 <p class=
"p3">You may explicitly initalize with more channels, up to
16:
</p>
90 <p class=
"p4"><br></p>
91 <p class=
"p2"><br></p>
93 <p class=
"p6"><span class=
"s2">Speech
</span>.init(
16);
</p>
94 <p class=
"p7"><br></p>
95 <p class=
"p9">Task
<span class=
"s1">({
</span></p>
96 <p class=
"p6"><span class=
"Apple-tab-span"> </span>16.do ({
<span class=
"s2">arg
</span> i;
</p>
97 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>[
0.1,
0.18,
0.2].choose.wait;
</p>
98 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.setSpeechRate(i,[
90,
30,
60].choose);
</p>
99 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s2">Speech
</span>.setSpeechVolume(i,
0.07);
</p>
100 <p class=
"p5"><span class=
"s1"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>"no this is private. float . boolean me. char[8] "<span class=
"s1">.speak(i);
</span></p>
101 <p class=
"p6"><span class=
"Apple-tab-span"> </span>});
</p>
102 <p class=
"p6">}).play;
</p>
104 <p class=
"p2"><br></p>
105 <p class=
"p8">//jan@sampleAndHold.org
04/
2003</p>
106 <p class=
"p8">//update
10/
2007</p>
107 <p class=
"p2"><br></p>
108 <p class=
"p2"><br></p>
109 <p class=
"p4"><br></p>
110 <p class=
"p4"><br></p>
111 <p class=
"p4"><br></p>