Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Speech] Add support for Xcode 15 #19075

Merged
merged 3 commits into from Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
57 changes: 57 additions & 0 deletions src/speech.cs
Expand Up @@ -49,6 +49,15 @@ public enum SFSpeechRecognizerAuthorizationStatus : long {
Authorized,
}

[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Native]
[ErrorDomain ("SFSpeechErrorDomain")]
public enum SFSpeechErrorCode : long {
InternalServiceError = 1,
UndefinedTemplateClassName = 7,
MalformedSupplementalModel = 8,
}

[MacCatalyst (13, 1)]
[DisableDefaultCtor]
[Abstract] // no docs (yet) but it has no means (init*) to create it, unlike its subclasses
Expand Down Expand Up @@ -77,6 +86,10 @@ interface SFSpeechRecognitionRequest {
[Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0)]
[Export ("addsPunctuation")]
bool AddsPunctuation { get; set; }

[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[NullAllowed, Export ("customizedLanguageModel", ArgumentSemantic.Copy)]
SFSpeechLanguageModelConfiguration CustomizedLanguageModel { get; set; }
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -347,4 +360,48 @@ interface SFVoiceAnalytics : NSCopying, NSSecureCoding {
[Export ("voicing", ArgumentSemantic.Copy)]
SFAcousticFeature Voicing { get; }
}

[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
interface SFSpeechLanguageModelConfiguration : NSCopying {
[Export ("initWithLanguageModel:")]
NativeHandle Constructor (NSUrl languageModel);

[Export ("initWithLanguageModel:vocabulary:")]
NativeHandle Constructor (NSUrl languageModel, [NullAllowed] NSUrl vocabulary);

[Export ("languageModel", ArgumentSemantic.Copy)]
NSUrl LanguageModel { get; }

[NullAllowed, Export ("vocabulary", ArgumentSemantic.Copy)]
NSUrl Vocabulary { get; }
}

[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SFSpeechLanguageModel {
[Static]
[Export ("prepareCustomLanguageModelForUrl:clientIdentifier:configuration:completion:")]
[Async]
void PrepareCustomModel (NSUrl asset, string clientIdentifier, SFSpeechLanguageModelConfiguration configuration, Action<NSError> completion);

[Static]
[Export ("prepareCustomLanguageModelForUrl:clientIdentifier:configuration:ignoresCache:completion:")]
[Async]
void PrepareCustomModel (NSUrl asset, string clientIdentifier, SFSpeechLanguageModelConfiguration configuration, bool ignoresCache, Action<NSError> completion);
}

[Partial]
[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
interface SFAnalysisContextTag {
[Field ("SFAnalysisContextTagLeftContext")]
NSString LeftContext { get; }

[Field ("SFAnalysisContextTagRightContext")]
NSString RightContext { get; }

[Field ("SFAnalysisContextTagSelectedText")]
NSString SelectedText { get; }
}
}
@@ -1,17 +1,13 @@
# xcode 15, these are all private APIs
!missing-enum! _SFCommandRecognizerArgumentPresence not bound
!missing-enum! _SFEARResultType not bound
!missing-enum! _SFTranscriptionOptions not bound
!missing-enum! _SFTranscriptionResultAttributeOptions not bound
!missing-enum! SFSpeechErrorCode not bound
!missing-field! _SFAnalysisContextTagContextualNamedEntities not bound
!missing-field! _SFAnalysisContextTagGeoLMRegionID not bound
!missing-field! _SFAnalysisContextTagLeftContext not bound
!missing-field! _SFAnalysisContextTagRightContext not bound
!missing-field! _SFAnalysisContextTagSelectedText not bound
!missing-field! SFAnalysisContextTagLeftContext not bound
!missing-field! SFAnalysisContextTagRightContext not bound
!missing-field! SFAnalysisContextTagSelectedText not bound
!missing-field! SFSpeechErrorDomain not bound
!missing-protocol! _SFSpeechAnalyzerEndpointingResultDelegate not bound
!missing-protocol! _SFSpeechAnalyzerTranscriberResultDelegate not bound
!missing-selector! _SFAnalysisContext::contextualNamedEntities not bound
Expand Down Expand Up @@ -119,14 +115,6 @@
!missing-selector! _STTranscriberMultisegmentResult::segments not bound
!missing-selector! _STTranscriberMultisegmentResult::transcriptions not bound
!missing-selector! +_SFSpeechAnalyzer::modelDownloadRequestForClientIdentifier:transcriberOptions: not bound
!missing-selector! +SFSpeechLanguageModel::prepareCustomLanguageModelForUrl:clientIdentifier:configuration:completion: not bound
!missing-selector! +SFSpeechLanguageModel::prepareCustomLanguageModelForUrl:clientIdentifier:configuration:ignoresCache:completion: not bound
!missing-selector! SFSpeechLanguageModelConfiguration::initWithLanguageModel: not bound
!missing-selector! SFSpeechLanguageModelConfiguration::initWithLanguageModel:vocabulary: not bound
!missing-selector! SFSpeechLanguageModelConfiguration::languageModel not bound
!missing-selector! SFSpeechLanguageModelConfiguration::vocabulary not bound
!missing-selector! SFSpeechRecognitionRequest::customizedLanguageModel not bound
!missing-selector! SFSpeechRecognitionRequest::setCustomizedLanguageModel: not bound
!missing-type! _SFAnalysisContext not bound
!missing-type! _SFAnalyzerTranscriptionSegment not bound
!missing-type! _SFCommandRecognizerArgument not bound
Expand All @@ -146,5 +134,4 @@
!missing-type! _SFTranscriberResult not bound
!missing-type! _STCommandRecognizerResult not bound
!missing-type! _STTranscriberMultisegmentResult not bound
!missing-type! SFSpeechLanguageModel not bound
!missing-type! SFSpeechLanguageModelConfiguration not bound

This file was deleted.

@@ -1,17 +1,13 @@
# xcode 15, these are all private APIs
!missing-enum! _SFCommandRecognizerArgumentPresence not bound
!missing-enum! _SFEARResultType not bound
!missing-enum! _SFTranscriptionOptions not bound
!missing-enum! _SFTranscriptionResultAttributeOptions not bound
!missing-enum! SFSpeechErrorCode not bound
!missing-field! _SFAnalysisContextTagContextualNamedEntities not bound
!missing-field! _SFAnalysisContextTagGeoLMRegionID not bound
!missing-field! _SFAnalysisContextTagLeftContext not bound
!missing-field! _SFAnalysisContextTagRightContext not bound
!missing-field! _SFAnalysisContextTagSelectedText not bound
!missing-field! SFAnalysisContextTagLeftContext not bound
!missing-field! SFAnalysisContextTagRightContext not bound
!missing-field! SFAnalysisContextTagSelectedText not bound
!missing-field! SFSpeechErrorDomain not bound
!missing-protocol! _SFSpeechAnalyzerEndpointingResultDelegate not bound
!missing-protocol! _SFSpeechAnalyzerTranscriberResultDelegate not bound
!missing-selector! _SFAnalysisContext::contextualNamedEntities not bound
Expand Down Expand Up @@ -119,14 +115,6 @@
!missing-selector! _STTranscriberMultisegmentResult::segments not bound
!missing-selector! _STTranscriberMultisegmentResult::transcriptions not bound
!missing-selector! +_SFSpeechAnalyzer::modelDownloadRequestForClientIdentifier:transcriberOptions: not bound
!missing-selector! +SFSpeechLanguageModel::prepareCustomLanguageModelForUrl:clientIdentifier:configuration:completion: not bound
!missing-selector! +SFSpeechLanguageModel::prepareCustomLanguageModelForUrl:clientIdentifier:configuration:ignoresCache:completion: not bound
!missing-selector! SFSpeechLanguageModelConfiguration::initWithLanguageModel: not bound
!missing-selector! SFSpeechLanguageModelConfiguration::initWithLanguageModel:vocabulary: not bound
!missing-selector! SFSpeechLanguageModelConfiguration::languageModel not bound
!missing-selector! SFSpeechLanguageModelConfiguration::vocabulary not bound
!missing-selector! SFSpeechRecognitionRequest::customizedLanguageModel not bound
!missing-selector! SFSpeechRecognitionRequest::setCustomizedLanguageModel: not bound
!missing-type! _SFAnalysisContext not bound
!missing-type! _SFAnalyzerTranscriptionSegment not bound
!missing-type! _SFCommandRecognizerArgument not bound
Expand All @@ -146,5 +134,4 @@
!missing-type! _SFTranscriberResult not bound
!missing-type! _STCommandRecognizerResult not bound
!missing-type! _STTranscriberMultisegmentResult not bound
!missing-type! SFSpeechLanguageModel not bound
!missing-type! SFSpeechLanguageModelConfiguration not bound

@@ -1,17 +1,13 @@
# xcode 15, these are all private APIs
!missing-enum! _SFCommandRecognizerArgumentPresence not bound
!missing-enum! _SFEARResultType not bound
!missing-enum! _SFTranscriptionOptions not bound
!missing-enum! _SFTranscriptionResultAttributeOptions not bound
!missing-enum! SFSpeechErrorCode not bound
!missing-field! _SFAnalysisContextTagContextualNamedEntities not bound
!missing-field! _SFAnalysisContextTagGeoLMRegionID not bound
!missing-field! _SFAnalysisContextTagLeftContext not bound
!missing-field! _SFAnalysisContextTagRightContext not bound
!missing-field! _SFAnalysisContextTagSelectedText not bound
!missing-field! SFAnalysisContextTagLeftContext not bound
!missing-field! SFAnalysisContextTagRightContext not bound
!missing-field! SFAnalysisContextTagSelectedText not bound
!missing-field! SFSpeechErrorDomain not bound
!missing-protocol! _SFSpeechAnalyzerEndpointingResultDelegate not bound
!missing-protocol! _SFSpeechAnalyzerTranscriberResultDelegate not bound
!missing-selector! _SFAnalysisContext::contextualNamedEntities not bound
Expand Down Expand Up @@ -119,14 +115,6 @@
!missing-selector! _STTranscriberMultisegmentResult::segments not bound
!missing-selector! _STTranscriberMultisegmentResult::transcriptions not bound
!missing-selector! +_SFSpeechAnalyzer::modelDownloadRequestForClientIdentifier:transcriberOptions: not bound
!missing-selector! +SFSpeechLanguageModel::prepareCustomLanguageModelForUrl:clientIdentifier:configuration:completion: not bound
!missing-selector! +SFSpeechLanguageModel::prepareCustomLanguageModelForUrl:clientIdentifier:configuration:ignoresCache:completion: not bound
!missing-selector! SFSpeechLanguageModelConfiguration::initWithLanguageModel: not bound
!missing-selector! SFSpeechLanguageModelConfiguration::initWithLanguageModel:vocabulary: not bound
!missing-selector! SFSpeechLanguageModelConfiguration::languageModel not bound
!missing-selector! SFSpeechLanguageModelConfiguration::vocabulary not bound
!missing-selector! SFSpeechRecognitionRequest::customizedLanguageModel not bound
!missing-selector! SFSpeechRecognitionRequest::setCustomizedLanguageModel: not bound
!missing-type! _SFAnalysisContext not bound
!missing-type! _SFAnalyzerTranscriptionSegment not bound
!missing-type! _SFCommandRecognizerArgument not bound
Expand All @@ -146,5 +134,4 @@
!missing-type! _SFTranscriberResult not bound
!missing-type! _STCommandRecognizerResult not bound
!missing-type! _STTranscriberMultisegmentResult not bound
!missing-type! SFSpeechLanguageModel not bound
!missing-type! SFSpeechLanguageModelConfiguration not bound

@@ -1,17 +1,13 @@
# xcode 15, these are all private APIs
!missing-enum! _SFCommandRecognizerArgumentPresence not bound
!missing-enum! _SFEARResultType not bound
!missing-enum! _SFTranscriptionOptions not bound
!missing-enum! _SFTranscriptionResultAttributeOptions not bound
!missing-enum! SFSpeechErrorCode not bound
!missing-field! _SFAnalysisContextTagContextualNamedEntities not bound
!missing-field! _SFAnalysisContextTagGeoLMRegionID not bound
!missing-field! _SFAnalysisContextTagLeftContext not bound
!missing-field! _SFAnalysisContextTagRightContext not bound
!missing-field! _SFAnalysisContextTagSelectedText not bound
!missing-field! SFAnalysisContextTagLeftContext not bound
!missing-field! SFAnalysisContextTagRightContext not bound
!missing-field! SFAnalysisContextTagSelectedText not bound
!missing-field! SFSpeechErrorDomain not bound
!missing-protocol! _SFSpeechAnalyzerEndpointingResultDelegate not bound
!missing-protocol! _SFSpeechAnalyzerTranscriberResultDelegate not bound
!missing-selector! _SFAnalysisContext::contextualNamedEntities not bound
Expand Down Expand Up @@ -119,14 +115,6 @@
!missing-selector! _STTranscriberMultisegmentResult::segments not bound
!missing-selector! _STTranscriberMultisegmentResult::transcriptions not bound
!missing-selector! +_SFSpeechAnalyzer::modelDownloadRequestForClientIdentifier:transcriberOptions: not bound
!missing-selector! +SFSpeechLanguageModel::prepareCustomLanguageModelForUrl:clientIdentifier:configuration:completion: not bound
!missing-selector! +SFSpeechLanguageModel::prepareCustomLanguageModelForUrl:clientIdentifier:configuration:ignoresCache:completion: not bound
!missing-selector! SFSpeechLanguageModelConfiguration::initWithLanguageModel: not bound
!missing-selector! SFSpeechLanguageModelConfiguration::initWithLanguageModel:vocabulary: not bound
!missing-selector! SFSpeechLanguageModelConfiguration::languageModel not bound
!missing-selector! SFSpeechLanguageModelConfiguration::vocabulary not bound
!missing-selector! SFSpeechRecognitionRequest::customizedLanguageModel not bound
!missing-selector! SFSpeechRecognitionRequest::setCustomizedLanguageModel: not bound
!missing-type! _SFAnalysisContext not bound
!missing-type! _SFAnalyzerTranscriptionSegment not bound
!missing-type! _SFCommandRecognizerArgument not bound
Expand All @@ -146,5 +134,4 @@
!missing-type! _SFTranscriberResult not bound
!missing-type! _STCommandRecognizerResult not bound
!missing-type! _STTranscriberMultisegmentResult not bound
!missing-type! SFSpeechLanguageModel not bound
!missing-type! SFSpeechLanguageModelConfiguration not bound