Skip to content

Commit

Permalink
fix:一些修改
Browse files Browse the repository at this point in the history
  • Loading branch information
garenwang committed Jul 26, 2022
1 parent a0a45dd commit 1c6414e
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 23 deletions.
12 changes: 12 additions & 0 deletions QCloudCOSXML/Classes/CI/model/QCloudAudioAsrqueueResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

@class QCloudAudioAsrqueueQueueListItem;
@class QCloudAudioAsrqueueNotifyConfig;
@class QCloudAudioAsrqueueResultNonExistPIDs;
NS_ASSUME_NONNULL_BEGIN

@interface QCloudAudioAsrqueueResult : NSObject
Expand All @@ -28,8 +29,19 @@ NS_ASSUME_NONNULL_BEGIN
/// 队列数组
@property (nonatomic,strong)NSArray <QCloudAudioAsrqueueQueueListItem *> *QueueList;

/// 队列 ID
@property (nonatomic,strong)QCloudAudioAsrqueueResultNonExistPIDs * NonExistPIDs;

@end


/// 不存在的队列 ID 列表
@interface QCloudAudioAsrqueueResultNonExistPIDs : NSObject

@property (nonatomic,strong)NSString *QueueID;
@end


@interface QCloudAudioAsrqueueQueueListItem : NSObject

/// 队列 ID
Expand Down
6 changes: 5 additions & 1 deletion QCloudCOSXML/Classes/CI/model/QCloudAudioAsrqueueResult.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
@implementation QCloudAudioAsrqueueResult
+ (NSDictionary *)modelContainerPropertyGenericClass {
return @{
@"QueueList": [QCloudAudioAsrqueueQueueListItem class]
@"QueueList": [QCloudAudioAsrqueueQueueListItem class],
@"NonExistPIDs": [QCloudAudioAsrqueueResultNonExistPIDs class]
};
}

Expand All @@ -28,6 +29,9 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic {

@end

@implementation QCloudAudioAsrqueueResultNonExistPIDs
@end

@implementation QCloudAudioAsrqueueQueueListItem
+ (NSDictionary *)modelContainerPropertyGenericClass {
return @{
Expand Down
14 changes: 1 addition & 13 deletions QCloudCOSXML/Classes/CI/model/QCloudGetAudioDiscernTaskResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#import <Foundation/Foundation.h>
#import "QCloudPostAudioDiscernTaskInfo.h"
@class QCloudGetAudioDiscernTaskSpeechRecognitionResult;
NS_ASSUME_NONNULL_BEGIN

@interface QCloudGetAudioDiscernTaskResult : NSObject
Expand All @@ -19,18 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *NonExistJobIds;

/// 在 job 的类型为 SpeechRecognition 且 job 状态为 success 时,返回语音识别的识别结果详情。
@property (nonatomic,strong)QCloudGetAudioDiscernTaskSpeechRecognitionResult *SpeechRecognitionResult;
@end


@interface QCloudGetAudioDiscernTaskSpeechRecognitionResult : NSObject
/// 识别结果
@property (nonatomic,strong)NSString *Result;
/// Response.SpeechRecognition.ResultDetail 识别结果详情,包含每个句子中的词时间偏移,一般用于生成字幕的场景。(识别请求中ResTextFormat=1时该字段不为空)
/// 注意:此字段可能返回 null,表示取不到有效值。
@property (nonatomic,strong)NSString *ResultDetail;
/// 语音时长
@property (nonatomic,assign)CGFloat AudioTime;
@property (nonatomic,strong)QCloudPostAudioDiscernTaskInfoSpeechRecognitionResult *SpeechRecognitionResult;
@end


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,9 @@ @implementation QCloudGetAudioDiscernTaskResult
+ (NSDictionary *)modelContainerPropertyGenericClass {
return @{
@"JobsDetail": [QCloudPostAudioDiscernTaskJobsDetail class],
@"SpeechRecognitionResult": [QCloudGetAudioDiscernTaskSpeechRecognitionResult class],
@"SpeechRecognitionResult": [QCloudPostAudioDiscernTaskInfoSpeechRecognitionResult class],
};
}
@end


@implementation QCloudGetAudioDiscernTaskSpeechRecognitionResult



@end

@implementation QCloudBatchGetAudioDiscernTaskResult
Expand Down
64 changes: 64 additions & 0 deletions QCloudCOSXML/Classes/CI/model/QCloudPostAudioDiscernTaskInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
@class QCloudPostAudioDiscernTaskJobsOperation;

@class QCloudPostAudioDiscernTaskResultInput;
@class QCloudPostAudioDiscernTaskInfoSpeechRecognitionResult;

@class QCloudPostAudioDiscernTaskInfoSpeechWords;
@class QCloudPostAudioDiscernTaskInfoSpeechResultDetail;
NS_ASSUME_NONNULL_BEGIN

@interface QCloudPostAudioDiscernTaskInfo : NSObject
Expand Down Expand Up @@ -124,6 +128,9 @@ NS_ASSUME_NONNULL_BEGIN

@property (nonatomic,strong)NSString *EndTime;


@property (nonatomic,strong)NSString *StartTime;

/// 任务所属的队列 ID
@property (nonatomic,strong)NSString *QueueId;

Expand Down Expand Up @@ -156,6 +163,63 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)QCloudPostAudioDiscernTaskInfoOutput *Output;

@property (nonatomic,strong)QCloudPostAudioDiscernTaskInfoSpeechRecognition *SpeechRecognition;

@property (nonatomic,strong)QCloudPostAudioDiscernTaskInfoSpeechRecognitionResult *SpeechRecognitionResult;
@end

@interface QCloudPostAudioDiscernTaskInfoSpeechRecognitionResult : NSObject

/// 语音时长
@property (nonatomic,strong)NSString *AudioTime;

/// 识别结果
@property (nonatomic,strong)NSString *Result;

/// 结果详情
@property (nonatomic,strong)NSArray <QCloudPostAudioDiscernTaskInfoSpeechResultDetail *> *ResultDetail;
@end

@interface QCloudPostAudioDiscernTaskInfoSpeechResultDetail : NSObject

/// 单句结束时间(毫秒)
@property (nonatomic,strong)NSString * EndMs;

/// 单句最终识别结果
@property (nonatomic,strong)NSString * FinalSentence;

/// 单句中间识别结果,使用空格拆分为多个词
@property (nonatomic,strong)NSString * SliceSentence;

/// 声道或说话人 Id(请求中如果设置了 speaker_diarization或者ChannelNum为双声道,可区分说话人或声道)
@property (nonatomic,strong)NSString * SpeakerId;

/// 单句语速,单位:字数/秒
@property (nonatomic,strong)NSString * SpeechSpeed;

/// 单句开始时间(毫秒)
@property (nonatomic,strong)NSString * StartMs;

/// 单句中词详情
@property (nonatomic,strong)NSArray <QCloudPostAudioDiscernTaskInfoSpeechWords *> * Words;

/// 单句中词个数
@property (nonatomic,strong)NSString * WordsNum;
@end

@interface QCloudPostAudioDiscernTaskInfoSpeechWords : NSObject


/// 在句子中的结束时间偏移量
@property (nonatomic,strong)NSString * OffsetEndMs;

/// 在句子中的开始时间偏移量
@property (nonatomic,strong)NSString * OffsetStartMs;
@property (nonatomic,strong)NSString * VoiceType;

/// 词文本
@property (nonatomic,strong)NSString * Word;

@end


NS_ASSUME_NONNULL_END
49 changes: 48 additions & 1 deletion QCloudCOSXML/Classes/CI/model/QCloudPostAudioDiscernTaskInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ @implementation QCloudPostAudioDiscernTaskJobsOperation
+ (NSDictionary *)modelContainerPropertyGenericClass {
return @{
@"Output": [QCloudPostAudioDiscernTaskInfoOutput class],
@"SpeechRecognition":[QCloudPostAudioDiscernTaskInfoSpeechRecognition class]
@"SpeechRecognition":[QCloudPostAudioDiscernTaskInfoSpeechRecognition class],
@"SpeechRecognitionResult":[QCloudPostAudioDiscernTaskInfoSpeechRecognitionResult class]
};
}

Expand All @@ -84,3 +85,49 @@ + (NSDictionary *)modelContainerPropertyGenericClass {
@implementation QCloudPostAudioDiscernTaskResultInput

@end

@implementation QCloudPostAudioDiscernTaskInfoSpeechRecognitionResult
+ (NSDictionary *)modelContainerPropertyGenericClass {
return @{
@"ResultDetail": [QCloudPostAudioDiscernTaskInfoSpeechResultDetail class]
};
}

- (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic {
if (!dic) {
return dic;
}

NSMutableDictionary * mdic = [NSMutableDictionary dictionaryWithDictionary:dic];
if ([mdic[@"ResultDetail"] isKindOfClass:[NSDictionary class]]) {
[mdic setValue:@[mdic[@"ResultDetail"]] forKey:@"ResultDetail"];
}
return mdic.mutableCopy;
}
@end


@implementation QCloudPostAudioDiscernTaskInfoSpeechResultDetail
+ (NSDictionary *)modelContainerPropertyGenericClass {
return @{
@"Words": [QCloudPostAudioDiscernTaskInfoSpeechWords class]
};
}

- (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic {
if (!dic) {
return dic;
}

NSMutableDictionary * mdic = [NSMutableDictionary dictionaryWithDictionary:dic];
if ([mdic[@"Words"] isKindOfClass:[NSDictionary class]]) {
[mdic setValue:@[mdic[@"Words"]] forKey:@"Words"];
}
return mdic.mutableCopy;
}
@end

@implementation QCloudPostAudioDiscernTaskInfoSpeechWords

@end

0 comments on commit 1c6414e

Please sign in to comment.