把数组中的内容分段阅读,语音分段阅读

//这里写自己的viewDidLoad

//给语音播报赋值

        NSString *str =self.nextmodel.content;

       //声明个数组 用逗号分隔 

        NSArray *strarray = [str componentsSeparatedByString:@","];

//调用

        [self speechWithArray:strarray];

#pragma mark===================把数组中的内容分段阅读,中间加入提示音========

-(void) speechWithArray:(NSArray *)array{

扫描二维码关注公众号,回复: 6004361 查看本文章

    self.speech_content_array = array;

    if(self.speech_content_array == nil || [self.speech_content_array count] <= 0 ){

        return ;

    }

    [self speechWithString:self.speech_content_array[0] ];

}

-(void) speechWithString:(NSString  *) content{

    

    [_iFlySpeechSynthesizer startSpeaking:content];

}

猜你喜欢

转载自blog.csdn.net/whx060900/article/details/89496224