【发布时间】:2013-03-17 03:10:35
【问题描述】:
播放效果使用[[SimpleAudioEngine sharedEngine] playEffect:@"sound.mp3"];
使用的音频文件的长度限制是多少?
【问题讨论】:
播放效果使用[[SimpleAudioEngine sharedEngine] playEffect:@"sound.mp3"];
使用的音频文件的长度限制是多少?
【问题讨论】:
我认为你可以参考 AVAudioFoundation 来使用 AvAudioPlayer 及其属性“duration”。
使用 .h
< AVAudioPlayerDelegate protocol>
AVAudioPlayer *audioPlayer;
@property (nonatomic, retain) AVAudioPlayer *audioPlayer;
.m
audioPlayer = [[AVAudioPlayer alloc] initWithData:dataAudio error:nil];
audioPlayer.delegate = self;
float sliderLength = [audioPlayer duration];
【讨论】: