//! 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!(
/// A textual representation of the specified speech in its entirety, as recognized by the speech recognizer.
///
/// Use `SFTranscription` to obtain all the recognized utterances from your audio content. An _utterance_ is a vocalized word or group of words that represent a single meaning to the speech recognizer (``SFSpeechRecognizer``).
///
/// Use the ``formattedString`` property to retrieve the entire transcription of utterances, or use the ``segments`` property to retrieve an individual utterance (``SFTranscriptionSegment``).
///
/// You don't create an `SFTranscription` directly. Instead, you retrieve it from an ``SFSpeechRecognitionResult`` instance. The speech recognizer sends a speech recognition result to your app in one of two ways, depending on how your app started a speech recognition task.
///
/// You can start a speech recognition task by using the speech recognizer's ``SFSpeechRecognizer/recognitionTask(with:resultHandler:)`` method. When the task is complete, the speech recognizer sends an ``SFSpeechRecognitionResult`` instance to your `resultHandler` closure. Alternatively, you can use the speech recognizer's ``SFSpeechRecognizer/recognitionTask(with:delegate:)`` method to start a speech recognition task. When the task is complete, the speech recognizer uses your ``SFSpeechRecognitionTaskDelegate`` to send an ``SFSpeechRecognitionResult`` by using the delegate's ``SFSpeechRecognitionTaskDelegate/speechRecognitionTask(_:didFinishRecognition:)`` method.
///
/// An `SFTranscription` represents only a potential version of the speech. It might not be an accurate representation of the utterances.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/speech/sftranscription?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct SFTranscription;
);
extern_conformance!(
unsafe impl NSCoding for SFTranscription {}
);
extern_conformance!(
unsafe impl NSCopying for SFTranscription {}
);
unsafe impl CopyingHelper for SFTranscription {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for SFTranscription {}
);
extern_conformance!(
unsafe impl NSSecureCoding for SFTranscription {}
);
impl SFTranscription {
extern_methods!(
/// The entire transcription of utterances, formatted into a single, user-displayable string.
#[unsafe(method(formattedString))]
#[unsafe(method_family = none)]
pub unsafe fn formattedString(&self) -> Retained<NSString>;
#[cfg(feature = "SFTranscriptionSegment")]
/// An array of transcription segments that represent the parts of the transcription, as identified by the speech recognizer.
///
/// The order of the segments in the array matches the order in which the corresponding utterances occur in the spoken content.
#[unsafe(method(segments))]
#[unsafe(method_family = none)]
pub unsafe fn segments(&self) -> Retained<NSArray<SFTranscriptionSegment>>;
/// The number of words spoken per minute.
#[deprecated = "speakingRate is moved to SFSpeechRecognitionMetadata"]
#[unsafe(method(speakingRate))]
#[unsafe(method_family = none)]
pub unsafe fn speakingRate(&self) -> c_double;
/// The average pause duration between words, measured in seconds.
#[deprecated = "averagePauseDuration is moved to SFSpeechRecognitionMetadata"]
#[unsafe(method(averagePauseDuration))]
#[unsafe(method_family = none)]
pub unsafe fn averagePauseDuration(&self) -> NSTimeInterval;
);
}
/// Methods declared on superclass `NSObject`.
impl SFTranscription {
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>;
);
}