//
//  AppDelegate.m
//  TTSSDKDemo
//
//  Created by apple on 2023/12/13.
//

#import "AppDelegate.h"
#import "TestViewController.h"
#import <TTSSDK/TTSSDK.h>
#import "IQKeyboardManager.h"
#import "HCToast.h"
@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//    self.window.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
    
    TestViewController *vc = [[TestViewController   alloc] init];
    UINavigationController *naviVC = [[UINavigationController alloc] initWithRootViewController:vc];
    [self.window setRootViewController:naviVC];
    [self.window makeKeyAndVisible];
    
    
    TTSParams *params = [[TTSParams alloc] init];
    params.text = @"";
    params.langType = @"zh-cmn-Hans-CN";
    params.format = @"mp3";
    params.voice = @"Yaqing";
    params.volume = 1;//[0.1, 3]
    params.speech_rate = 1.0;// [0.2,3]
    params.pitch_rate = 1.0;// [0.1, 3]
    params.sample_rate = 16000;
    params.online = YES;

    [[TTSManger shareInstance] setSdkParams:params];

//
    [[TTSManger shareInstance] initWithWithAppid:@"288eb6d0-e86f-4cd4-a632-e012c0f07439" WithAppSecret:@"UXlKAwa48t" WithinitBlock:^(NSString * _Nonnull ErrorMessage) {
        if (ErrorMessage == nil) {
            NSLog(@"init success");
            [[HCToast shareInstance] showToast:@"init success"];
        }else{
            [[HCToast shareInstance] showToast:ErrorMessage];
        }
    }];
    
    return YES;
}


#pragma mark - UISceneSession lifecycle




@end
