|
@@ -181,9 +181,11 @@
|
|
|
|
|
|
|
|
- (void) evaluateVoice: (NSNumber*)index andPath:(NSString*)path andText:(NSString*)text andIsVideo:(BOOL) isVideo pathEvaluatorDecode:(NSString*)pathEvaluatorDecode videoId:(NSString*)videoId evaluatorType:(NSNumber*)evaluatorType sdkType:(NSNumber*)sdkType
|
|
- (void) evaluateVoice: (NSNumber*)index andPath:(NSString*)path andText:(NSString*)text andIsVideo:(BOOL) isVideo pathEvaluatorDecode:(NSString*)pathEvaluatorDecode videoId:(NSString*)videoId evaluatorType:(NSNumber*)evaluatorType sdkType:(NSNumber*)sdkType
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
self.index = index;
|
|
self.index = index;
|
|
|
if (sdkType.intValue == 0) {
|
|
if (sdkType.intValue == 0) {
|
|
|
//调用讯飞解析
|
|
//调用讯飞解析
|
|
|
|
|
+ [self.iFlySpeechEvaluator setParameter:evaluatorType.stringValue forKey:@"plev"];
|
|
|
if(isVideo) {
|
|
if(isVideo) {
|
|
|
[Mp4ToPcmHelper Mp4ToPcmWithUrl:[[NSURL alloc] initFileURLWithPath:path] completion:^(NSData *data) {
|
|
[Mp4ToPcmHelper Mp4ToPcmWithUrl:[[NSURL alloc] initFileURLWithPath:path] completion:^(NSData *data) {
|
|
|
if(data == nil) {
|
|
if(data == nil) {
|
|
@@ -276,6 +278,7 @@
|
|
|
|
|
|
|
|
// 评测结果回调
|
|
// 评测结果回调
|
|
|
- (void)onResults:(NSData *)results isLast:(BOOL)isLast {
|
|
- (void)onResults:(NSData *)results isLast:(BOOL)isLast {
|
|
|
|
|
+ BOOL isSuccess = false;
|
|
|
if (isLast) {
|
|
if (isLast) {
|
|
|
if(results) {
|
|
if(results) {
|
|
|
const char* chResult = [results bytes];
|
|
const char* chResult = [results bytes];
|
|
@@ -286,13 +289,13 @@
|
|
|
ISEResultXmlParser *parser = [ISEResultXmlParser alloc];
|
|
ISEResultXmlParser *parser = [ISEResultXmlParser alloc];
|
|
|
[parser setDelegate:self];
|
|
[parser setDelegate:self];
|
|
|
[parser parserXml:strResults];
|
|
[parser parserXml:strResults];
|
|
|
- } else {
|
|
|
|
|
- [_channel invokeMethod:@"evaluatorResult" arguments: [NSDictionary dictionaryWithObjectsAndKeys: self.index, @"index", [NSNull null], @"score", nil]];
|
|
|
|
|
|
|
+ isSuccess = YES;
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
- [_channel invokeMethod:@"evaluatorResult" arguments: [NSDictionary dictionaryWithObjectsAndKeys: self.index, @"index", [NSNull null], @"score", nil]];
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if(isSuccess == NO){
|
|
|
|
|
+ [_channel invokeMethod:@"evaluatorResult" arguments: [NSDictionary dictionaryWithObjectsAndKeys: self.index, @"index", [NSNull null], @"score", nil]];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (void)onCompleted:(IFlySpeechError *)errorCode {
|
|
- (void)onCompleted:(IFlySpeechError *)errorCode {
|