次の方法で共有


Class SPXSpeechSynthesisCancellationDetails

Declaration

@class SPXSpeechSynthesisCancellationDetails : NSObject;

Description

Defines detailed information about why a speech synthesis result was canceled.

Added in version 1.7.0

Methods

initFromCanceledSynthesisResult:

Creates an instance of SPXSpeechSynthesisCancellationDetails object for the canceled SPXSpeechSynthesisResult.

- (instancetype _Nullable)initFromCanceledSynthesisResult:(SPXSpeechSynthesisResult * _Nonnull)synthesisResult

Parameters

  • synthesisResult - the synthesis result that was canceled.

Returns

the speech synthesis cancellation details object being created.

initFromCanceledSynthesisResult:error:

Creates an instance of SPXSpeechSynthesisCancellationDetails object for the canceled SPXSpeechSynthesisResult.

- (instancetype _Nullable)initFromCanceledSynthesisResult:(SPXSpeechSynthesisResult * _Nonnull)synthesisResult
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • synthesisResult - the synthesis result that was canceled.
  • outError - error information.

Returns

the speech synthesis cancellation details object being created.

initFromCanceledAudioDataStream:

Creates an instance of SPXSpeechSynthesisCancellationDetails object for the canceled SPXAudioDataStream.

- (instancetype _Nullable)initFromCanceledAudioDataStream:(SPXAudioDataStream * _Nonnull)stream

Parameters

  • stream - the audio data stream that was canceled.

Returns

the speech synthesis cancellation details object being created.

initFromCanceledAudioDataStream:error:

Creates an instance of SPXSpeechSynthesisCancellationDetails object for the canceled SPXAudioDataStream.

- (instancetype _Nullable)initFromCanceledAudioDataStream:(SPXAudioDataStream * _Nonnull)stream
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • stream - the audio data stream that was canceled.
  • outError - error information.

Returns

the speech synthesis cancellation details object being created.

Properties

reason

@property (readonly, atomic) SPXCancellationReason reason;

The reason the synthesis was canceled.

errorCode

@property (readonly, atomic) SPXCancellationErrorCode errorCode;

The error message in case of an unsuccessful synthesis (reason is set to Error). If reason is not an error, errorCode returns NoErro.

errorDetails

@property (readonly, copy, atomic) NSString * _Nullable errorDetails;

The error message in case of an unsuccessful synthesis (reason is set to Error).