Extract meter levels from audio file
问题 I need to extract audio meter levels from a file so I can render the levels before playing the audio. I know AVAudioPlayer can get this information while playing the audio file through func averagePower(forChannel channelNumber: Int) -> Float. But in my case I would like to obtain an [Float] of meter levels beforehand. 回答1: Swift 4 It takes on an iPhone: 0.538s to process an 8MByte mp3 player with a 4min47s duration, and 44,100 sampling rate 0.170s to process an 712KByte mp3 player with a 22s