商户详情

一.播放音频

NSURL *url = [NSURL URLWithString:voiceintro];

NSData * audioData = [NSData dataWithContentsOfURL:url];

//将数据保存到本地指定位置

NSString *docDirPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];

NSString *filePath = [NSString stringWithFormat:@"%@/%@.mp3", docDirPath , @"temp"];

[audioData writeToFile:filePath atomically:YES];

//播放本地音乐

NSURL *fileURL = [NSURL fileURLWithPath:filePath];

avAudioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil];

//预播放

[avAudioPlayer prepareToPlay];

[voicebtn setTitleColor:MainColor forState:UIControlStateNormal];

[voicebtn addTarget:self action:@selector(startvoice) forControlEvents:UIControlEventTouchUpInside];

//点击播放按钮

-(void)startvoice

{

[avAudioPlayer play];

}

二.TggStarEvaluationView 星星评价视图

TggStarEvaluationView 星星评价视图

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 发现 关注 消息 iOS 第三方库、插件、知名博客总结 作者大灰狼的小绵羊哥哥关注 2017.06.26 09:4...
    肇东周阅读 12,267评论 4 61
  • 代码题目 以下代码输出什么? (难度**) 分析如下 2 . 写一个函数,返回参数的平方和(难度**) 分析 3 ...
    韩佳宁阅读 680评论 0 0
  • 想吃没有香菜和洋葱的烤冷面 想吃没有青椒的千页豆腐 想吃没有花椒的麻辣香锅 想吃加很多醋的土豆粉 想吃西红柿鸡蛋汤...
    街角的汪别惹喵阅读 234评论 0 0
  • 愿意对自己的人生负责,这是一个人自尊心萌芽的表现。 从小妈妈就教我凡事都问个为什么,她是那种对没完没了的“为什么”...
    时间的故事阅读 476评论 5 2