summaryrefslogtreecommitdiff
path: root/docs/Classes/SDLSpeak.html
blob: 9eff421ecdb8f973c4dabd3776e20db6733656be (plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<h1>SDLSpeak Class Reference</h1>

<h3>Section Contents</h3>

<ul>
  <li><a href="#section--initWithTTS:">-initWithTTS:</a></li>
  <li><a href="#section--initWithTTSChunks:">-initWithTTSChunks:</a></li>
  <li><a href="#section-ttsChunks">ttsChunks</a></li>
</ul>

<h3>Overview</h3>

<p>Speaks a phrase over the vehicle audio system using SDL&rsquo;s TTS (text-to-speech) engine. The provided text to be spoken can be simply a text phrase, or it can consist of phoneme specifications to direct SDL&rsquo;s TTS engine to speak a &ldquo;speech-sculpted&rdquo; phrase.</p>

<p>Receipt of the Response indicates the completion of the Speak operation, regardless of how the Speak operation may have completed (i.e. successfully, interrupted, terminated, etc.).</p>

<p>Requesting a new Speak operation while the application has another Speak operation already in progress (i.e. no corresponding Response for that in-progress Speak operation has been received yet) will terminate the in-progress Speak operation (causing its corresponding Response to be sent by SDL) and begin the requested Speak operation</p>

<p>Requesting a new Speak operation while the application has an <i>SDLAlert</i> operation already in progress (i.e. no corresponding Response for that in-progress <i>SDLAlert</i> operation has been received yet) will result in the Speak operation request being rejected (indicated in the Response to the Request)</p>

<p>Requesting a new <i>SDLAlert</i> operation while the application has a Speak operation already in progress (i.e. no corresponding Response for that in-progress Speak operation has been received yet) will terminate the in-progress Speak operation (causing its corresponding Response to be sent by SDL) and begin the requested <i>SDLAlert</i> operation</p>

<p>Requesting a new Speak operation while the application has a <i>SDLPerformInteraction</i> operation already in progress (i.e. no corresponding Response for that in-progress <i>SDLPerformInteraction</i> operation has been received yet) will result in the Speak operation request being rejected (indicated in the Response to the Request)</p>

<p>Requesting a <i>SDLPerformInteraction</i> operation while the application has a Speak operation already in progress (i.e. no corresponding Response for that in-progress Speak operation has been received yet) will terminate the in-progress Speak operation (causing its corresponding Response to be sent by SDL) and begin the requested <i>SDLPerformInteraction</i> operation</p>

<p>HMI Status Requirements:
 <li>HMILevel: FULL, Limited</li>
 <li>AudioStreamingState: Any</li>
 <li>SystemContext: MAIN, MENU, VR</li></p>

<p><b>Notes:</b>
 <li>When <i>SDLAlert</i> is issued with MENU in effect, <i>SDLAlert</i> is queued and &ldquo;played&rdquo; when MENU interaction is completed (i.e. SystemContext reverts to MAIN). When <i>SDLAlert
 </i> is issued with VR in effect, <i>SDLAlert</i> is queued and &ldquo;played&rdquo; when VR interaction is completed (i.e. SystemContext reverts to MAIN)</li>
 <li>When both <i>SDLAlert</i> and Speak are queued during MENU or VR, they are &ldquo;played&rdquo; back in the order in which they were queued, with all existing rules for &ldquo;collisions&rdquo; still in effect</li></p>

<p><b>Additional Notes:</b>
 <li>Total character limit depends on platform.</li>
 <li>Chunks are limited to 500 characters; however you can have multiple TTS chunks.</li>
 <li>On old systems there is a total character limit of 500 characters across all chunks. This could vary according to the VCA.</li></p>

<p>@since SmartDeviceLink 1.0</p>
<div class="aside aside-see">
    <p class="aside-title">See</p>
    SDLAlert

</div>


<section class="section task-group-section">
  <h3 id="section--initWithTTS:">
      -initWithTTS:
  </h3>
  
  <p>Convenience init to create a speak message</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">nonnull</span> <span class="n">instancetype</span><span class="p">)</span><span class="nf">initWithTTS</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">ttsText</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="nf">init</span><span class="p">(</span><span class="n">tts</span> <span class="nv">ttsText</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>ttsText</dt>
      <dd><p>The text to speak</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>An SDLSpeak object</p>
  </div>
  
  <h3 id="section--initWithTTSChunks:">
      -initWithTTSChunks:
  </h3>
  
  <p>Convenience init to create a speak message</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">nonnull</span> <span class="n">instancetype</span><span class="p">)</span><span class="nf">initWithTTSChunks</span><span class="p">:</span>
    <span class="p">(</span><span class="n">nonnull</span> <span class="n">NSArray</span><span class="o">&lt;</span><span class="n"><a href="../Classes/SDLTTSChunk.html">SDLTTSChunk</a></span> <span class="o">*&gt;</span> <span class="o">*</span><span class="p">)</span><span class="nv">ttsChunks</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="nf">init</span><span class="p">(</span><span class="nv">ttsChunks</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Classes/SDLTTSChunk.html">SDLTTSChunk</a></span><span class="p">])</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>ttsChunks</dt>
      <dd><p>An array of TTSChunk structs which, taken together, specify the phrase to be spoken</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>An SDLSpeak object</p>
  </div>
  
  <h3 id="section-ttsChunks">
      ttsChunks
  </h3>
  
  <p>An array of TTSChunk structs which, taken together, specify the phrase to be spoken</p>

<p>@discussion The total length of the phrase composed from the ttsChunks provided must be less than 500 characters or the request will be rejected</p>

<p>Required, Array of SDLTTSChunk, Array size 1 - 100</p>
<div class="aside aside-see">
    <p class="aside-title">See</p>
    SDLTTSChunk

</div>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">@property</span> <span class="p">(</span><span class="n">nonatomic</span><span class="p">,</span> <span class="n">strong</span><span class="p">)</span> <span class="n">NSArray</span><span class="o">&lt;</span><span class="n"><a href="../Classes/SDLTTSChunk.html">SDLTTSChunk</a></span> <span class="o">*&gt;</span> <span class="o">*</span><span class="n">_Nonnull</span> <span class="n">ttsChunks</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="k">var</span> <span class="nv">ttsChunks</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Classes/SDLTTSChunk.html">SDLTTSChunk</a></span><span class="p">]</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

  
  
  
</section>