Questions tagged «waveform»

3
使用AVAssetReader绘制波形
我使用assetUrl从iPod库中读取歌曲(在代码中名为audioUrl),我可以用多种方式播放,剪切,可以对此进行一些处理,但是...我真的不明白该怎么办CMSampleBufferRef获取绘制波形的数据!我需要有关峰值的信息,如何以这种方式(也许是另一种方式)获得峰值? AVAssetTrack * songTrack = [audioUrl.tracks objectAtIndex:0]; AVAssetReaderTrackOutput * output = [[AVAssetReaderTrackOutput alloc] initWithTrack:songTrack outputSettings:nil]; [reader addOutput:output]; [output release]; NSMutableData * fullSongData = [[NSMutableData alloc] init]; [reader startReading]; while (reader.status == AVAssetReaderStatusReading){ AVAssetReaderTrackOutput * trackOutput = (AVAssetReaderTrackOutput *)[reader.outputs objectAtIndex:0]; CMSampleBufferRef sampleBufferRef = [trackOutput copyNextSampleBuffer]; if (sampleBufferRef){/* what I gonna do …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.