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
34unsafe impl NSCoding for AVSpeechSynthesisProviderVoice {}
35
36unsafe impl NSCopying for AVSpeechSynthesisProviderVoice {}
37
38unsafe impl CopyingHelper for AVSpeechSynthesisProviderVoice {
39 type Result = Self;
40}
41
42unsafe impl NSObjectProtocol for AVSpeechSynthesisProviderVoice {}
43
44unsafe impl NSSecureCoding for AVSpeechSynthesisProviderVoice {}
45
46impl AVSpeechSynthesisProviderVoice {
47 extern_methods!(
48 #[unsafe(method(name))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn name(&self) -> Retained<NSString>;
52
53 #[unsafe(method(identifier))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn identifier(&self) -> Retained<NSString>;
60
61 #[unsafe(method(primaryLanguages))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn primaryLanguages(&self) -> Retained<NSArray<NSString>>;
67
68 #[unsafe(method(supportedLanguages))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn supportedLanguages(&self) -> Retained<NSArray<NSString>>;
78
79 #[unsafe(method(voiceSize))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn voiceSize(&self) -> i64;
85
86 #[unsafe(method(setVoiceSize:))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn setVoiceSize(&self, voice_size: i64);
90
91 #[unsafe(method(version))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn version(&self) -> Retained<NSString>;
97
98 #[unsafe(method(setVersion:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn setVersion(&self, version: &NSString);
102
103 #[cfg(feature = "AVSpeechSynthesis")]
104 #[unsafe(method(gender))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn gender(&self) -> AVSpeechSynthesisVoiceGender;
108
109 #[cfg(feature = "AVSpeechSynthesis")]
110 #[unsafe(method(setGender:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn setGender(&self, gender: AVSpeechSynthesisVoiceGender);
114
115 #[unsafe(method(age))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn age(&self) -> NSInteger;
121
122 #[unsafe(method(setAge:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn setAge(&self, age: NSInteger);
126
127 #[unsafe(method(initWithName:identifier:primaryLanguages:supportedLanguages:))]
128 #[unsafe(method_family = init)]
129 pub unsafe fn initWithName_identifier_primaryLanguages_supportedLanguages(
130 this: Allocated<Self>,
131 name: &NSString,
132 identifier: &NSString,
133 primary_languages: &NSArray<NSString>,
134 supported_languages: &NSArray<NSString>,
135 ) -> Retained<Self>;
136
137 #[unsafe(method(init))]
138 #[unsafe(method_family = init)]
139 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
140
141 #[unsafe(method(new))]
142 #[unsafe(method_family = new)]
143 pub unsafe fn new() -> Retained<Self>;
144
145 #[unsafe(method(updateSpeechVoices))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn updateSpeechVoices();
151 );
152}
153
154extern_class!(
155 #[unsafe(super(NSObject))]
163 #[derive(Debug, PartialEq, Eq, Hash)]
164 pub struct AVSpeechSynthesisProviderRequest;
165);
166
167unsafe impl Send for AVSpeechSynthesisProviderRequest {}
168
169unsafe impl Sync for AVSpeechSynthesisProviderRequest {}
170
171unsafe impl NSCoding for AVSpeechSynthesisProviderRequest {}
172
173unsafe impl NSCopying for AVSpeechSynthesisProviderRequest {}
174
175unsafe impl CopyingHelper for AVSpeechSynthesisProviderRequest {
176 type Result = Self;
177}
178
179unsafe impl NSObjectProtocol for AVSpeechSynthesisProviderRequest {}
180
181unsafe impl NSSecureCoding for AVSpeechSynthesisProviderRequest {}
182
183impl AVSpeechSynthesisProviderRequest {
184 extern_methods!(
185 #[unsafe(method(ssmlRepresentation))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn ssmlRepresentation(&self) -> Retained<NSString>;
191
192 #[unsafe(method(voice))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn voice(&self) -> Retained<AVSpeechSynthesisProviderVoice>;
196
197 #[unsafe(method(initWithSSMLRepresentation:voice:))]
198 #[unsafe(method_family = init)]
199 pub unsafe fn initWithSSMLRepresentation_voice(
200 this: Allocated<Self>,
201 text: &NSString,
202 voice: &AVSpeechSynthesisProviderVoice,
203 ) -> Retained<Self>;
204
205 #[unsafe(method(init))]
206 #[unsafe(method_family = init)]
207 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
208
209 #[unsafe(method(new))]
210 #[unsafe(method_family = new)]
211 pub unsafe fn new() -> Retained<Self>;
212 );
213}
214
215#[cfg(all(feature = "AVSpeechSynthesis", feature = "block2"))]
223pub type AVSpeechSynthesisProviderOutputBlock = *mut block2::Block<
224 dyn Fn(NonNull<NSArray<AVSpeechSynthesisMarker>>, NonNull<AVSpeechSynthesisProviderRequest>),
225>;
226
227extern_class!(
228 #[unsafe(super(AUAudioUnit, NSObject))]
230 #[derive(Debug, PartialEq, Eq, Hash)]
231 #[cfg(feature = "objc2-audio-toolbox")]
232 #[cfg(not(target_os = "watchos"))]
233 pub struct AVSpeechSynthesisProviderAudioUnit;
234);
235
236#[cfg(feature = "objc2-audio-toolbox")]
237#[cfg(not(target_os = "watchos"))]
238unsafe impl NSObjectProtocol for AVSpeechSynthesisProviderAudioUnit {}
239
240#[cfg(feature = "objc2-audio-toolbox")]
241#[cfg(not(target_os = "watchos"))]
242impl AVSpeechSynthesisProviderAudioUnit {
243 extern_methods!(
244 #[unsafe(method(speechVoices))]
249 #[unsafe(method_family = none)]
250 pub unsafe fn speechVoices(&self) -> Retained<NSArray<AVSpeechSynthesisProviderVoice>>;
251
252 #[unsafe(method(setSpeechVoices:))]
254 #[unsafe(method_family = none)]
255 pub unsafe fn setSpeechVoices(
256 &self,
257 speech_voices: &NSArray<AVSpeechSynthesisProviderVoice>,
258 );
259
260 #[cfg(all(feature = "AVSpeechSynthesis", feature = "block2"))]
261 #[unsafe(method(speechSynthesisOutputMetadataBlock))]
267 #[unsafe(method_family = none)]
268 pub unsafe fn speechSynthesisOutputMetadataBlock(
269 &self,
270 ) -> AVSpeechSynthesisProviderOutputBlock;
271
272 #[cfg(all(feature = "AVSpeechSynthesis", feature = "block2"))]
273 #[unsafe(method(setSpeechSynthesisOutputMetadataBlock:))]
275 #[unsafe(method_family = none)]
276 pub unsafe fn setSpeechSynthesisOutputMetadataBlock(
277 &self,
278 speech_synthesis_output_metadata_block: AVSpeechSynthesisProviderOutputBlock,
279 );
280
281 #[unsafe(method(synthesizeSpeechRequest:))]
288 #[unsafe(method_family = none)]
289 pub unsafe fn synthesizeSpeechRequest(
290 &self,
291 speech_request: &AVSpeechSynthesisProviderRequest,
292 );
293
294 #[unsafe(method(cancelSpeechRequest))]
296 #[unsafe(method_family = none)]
297 pub unsafe fn cancelSpeechRequest(&self);
298 );
299}
300
301#[cfg(feature = "objc2-audio-toolbox")]
303#[cfg(not(target_os = "watchos"))]
304impl AVSpeechSynthesisProviderAudioUnit {
305 extern_methods!(
306 #[unsafe(method(init))]
307 #[unsafe(method_family = init)]
308 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
309
310 #[unsafe(method(initWithComponentDescription:options:error:_))]
320 #[unsafe(method_family = init)]
321 pub unsafe fn initWithComponentDescription_options_error(
322 this: Allocated<Self>,
323 component_description: AudioComponentDescription,
324 options: AudioComponentInstantiationOptions,
325 ) -> Result<Retained<Self>, Retained<NSError>>;
326
327 #[unsafe(method(initWithComponentDescription:error:_))]
329 #[unsafe(method_family = init)]
330 pub unsafe fn initWithComponentDescription_error(
331 this: Allocated<Self>,
332 component_description: AudioComponentDescription,
333 ) -> Result<Retained<Self>, Retained<NSError>>;
334 );
335}
336
337#[cfg(feature = "objc2-audio-toolbox")]
339#[cfg(not(target_os = "watchos"))]
340impl AVSpeechSynthesisProviderAudioUnit {
341 extern_methods!(
342 #[unsafe(method(new))]
343 #[unsafe(method_family = new)]
344 pub unsafe fn new() -> Retained<Self>;
345 );
346}