【问题标题】:length of audio file for playeffect in SimpleAudioEngineSimpleAudioEngine中播放效果的音频文件长度
【发布时间】:2013-03-17 03:10:35
【问题描述】:

播放效果使用[[SimpleAudioEngine sharedEngine] playEffect:@"sound.mp3"];

使用的音频文件的长度限制是多少?

【问题讨论】:

    标签: iphone simpleaudioengine


    【解决方案1】:

    我认为你可以参考 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];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-18
      • 2017-12-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多