2012-02-23 42 views
0

爲playeffect音頻文件的使用[[SimpleAudioEngine sharedEngine] playEffect:@"sound.mp3"];長度SimpleAudioEngine

是做什麼用的音頻文件的限制長度播放效果?

回答

0

我想你可以參考AVAudioFoundation這個使用AvAudioPlayer及其屬性「持續時間」工作。

使用的.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];