iOS中AVPlayer系列怎么取得音频采样数据?

14次阅读

如题,AVFoundation.framework中多了一组类,AVPlayer,AVPlayerItem等。有没有什么巧办法通过这些类取得采样数据?

dyzdyz010

貌似,AVAudioPlayer可以。

AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:fileUrl error:&error];
    float sampleRate = [[player.settings valueForKey:AVSampleRateKey] floatValue];

RareXray

正文完