当前位置: 首页 > 工具软件 > iPhone TTS > 使用案例 >

获取苹果所有系统tts声音AVSpeechSynthesisVoice

蔺敏达
2023-12-01

NSArray* arrTmp = [AVSpeechSynthesisVoice speechVoices];

    NSMutableArray* arrVoicer = [[NSMutableArray alloc]init];

    for (AVSpeechSynthesisVoice* voicers in arrTmp) {

        NSMutableDictionary* dictInfo = [[NSMutableDictionary alloc]init];

        NSString* language = voicers.language;

        if (language==NULL) {

            language = @"";

        }

        NSString* name = voicers.name;

        if (name ==NULL) {

            name = @"";

        }

        NSString* prid = voicers.identifier;

        if (prid ==NULL) {

            prid = @"";

        }

        [dictInfo setValue:language forKey:@"language"];

        [dictInfo setValue:name forKey:@"name"];

        [dictInfo setValue:prid forKey:@"identify"];

        [arrVoicer addObject:dictInfo];

    }

 类似资料: