objc2_avf_audio/generated/
AVSpeechSynthesisProvider.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-audio-toolbox")]
7#[cfg(not(target_os = "watchos"))]
8use objc2_audio_toolbox::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern_class!(
14 #[unsafe(super(NSObject))]
26 #[derive(Debug, PartialEq, Eq, Hash)]
27 pub struct AVSpeechSynthesisProviderVoice;
28);
29
30unsafe impl Send for AVSpeechSynthesisProviderVoice {}
31
32unsafe impl Sync for AVSpeechSynthesisProviderVoice {}
33
34extern_conformance!(
35 unsafe impl NSCoding for AVSpeechSynthesisProviderVoice {}
36);
37
38extern_conformance!(
39 unsafe impl NSCopying for AVSpeechSynthesisProviderVoice {}
40);
41
42unsafe impl CopyingHelper for AVSpeechSynthesisProviderVoice {
43 type Result = Self;
44}
45
46extern_conformance!(
47 unsafe impl NSObjectProtocol for AVSpeechSynthesisProviderVoice {}
48);
49
50extern_conformance!(
51 unsafe impl NSSecureCoding for AVSpeechSynthesisProviderVoice {}
52);
53
54impl AVSpeechSynthesisProviderVoice {
55 extern_methods!(
56 #[unsafe(method(name))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn name(&self) -> Retained<NSString>;
60
61 #[unsafe(method(identifier))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn identifier(&self) -> Retained<NSString>;
68
69 #[unsafe(method(primaryLanguages))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn primaryLanguages(&self) -> Retained<NSArray<NSString>>;
75
76 #[unsafe(method(supportedLanguages))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn supportedLanguages(&self) -> Retained<NSArray<NSString>>;
86
87 #[unsafe(method(voiceSize))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn voiceSize(&self) -> i64;
93
94 #[unsafe(method(setVoiceSize:))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn setVoiceSize(&self, voice_size: i64);
98
99 #[unsafe(method(version))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn version(&self) -> Retained<NSString>;
105
106 #[unsafe(method(setVersion:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn setVersion(&self, version: &NSString);
110
111 #[cfg(feature = "AVSpeechSynthesis")]
112 #[unsafe(method(gender))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn gender(&self) -> AVSpeechSynthesisVoiceGender;
116
117 #[cfg(feature = "AVSpeechSynthesis")]
118 #[unsafe(method(setGender:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn setGender(&self, gender: AVSpeechSynthesisVoiceGender);
122
123 #[unsafe(method(age))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn age(&self) -> NSInteger;
129
130 #[unsafe(method(setAge:))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn setAge(&self, age: NSInteger);
134
135 #[unsafe(method(initWithName:identifier:primaryLanguages:supportedLanguages:))]
136 #[unsafe(method_family = init)]
137 pub unsafe fn initWithName_identifier_primaryLanguages_supportedLanguages(
138 this: Allocated<Self>,
139 name: &NSString,
140 identifier: &NSString,
141 primary_languages: &NSArray<NSString>,
142 supported_languages: &NSArray<NSString>,
143 ) -> Retained<Self>;
144
145 #[unsafe(method(init))]
146 #[unsafe(method_family = init)]
147 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
148
149 #[unsafe(method(new))]
150 #[unsafe(method_family = new)]
151 pub unsafe fn new() -> Retained<Self>;
152
153 #[unsafe(method(updateSpeechVoices))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn updateSpeechVoices();
159 );
160}
161
162extern_class!(
163 #[unsafe(super(NSObject))]
171 #[derive(Debug, PartialEq, Eq, Hash)]
172 pub struct AVSpeechSynthesisProviderRequest;
173);
174
175unsafe impl Send for AVSpeechSynthesisProviderRequest {}
176
177unsafe impl Sync for AVSpeechSynthesisProviderRequest {}
178
179extern_conformance!(
180 unsafe impl NSCoding for AVSpeechSynthesisProviderRequest {}
181);
182
183extern_conformance!(
184 unsafe impl NSCopying for AVSpeechSynthesisProviderRequest {}
185);
186
187unsafe impl CopyingHelper for AVSpeechSynthesisProviderRequest {
188 type Result = Self;
189}
190
191extern_conformance!(
192 unsafe impl NSObjectProtocol for AVSpeechSynthesisProviderRequest {}
193);
194
195extern_conformance!(
196 unsafe impl NSSecureCoding for AVSpeechSynthesisProviderRequest {}
197);
198
199impl AVSpeechSynthesisProviderRequest {
200 extern_methods!(
201 #[unsafe(method(ssmlRepresentation))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn ssmlRepresentation(&self) -> Retained<NSString>;
207
208 #[unsafe(method(voice))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn voice(&self) -> Retained<AVSpeechSynthesisProviderVoice>;
212
213 #[unsafe(method(initWithSSMLRepresentation:voice:))]
214 #[unsafe(method_family = init)]
215 pub unsafe fn initWithSSMLRepresentation_voice(
216 this: Allocated<Self>,
217 text: &NSString,
218 voice: &AVSpeechSynthesisProviderVoice,
219 ) -> Retained<Self>;
220
221 #[unsafe(method(init))]
222 #[unsafe(method_family = init)]
223 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
224
225 #[unsafe(method(new))]
226 #[unsafe(method_family = new)]
227 pub unsafe fn new() -> Retained<Self>;
228 );
229}
230
231#[cfg(all(feature = "AVSpeechSynthesis", feature = "block2"))]
239pub type AVSpeechSynthesisProviderOutputBlock = *mut block2::DynBlock<
240 dyn Fn(NonNull<NSArray<AVSpeechSynthesisMarker>>, NonNull<AVSpeechSynthesisProviderRequest>),
241>;
242
243extern_class!(
244 #[unsafe(super(AUAudioUnit, NSObject))]
246 #[derive(Debug, PartialEq, Eq, Hash)]
247 #[cfg(feature = "objc2-audio-toolbox")]
248 #[cfg(not(target_os = "watchos"))]
249 pub struct AVSpeechSynthesisProviderAudioUnit;
250);
251
252#[cfg(feature = "objc2-audio-toolbox")]
253#[cfg(not(target_os = "watchos"))]
254extern_conformance!(
255 unsafe impl NSObjectProtocol for AVSpeechSynthesisProviderAudioUnit {}
256);
257
258#[cfg(feature = "objc2-audio-toolbox")]
259#[cfg(not(target_os = "watchos"))]
260impl AVSpeechSynthesisProviderAudioUnit {
261 extern_methods!(
262 #[unsafe(method(speechVoices))]
267 #[unsafe(method_family = none)]
268 pub unsafe fn speechVoices(&self) -> Retained<NSArray<AVSpeechSynthesisProviderVoice>>;
269
270 #[unsafe(method(setSpeechVoices:))]
272 #[unsafe(method_family = none)]
273 pub unsafe fn setSpeechVoices(
274 &self,
275 speech_voices: &NSArray<AVSpeechSynthesisProviderVoice>,
276 );
277
278 #[cfg(all(feature = "AVSpeechSynthesis", feature = "block2"))]
279 #[unsafe(method(speechSynthesisOutputMetadataBlock))]
285 #[unsafe(method_family = none)]
286 pub unsafe fn speechSynthesisOutputMetadataBlock(
287 &self,
288 ) -> AVSpeechSynthesisProviderOutputBlock;
289
290 #[cfg(all(feature = "AVSpeechSynthesis", feature = "block2"))]
291 #[unsafe(method(setSpeechSynthesisOutputMetadataBlock:))]
293 #[unsafe(method_family = none)]
294 pub unsafe fn setSpeechSynthesisOutputMetadataBlock(
295 &self,
296 speech_synthesis_output_metadata_block: AVSpeechSynthesisProviderOutputBlock,
297 );
298
299 #[unsafe(method(synthesizeSpeechRequest:))]
306 #[unsafe(method_family = none)]
307 pub unsafe fn synthesizeSpeechRequest(
308 &self,
309 speech_request: &AVSpeechSynthesisProviderRequest,
310 );
311
312 #[unsafe(method(cancelSpeechRequest))]
314 #[unsafe(method_family = none)]
315 pub unsafe fn cancelSpeechRequest(&self);
316 );
317}
318
319#[cfg(feature = "objc2-audio-toolbox")]
321#[cfg(not(target_os = "watchos"))]
322impl AVSpeechSynthesisProviderAudioUnit {
323 extern_methods!(
324 #[unsafe(method(init))]
325 #[unsafe(method_family = init)]
326 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
327
328 #[unsafe(method(initWithComponentDescription:options:error:_))]
338 #[unsafe(method_family = init)]
339 pub unsafe fn initWithComponentDescription_options_error(
340 this: Allocated<Self>,
341 component_description: AudioComponentDescription,
342 options: AudioComponentInstantiationOptions,
343 ) -> Result<Retained<Self>, Retained<NSError>>;
344
345 #[unsafe(method(initWithComponentDescription:error:_))]
347 #[unsafe(method_family = init)]
348 pub unsafe fn initWithComponentDescription_error(
349 this: Allocated<Self>,
350 component_description: AudioComponentDescription,
351 ) -> Result<Retained<Self>, Retained<NSError>>;
352 );
353}
354
355#[cfg(feature = "objc2-audio-toolbox")]
357#[cfg(not(target_os = "watchos"))]
358impl AVSpeechSynthesisProviderAudioUnit {
359 extern_methods!(
360 #[unsafe(method(new))]
361 #[unsafe(method_family = new)]
362 pub unsafe fn new() -> Retained<Self>;
363 );
364}