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


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

ios iphone

T多Y古S拉T 10 years, 5 months ago

貌似,AVAudioPlayer可以。

AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:fileUrl error:&error];
    float sampleRate = [[player.settings valueForKey:AVSampleRateKey] floatValue];
bisrot answered 10 years, 5 months ago

Your Answer