Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions src/speech.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,15 @@ public enum SFSpeechErrorCode : long {
AudioReadFailed = 2,
UndefinedTemplateClassName = 7,
MalformedSupplementalModel = 8,
#if XAMCORE_5_0
Timeout = 12,
#else
// Apple changed the value for 'Timeout' from 10 to 12 in Xcode 26.
[Obsolete ("Use 'Timeout2' instead'.")]
Timeout = 10,
Timeout2 = 12,
#endif
MissingParameter = 13,
}

/// <summary>Abstract base class for speech recognition requests (see <see cref="Speech.SFSpeechAudioBufferRecognitionRequest" /> and <see cref="Speech.SFSpeechUrlRecognitionRequest" />).</summary>
Expand Down Expand Up @@ -468,20 +476,51 @@ interface SFSpeechLanguageModelConfiguration : NSCopying, NSSecureCoding {

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

[TV (26, 0), Mac (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[NullAllowed, Export ("weight", ArgumentSemantic.Copy)]
[BindAs (typeof (float?))]
NSNumber Weight { get; }

[TV (26, 0), Mac (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Export ("initWithLanguageModel:vocabulary:weight:")]
NativeHandle Constructor (NSUrl languageModel, [NullAllowed] NSUrl vocabulary, [NullAllowed][BindAs (typeof (float?))] NSNumber weight);
}

[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0), TV (18, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SFSpeechLanguageModel {
[Deprecated (PlatformName.iOS, 26, 0, message: "Use the 'PrepareCustomModel' overload that takes a 'SFSpeechLanguageModelConfiguration' instead.")]
[Deprecated (PlatformName.MacOSX, 26, 0, message: "Use the 'PrepareCustomModel' overload that takes a 'SFSpeechLanguageModelConfiguration' instead.")]
[Deprecated (PlatformName.TvOS, 26, 0, message: "Use the 'PrepareCustomModel' overload that takes a 'SFSpeechLanguageModelConfiguration' instead.")]
[Deprecated (PlatformName.MacCatalyst, 26, 0, message: "Use the 'PrepareCustomModel' overload that takes a 'SFSpeechLanguageModelConfiguration' instead.")]
[Static]
[Export ("prepareCustomLanguageModelForUrl:clientIdentifier:configuration:completion:")]
[Async]
void PrepareCustomModel (NSUrl asset, string clientIdentifier, SFSpeechLanguageModelConfiguration configuration, Action<NSError> completion);

[Deprecated (PlatformName.iOS, 26, 0, message: "Use the 'PrepareCustomModel' overload that takes a 'SFSpeechLanguageModelConfiguration' instead.")]
[Deprecated (PlatformName.MacOSX, 26, 0, message: "Use the 'PrepareCustomModel' overload that takes a 'SFSpeechLanguageModelConfiguration' instead.")]
[Deprecated (PlatformName.TvOS, 26, 0, message: "Use the 'PrepareCustomModel' overload that takes a 'SFSpeechLanguageModelConfiguration' instead.")]
[Deprecated (PlatformName.MacCatalyst, 26, 0, message: "Use the 'PrepareCustomModel' overload that takes a 'SFSpeechLanguageModelConfiguration' instead.")]
[Static]
[Export ("prepareCustomLanguageModelForUrl:clientIdentifier:configuration:ignoresCache:completion:")]
[Async]
void PrepareCustomModel (NSUrl asset, string clientIdentifier, SFSpeechLanguageModelConfiguration configuration, bool ignoresCache, Action<NSError> completion);

[iOS (26, 0), TV (26, 0), MacCatalyst (26, 0), Mac (26, 0)]
[Async]
[Static]
[Export ("prepareCustomLanguageModelForUrl:configuration:completion:")]
void PrepareCustomModel (NSUrl asset, SFSpeechLanguageModelConfiguration configuration, SFSpeechLanguageModelPrepareCustomModelHandler completion);

[iOS (26, 0), TV (26, 0), MacCatalyst (26, 0), Mac (26, 0)]
[Async]
[Static]
[Export ("prepareCustomLanguageModelForUrl:configuration:ignoresCache:completion:")]
void PrepareCustomModel (NSUrl asset, SFSpeechLanguageModelConfiguration configuration, bool ignoresCache, SFSpeechLanguageModelPrepareCustomModelHandler completion);
}

delegate void SFSpeechLanguageModelPrepareCustomModelHandler ([NullAllowed] NSError error);
}
6 changes: 5 additions & 1 deletion tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6275,7 +6275,8 @@ F:SoundAnalysis.SNTimeDurationConstraintType.Range
F:Speech.SFSpeechErrorCode.AudioReadFailed
F:Speech.SFSpeechErrorCode.InternalServiceError
F:Speech.SFSpeechErrorCode.MalformedSupplementalModel
F:Speech.SFSpeechErrorCode.Timeout
F:Speech.SFSpeechErrorCode.MissingParameter
F:Speech.SFSpeechErrorCode.Timeout2
F:Speech.SFSpeechErrorCode.UndefinedTemplateClassName
F:StoreKit.SKAdNetworkCoarseConversionValue.High
F:StoreKit.SKAdNetworkCoarseConversionValue.Low
Expand Down Expand Up @@ -16586,6 +16587,8 @@ M:SoundAnalysis.SNTimeDurationConstraint.#ctor(CoreMedia.CMTime[])
M:SoundAnalysis.SNTimeDurationConstraint.#ctor(CoreMedia.CMTimeRange)
M:Speech.ISFSpeechRecognitionTaskDelegate.DidProcessAudioDuration(Speech.SFSpeechRecognitionTask,System.Double)
M:Speech.SFAnalysisContextTag.#ctor
M:Speech.SFSpeechLanguageModel.PrepareCustomModelAsync(Foundation.NSUrl,Speech.SFSpeechLanguageModelConfiguration,System.Boolean)
M:Speech.SFSpeechLanguageModel.PrepareCustomModelAsync(Foundation.NSUrl,Speech.SFSpeechLanguageModelConfiguration)
M:Speech.SFSpeechLanguageModel.PrepareCustomModelAsync(Foundation.NSUrl,System.String,Speech.SFSpeechLanguageModelConfiguration,System.Boolean)
M:Speech.SFSpeechLanguageModel.PrepareCustomModelAsync(Foundation.NSUrl,System.String,Speech.SFSpeechLanguageModelConfiguration)
M:Speech.SFSpeechRecognitionTaskDelegate_Extensions.DidProcessAudioDuration(Speech.ISFSpeechRecognitionTaskDelegate,Speech.SFSpeechRecognitionTask,System.Double)
Expand Down Expand Up @@ -29207,6 +29210,7 @@ T:SoundAnalysis.SNErrorCode
T:SoundAnalysis.SNTimeDurationConstraint
T:SoundAnalysis.SNTimeDurationConstraintType
T:Speech.SFSpeechErrorCode
T:Speech.SFSpeechLanguageModelPrepareCustomModelHandler
T:Speech.SFSpeechRecognitionTaskHint
T:SpriteKit.SKNodeEvent_NSEvent
T:SpriteKit.SKTextureAtlasLoadCallback
Expand Down

This file was deleted.

7 changes: 0 additions & 7 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-Speech.todo

This file was deleted.

7 changes: 0 additions & 7 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-Speech.todo

This file was deleted.

Loading