objc2_speech/generated/
SFSpeechRecognitionMetadata.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// The metadata of speech in the audio of a speech recognition request.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/speech/sfspeechrecognitionmetadata?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct SFSpeechRecognitionMetadata;
17);
18
19extern_conformance!(
20    unsafe impl NSCoding for SFSpeechRecognitionMetadata {}
21);
22
23extern_conformance!(
24    unsafe impl NSCopying for SFSpeechRecognitionMetadata {}
25);
26
27unsafe impl CopyingHelper for SFSpeechRecognitionMetadata {
28    type Result = Self;
29}
30
31extern_conformance!(
32    unsafe impl NSObjectProtocol for SFSpeechRecognitionMetadata {}
33);
34
35extern_conformance!(
36    unsafe impl NSSecureCoding for SFSpeechRecognitionMetadata {}
37);
38
39impl SFSpeechRecognitionMetadata {
40    extern_methods!(
41        /// The number of words spoken per minute.
42        #[unsafe(method(speakingRate))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn speakingRate(&self) -> c_double;
45
46        /// The average pause duration between words, measured in seconds.
47        #[unsafe(method(averagePauseDuration))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn averagePauseDuration(&self) -> NSTimeInterval;
50
51        /// The start timestamp of speech in the audio.
52        #[unsafe(method(speechStartTimestamp))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn speechStartTimestamp(&self) -> NSTimeInterval;
55
56        /// The duration in seconds of speech in the audio.
57        #[unsafe(method(speechDuration))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn speechDuration(&self) -> NSTimeInterval;
60
61        #[cfg(feature = "SFVoiceAnalytics")]
62        /// An analysis of the transcription segment's vocal properties.
63        #[unsafe(method(voiceAnalytics))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn voiceAnalytics(&self) -> Option<Retained<SFVoiceAnalytics>>;
66    );
67}
68
69/// Methods declared on superclass `NSObject`.
70impl SFSpeechRecognitionMetadata {
71    extern_methods!(
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76        #[unsafe(method(new))]
77        #[unsafe(method_family = new)]
78        pub unsafe fn new() -> Retained<Self>;
79    );
80}