objc2-speech 0.3.2

Bindings to the Speech framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// The metadata of speech in the audio of a speech recognition request.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/speech/sfspeechrecognitionmetadata?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct SFSpeechRecognitionMetadata;
);

extern_conformance!(
    unsafe impl NSCoding for SFSpeechRecognitionMetadata {}
);

extern_conformance!(
    unsafe impl NSCopying for SFSpeechRecognitionMetadata {}
);

unsafe impl CopyingHelper for SFSpeechRecognitionMetadata {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for SFSpeechRecognitionMetadata {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for SFSpeechRecognitionMetadata {}
);

impl SFSpeechRecognitionMetadata {
    extern_methods!(
        /// The number of words spoken per minute.
        #[unsafe(method(speakingRate))]
        #[unsafe(method_family = none)]
        pub unsafe fn speakingRate(&self) -> c_double;

        /// The average pause duration between words, measured in seconds.
        #[unsafe(method(averagePauseDuration))]
        #[unsafe(method_family = none)]
        pub unsafe fn averagePauseDuration(&self) -> NSTimeInterval;

        /// The start timestamp of speech in the audio.
        #[unsafe(method(speechStartTimestamp))]
        #[unsafe(method_family = none)]
        pub unsafe fn speechStartTimestamp(&self) -> NSTimeInterval;

        /// The duration in seconds of speech in the audio.
        #[unsafe(method(speechDuration))]
        #[unsafe(method_family = none)]
        pub unsafe fn speechDuration(&self) -> NSTimeInterval;

        #[cfg(feature = "SFVoiceAnalytics")]
        /// An analysis of the transcription segment's vocal properties.
        #[unsafe(method(voiceAnalytics))]
        #[unsafe(method_family = none)]
        pub unsafe fn voiceAnalytics(&self) -> Option<Retained<SFVoiceAnalytics>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl SFSpeechRecognitionMetadata {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}