Ver código fonte

ai设置完善

桂欢 1 ano atrás
pai
commit
c82f852c22

+ 5 - 0
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLAiSetVc.m

@@ -39,6 +39,11 @@
     self.tableView.backgroundColor = [UIColor colorFormString:@"#F2F3F7"];
 }
 
+- (void)viewWillDisappear:(BOOL)animated {
+    [super viewWillDisappear:animated];
+    [_play stopNuisdkPlay];
+}
+
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear: animated];
     _dataModels = nil;

+ 4 - 4
SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/Cells/SLMySpeedCell.m

@@ -36,14 +36,17 @@
     __block NSString *keyStr = @"";
     NSString *speechRate;
     NSInteger idx = 1;
+    NSDictionary *dict = @{};
     if ([detail.title isEqualToString:@"口音设置"]) {
         speechRate = [SLGlobalInfo SharedInstance].roleModel.language;
+        dict = [RoleModel roleLanuchModelDict];
     }
     if ([detail.title isEqualToString:@"语速设置"]) {
         speechRate = [SLGlobalInfo SharedInstance].roleModel.speechRate;
+        dict = [RoleModel roleSpeedModelDict];
     }
     if (speechRate) {
-        [[RoleModel roleSpeedModelDict] enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
+        [dict enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
             if ([obj isEqualToString:speechRate]) {
                 keyStr = key;
                 *stop = YES;
@@ -54,9 +57,6 @@
     [self.segmentView setTitlesWithArray:detail.segments];
     [self.segmentView updateWithSpacing:2 topHeight:2];
     self.segmentView.selectIndex = idx;
-//    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-//
-//    });
 }
 
 @end

+ 2 - 0
SLAiELTS/SLAiELTS/ViewControllers/RoleLabelVC/Models/RoleModel.h

@@ -61,6 +61,8 @@ typedef enum : NSUInteger {
 
 + (NSDictionary *)roleSpeedModelDict;
 
++ (NSDictionary *)roleLanuchModelDict;
+
 @end
 
 @interface RoleViewModel : RoleModel

+ 6 - 0
SLAiELTS/SLAiELTS/ViewControllers/RoleLabelVC/Models/RoleModel.m

@@ -46,6 +46,12 @@
              @"慢" : @"0.5"};
 }
 
++ (NSDictionary *)roleLanuchModelDict {
+    return @{
+            @"英音" : @"1",
+            @"美音" : @"0",};
+}
+
 @end
 
 @implementation RoleViewModel