Skip to content

Commit 34dfc2c

Browse files
authored
[Speech] Implement Xcode 16.0 beta 1-6 changes. (#21077)
There were no changes in beta 2, beta 4, beta 5 or beta 6.
1 parent fa7e84d commit 34dfc2c

File tree

8 files changed

+32
-34
lines changed

8 files changed

+32
-34
lines changed

src/speech.cs

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace Speech {
2525

2626
/// <summary>Enumerates the states of a <see cref="T:Speech.SFSpeechRecognitionTask" />.</summary>
2727
[Native]
28-
[MacCatalyst (13, 1)]
28+
[MacCatalyst (13, 1), TV (18, 0)]
2929
public enum SFSpeechRecognitionTaskState : long {
3030
Starting = 0,
3131
Running = 1,
@@ -35,7 +35,7 @@ public enum SFSpeechRecognitionTaskState : long {
3535
}
3636

3737
[Native]
38-
[MacCatalyst (13, 1)]
38+
[MacCatalyst (13, 1), TV (18, 0)]
3939
public enum SFSpeechRecognitionTaskHint : long {
4040
Unspecified = 0,
4141
Dictation = 1,
@@ -45,27 +45,28 @@ public enum SFSpeechRecognitionTaskHint : long {
4545

4646
/// <include file="../docs/api/Speech/SFSpeechRecognizerAuthorizationStatus.xml" path="/Documentation/Docs[@DocId='T:Speech.SFSpeechRecognizerAuthorizationStatus']/*" />
4747
[Native]
48-
[MacCatalyst (13, 1)]
48+
[MacCatalyst (13, 1), TV (18, 0)]
4949
public enum SFSpeechRecognizerAuthorizationStatus : long {
5050
NotDetermined,
5151
Denied,
5252
Restricted,
5353
Authorized,
5454
}
5555

56-
[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
56+
[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0), TV (18, 0)]
5757
[Native]
5858
[ErrorDomain ("SFSpeechErrorDomain")]
5959
public enum SFSpeechErrorCode : long {
6060
InternalServiceError = 1,
61+
AudioReadFailed = 2,
6162
UndefinedTemplateClassName = 7,
6263
MalformedSupplementalModel = 8,
6364
}
6465

6566
/// <summary>Abstract base class for speech recognition requests (see <see cref="T:Speech.SFSpeechAudioBufferRecognitionRequest" /> and <see cref="T:Speech.SFSpeechUrlRecognitionRequest" />).</summary>
6667
///
6768
/// <related type="externalDocumentation" href="https://developer.apple.com/reference/Speech/SFSpeechRecognitionRequest">Apple documentation for <c>SFSpeechRecognitionRequest</c></related>
68-
[MacCatalyst (13, 1)]
69+
[MacCatalyst (13, 1), TV (18, 0)]
6970
[DisableDefaultCtor]
7071
[Abstract] // no docs (yet) but it has no means (init*) to create it, unlike its subclasses
7172
[BaseType (typeof (NSObject))]
@@ -82,6 +83,7 @@ interface SFSpeechRecognitionRequest {
8283

8384
[Deprecated (PlatformName.iOS, 15, 0)]
8485
[Deprecated (PlatformName.MacCatalyst, 15, 0)]
86+
[Deprecated (PlatformName.MacOSX, 12, 0)]
8587
[NullAllowed, Export ("interactionIdentifier")]
8688
string InteractionIdentifier { get; set; }
8789

@@ -102,7 +104,7 @@ interface SFSpeechRecognitionRequest {
102104
/// <summary>A <see cref="T:Speech.SFSpeechRecognitionRequest" /> whose audio source is specified in a URL</summary>
103105
///
104106
/// <related type="externalDocumentation" href="https://developer.apple.com/reference/Speech/SFSpeechURLRecognitionRequest">Apple documentation for <c>SFSpeechURLRecognitionRequest</c></related>
105-
[MacCatalyst (13, 1)]
107+
[MacCatalyst (13, 1), TV (18, 0)]
106108
[BaseType (typeof (SFSpeechRecognitionRequest), Name = "SFSpeechURLRecognitionRequest")]
107109
[DisableDefaultCtor]
108110
interface SFSpeechUrlRecognitionRequest {
@@ -118,7 +120,7 @@ interface SFSpeechUrlRecognitionRequest {
118120
/// <summary>An <see cref="T:Speech.SFSpeechRecognitionRequest" /> that takes its input from an audio buffer.</summary>
119121
///
120122
/// <related type="externalDocumentation" href="https://developer.apple.com/reference/Speech/SFSpeechAudioBufferRecognitionRequest">Apple documentation for <c>SFSpeechAudioBufferRecognitionRequest</c></related>
121-
[MacCatalyst (13, 1)]
123+
[MacCatalyst (13, 1), TV (18, 0)]
122124
[BaseType (typeof (SFSpeechRecognitionRequest))]
123125
interface SFSpeechAudioBufferRecognitionRequest {
124126

@@ -141,7 +143,7 @@ interface SFSpeechAudioBufferRecognitionRequest {
141143
/// <see cref="T:Speech.SFSpeechRecognitionResult" />contain a <see cref="T:Speech.SFTranscription" /> in<see cref="P:Speech.SFSpeechRecognitionResult.BestTranscription" /> that is the highest-confidence transcription. Additionally, the <see cref="P:Speech.SFSpeechRecognitionResult.Transcriptions" /> may contain additional <see cref="T:Speech.SFTranscription" /> objects that the developer may search for more domain-appropriate results.</para>
142144
/// </remarks>
143145
/// <related type="externalDocumentation" href="https://developer.apple.com/reference/Speech/SFSpeechRecognitionResult">Apple documentation for <c>SFSpeechRecognitionResult</c></related>
144-
[MacCatalyst (13, 1)]
146+
[MacCatalyst (13, 1), TV (18, 0)]
145147
[BaseType (typeof (NSObject))]
146148
interface SFSpeechRecognitionResult : NSCopying, NSSecureCoding {
147149

@@ -163,7 +165,7 @@ interface SFSpeechRecognitionResult : NSCopying, NSSecureCoding {
163165
/// <summary>Object that holds state and provides control of an asynchronous speech recognition task.</summary>
164166
///
165167
/// <related type="externalDocumentation" href="https://developer.apple.com/reference/Speech/SFSpeechRecognitionTask">Apple documentation for <c>SFSpeechRecognitionTask</c></related>
166-
[MacCatalyst (13, 1)]
168+
[MacCatalyst (13, 1), TV (18, 0)]
167169
[BaseType (typeof (NSObject))]
168170
interface SFSpeechRecognitionTask {
169171

@@ -197,7 +199,7 @@ interface ISFSpeechRecognitionTaskDelegate { }
197199
/// <summary>Delegate object whose members are called in reaction to speech-recognition events.</summary>
198200
///
199201
/// <related type="externalDocumentation" href="https://developer.apple.com/reference/Speech/SFSpeechRecognitionTaskDelegate">Apple documentation for <c>SFSpeechRecognitionTaskDelegate</c></related>
200-
[MacCatalyst (13, 1)]
202+
[MacCatalyst (13, 1), TV (18, 0)]
201203
[Protocol, Model]
202204
[BaseType (typeof (NSObject))]
203205
interface SFSpeechRecognitionTaskDelegate {
@@ -219,6 +221,10 @@ interface SFSpeechRecognitionTaskDelegate {
219221

220222
[Export ("speechRecognitionTask:didFinishSuccessfully:")]
221223
void DidFinishSuccessfully (SFSpeechRecognitionTask task, bool successfully);
224+
225+
[iOS (18, 0), Mac (10, 15), TV (18, 0)]
226+
[Export ("speechRecognitionTask:didProcessAudioDuration:")]
227+
void DidProcessAudioDuration (SFSpeechRecognitionTask task, double duration);
222228
}
223229

224230
/// <summary>Interface representing the required methods (if any) of the protocol <see cref="T:Speech.SFSpeechRecognizerDelegate" />.</summary>
@@ -232,7 +238,7 @@ interface ISFSpeechRecognizerDelegate { }
232238
/// <summary>Delegate object for <see cref="T:Speech.SFSpeechRecognizer" />.</summary>
233239
///
234240
/// <related type="externalDocumentation" href="https://developer.apple.com/reference/Speech/SFSpeechRecognizerDelegate">Apple documentation for <c>SFSpeechRecognizerDelegate</c></related>
235-
[MacCatalyst (13, 1)]
241+
[MacCatalyst (13, 1), TV (18, 0)]
236242
[Protocol, Model]
237243
[BaseType (typeof (NSObject))]
238244
interface SFSpeechRecognizerDelegate {
@@ -242,7 +248,7 @@ interface SFSpeechRecognizerDelegate {
242248
}
243249

244250
/// <include file="../docs/api/Speech/SFSpeechRecognizer.xml" path="/Documentation/Docs[@DocId='T:Speech.SFSpeechRecognizer']/*" />
245-
[MacCatalyst (13, 1)]
251+
[MacCatalyst (13, 1), TV (18, 0)]
246252
[BaseType (typeof (NSObject))]
247253
interface SFSpeechRecognizer {
248254

@@ -290,7 +296,7 @@ interface SFSpeechRecognizer {
290296
NSOperationQueue Queue { get; set; }
291297
}
292298

293-
[iOS (14, 5), Mac (11, 3)]
299+
[iOS (14, 5), Mac (11, 3), TV (18, 0)]
294300
[MacCatalyst (14, 5)]
295301
[BaseType (typeof (NSObject))]
296302
[DisableDefaultCtor]
@@ -315,7 +321,7 @@ interface SFSpeechRecognitionMetadata : NSCopying, NSSecureCoding {
315321
/// <summary>A conversion of speech into text.</summary>
316322
///
317323
/// <related type="externalDocumentation" href="https://developer.apple.com/reference/Speech/SFTranscription">Apple documentation for <c>SFTranscription</c></related>
318-
[MacCatalyst (13, 1)]
324+
[MacCatalyst (13, 1), TV (18, 0)]
319325
[BaseType (typeof (NSObject))]
320326
interface SFTranscription : NSCopying, NSSecureCoding {
321327

@@ -330,6 +336,7 @@ interface SFTranscription : NSCopying, NSSecureCoding {
330336
[Deprecated (PlatformName.iOS, 14, 5)]
331337
[MacCatalyst (13, 1)]
332338
[Deprecated (PlatformName.MacCatalyst, 14, 5)]
339+
[Deprecated (PlatformName.TvOS, 14, 5)]
333340
[Advice ("Use 'SpeakingRate' from 'SFSpeechRecognitionMetadata' instead.")]
334341
double SpeakingRate { get; }
335342

@@ -338,12 +345,13 @@ interface SFTranscription : NSCopying, NSSecureCoding {
338345
[Deprecated (PlatformName.iOS, 14, 5)]
339346
[MacCatalyst (13, 1)]
340347
[Deprecated (PlatformName.MacCatalyst, 14, 5)]
348+
[Deprecated (PlatformName.TvOS, 14, 5)]
341349
[Advice ("Use 'AveragePauseDuration' from 'SFSpeechRecognitionMetadata' instead.")]
342350
double AveragePauseDuration { get; }
343351
}
344352

345353
/// <related type="externalDocumentation" href="https://developer.apple.com/reference/Speech/SFTranscriptionSegment">Apple documentation for <c>SFTranscriptionSegment</c></related>
346-
[MacCatalyst (13, 1)]
354+
[MacCatalyst (13, 1), TV (18, 0)]
347355
[BaseType (typeof (NSObject))]
348356
interface SFTranscriptionSegment : NSCopying, NSSecureCoding {
349357

@@ -370,12 +378,13 @@ interface SFTranscriptionSegment : NSCopying, NSSecureCoding {
370378
[Deprecated (PlatformName.iOS, 14, 5)]
371379
[MacCatalyst (13, 1)]
372380
[Deprecated (PlatformName.MacCatalyst, 14, 5)]
381+
[Deprecated (PlatformName.TvOS, 14, 5)]
373382
[Advice ("Use 'VoiceAnalytics' from 'SFSpeechRecognitionMetadata' instead.")]
374383
SFVoiceAnalytics VoiceAnalytics { get; }
375384
}
376385

377386
[iOS (13, 0)]
378-
[MacCatalyst (13, 1)]
387+
[MacCatalyst (13, 1), TV (18, 0)]
379388
[BaseType (typeof (NSObject))]
380389
[DisableDefaultCtor]
381390
interface SFAcousticFeature : NSCopying, NSSecureCoding {
@@ -388,7 +397,7 @@ interface SFAcousticFeature : NSCopying, NSSecureCoding {
388397
}
389398

390399
[iOS (13, 0)]
391-
[MacCatalyst (13, 1)]
400+
[MacCatalyst (13, 1), TV (18, 0)]
392401
[BaseType (typeof (NSObject))]
393402
[DisableDefaultCtor]
394403
interface SFVoiceAnalytics : NSCopying, NSSecureCoding {
@@ -406,7 +415,7 @@ interface SFVoiceAnalytics : NSCopying, NSSecureCoding {
406415
SFAcousticFeature Voicing { get; }
407416
}
408417

409-
[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
418+
[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0), TV (18, 0)]
410419
[BaseType (typeof (NSObject))]
411420
interface SFSpeechLanguageModelConfiguration : NSCopying {
412421
[Export ("initWithLanguageModel:")]
@@ -422,7 +431,7 @@ interface SFSpeechLanguageModelConfiguration : NSCopying {
422431
NSUrl Vocabulary { get; }
423432
}
424433

425-
[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
434+
[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0), TV (18, 0)]
426435
[BaseType (typeof (NSObject))]
427436
[DisableDefaultCtor]
428437
interface SFSpeechLanguageModel {

tests/cecil-tests/ApiAvailabilityTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ public void FindMissingObsoleteAttributes ()
246246
"System.String PassKit.PKShareablePassMetadata::LocalizedDescription()",
247247
"System.String PassKit.PKShareablePassMetadata::OwnerDisplayName()",
248248
"System.String PassKit.PKShareablePassMetadata::TemplateIdentifier()",
249-
"System.String Speech.SFSpeechRecognitionRequest::InteractionIdentifier()",
250249
"System.String StoreKit.SKProduct::ContentVersion()",
251250
"System.String UserNotifications.UNMutableNotificationContent::SummaryArgument()",
252251
"System.String UserNotifications.UNNotificationContent::SummaryArgument()",

tests/cecil-tests/Documentation.KnownFailures.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18087,6 +18087,7 @@ F:SoundAnalysis.SNErrorCode.OperationFailed
1808718087
F:SoundAnalysis.SNErrorCode.UnknownError
1808818088
F:SoundAnalysis.SNTimeDurationConstraintType.Enumerated
1808918089
F:SoundAnalysis.SNTimeDurationConstraintType.Range
18090+
F:Speech.SFSpeechErrorCode.AudioReadFailed
1809018091
F:Speech.SFSpeechErrorCode.InternalServiceError
1809118092
F:Speech.SFSpeechErrorCode.MalformedSupplementalModel
1809218093
F:Speech.SFSpeechErrorCode.UndefinedTemplateClassName
@@ -46043,6 +46044,7 @@ M:Speech.ISFSpeechRecognitionTaskDelegate.DidDetectSpeech(Speech.SFSpeechRecogni
4604346044
M:Speech.ISFSpeechRecognitionTaskDelegate.DidFinishRecognition(Speech.SFSpeechRecognitionTask,Speech.SFSpeechRecognitionResult)
4604446045
M:Speech.ISFSpeechRecognitionTaskDelegate.DidFinishSuccessfully(Speech.SFSpeechRecognitionTask,System.Boolean)
4604546046
M:Speech.ISFSpeechRecognitionTaskDelegate.DidHypothesizeTranscription(Speech.SFSpeechRecognitionTask,Speech.SFTranscription)
46047+
M:Speech.ISFSpeechRecognitionTaskDelegate.DidProcessAudioDuration(Speech.SFSpeechRecognitionTask,System.Double)
4604646048
M:Speech.ISFSpeechRecognitionTaskDelegate.FinishedReadingAudio(Speech.SFSpeechRecognitionTask)
4604746049
M:Speech.ISFSpeechRecognitionTaskDelegate.WasCancelled(Speech.SFSpeechRecognitionTask)
4604846050
M:Speech.ISFSpeechRecognizerDelegate.AvailabilityDidChange(Speech.SFSpeechRecognizer,System.Boolean)
@@ -46060,12 +46062,14 @@ M:Speech.SFSpeechRecognitionTaskDelegate_Extensions.DidDetectSpeech(Speech.ISFSp
4606046062
M:Speech.SFSpeechRecognitionTaskDelegate_Extensions.DidFinishRecognition(Speech.ISFSpeechRecognitionTaskDelegate,Speech.SFSpeechRecognitionTask,Speech.SFSpeechRecognitionResult)
4606146063
M:Speech.SFSpeechRecognitionTaskDelegate_Extensions.DidFinishSuccessfully(Speech.ISFSpeechRecognitionTaskDelegate,Speech.SFSpeechRecognitionTask,System.Boolean)
4606246064
M:Speech.SFSpeechRecognitionTaskDelegate_Extensions.DidHypothesizeTranscription(Speech.ISFSpeechRecognitionTaskDelegate,Speech.SFSpeechRecognitionTask,Speech.SFTranscription)
46065+
M:Speech.SFSpeechRecognitionTaskDelegate_Extensions.DidProcessAudioDuration(Speech.ISFSpeechRecognitionTaskDelegate,Speech.SFSpeechRecognitionTask,System.Double)
4606346066
M:Speech.SFSpeechRecognitionTaskDelegate_Extensions.FinishedReadingAudio(Speech.ISFSpeechRecognitionTaskDelegate,Speech.SFSpeechRecognitionTask)
4606446067
M:Speech.SFSpeechRecognitionTaskDelegate_Extensions.WasCancelled(Speech.ISFSpeechRecognitionTaskDelegate,Speech.SFSpeechRecognitionTask)
4606546068
M:Speech.SFSpeechRecognitionTaskDelegate.DidDetectSpeech(Speech.SFSpeechRecognitionTask)
4606646069
M:Speech.SFSpeechRecognitionTaskDelegate.DidFinishRecognition(Speech.SFSpeechRecognitionTask,Speech.SFSpeechRecognitionResult)
4606746070
M:Speech.SFSpeechRecognitionTaskDelegate.DidFinishSuccessfully(Speech.SFSpeechRecognitionTask,System.Boolean)
4606846071
M:Speech.SFSpeechRecognitionTaskDelegate.DidHypothesizeTranscription(Speech.SFSpeechRecognitionTask,Speech.SFTranscription)
46072+
M:Speech.SFSpeechRecognitionTaskDelegate.DidProcessAudioDuration(Speech.SFSpeechRecognitionTask,System.Double)
4606946073
M:Speech.SFSpeechRecognitionTaskDelegate.FinishedReadingAudio(Speech.SFSpeechRecognitionTask)
4607046074
M:Speech.SFSpeechRecognitionTaskDelegate.WasCancelled(Speech.SFSpeechRecognitionTask)
4607146075
M:Speech.SFSpeechRecognizer.Dispose(System.Boolean)

tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Speech.todo

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/xtro-sharpie/api-annotations-dotnet/iOS-Speech.todo

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/xtro-sharpie/api-annotations-dotnet/macOS-Speech.todo

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/xtro-sharpie/iOS-Speech.todo

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/xtro-sharpie/macOS-Speech.todo

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)